[FIR] Initialize module for checkers generator

This commit is contained in:
Dmitriy Novozhilov
2020-09-04 12:06:57 +03:00
parent 6656669551
commit 4de57fcac2
5 changed files with 84 additions and 1 deletions
+42 -1
View File
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.ideaExt.idea
plugins {
kotlin("jvm")
id("jps-compatible")
@@ -18,6 +20,45 @@ dependencies {
}
sourceSets {
"main" { projectDefault() }
"main" {
projectDefault()
this.java.srcDir("gen")
}
"test" { none() }
}
val generatorClasspath by configurations.creating
dependencies {
generatorClasspath(project("checkers-component-generator"))
}
val generationRoot = projectDir.resolve("gen")
val generateCheckersComponents by tasks.registering(NoDebugJavaExec::class) {
val generatorRoot = "$projectDir/checkers-component-generator/src/"
val generatorConfigurationFiles = fileTree(generatorRoot) {
include("**/*.kt")
}
inputs.files(generatorConfigurationFiles)
outputs.dirs(generationRoot)
args(generationRoot)
classpath = generatorClasspath
main = "org.jetbrains.kotlin.fir.checkers.generator.MainKt"
systemProperties["line.separator"] = "\n"
}
val compileKotlin by tasks
compileKotlin.dependsOn(generateCheckersComponents)
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
apply(plugin = "idea")
idea {
this.module.generatedSourceDirs.add(generationRoot)
}
}
@@ -0,0 +1,32 @@
plugins {
kotlin("jvm")
id("jps-compatible")
application
}
dependencies {
implementation(project(":compiler:fir:tree"))
implementation(project(":compiler:fir:tree:tree-generator"))
implementation(project(":kotlin-reflect"))
implementation(project(":kotlin-reflect-api"))
}
val writeCopyright by task<tasks.WriteCopyrightToFile> {
outputFile = file("$buildDir/copyright/notice.txt")
commented = true
}
application {
mainClassName = "org.jetbrains.kotlin.fir.checkers.generator.MainKt"
}
val processResources by tasks
processResources.dependsOn(writeCopyright)
sourceSets {
"main" {
projectDefault()
resources.srcDir("$buildDir/copyright")
}
"test" {}
}
@@ -0,0 +1,8 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.fir.checkers.generator
fun main() {}
+1
View File
@@ -0,0 +1 @@
*.kt eol=lf
+1
View File
@@ -314,6 +314,7 @@ include ":compiler:fir:cones",
":compiler:fir:dump",
":compiler:fir:jvm",
":compiler:fir:checkers",
":compiler:fir:checkers:checkers-component-generator",
":compiler:fir:entrypoint",
":compiler:fir:analysis-tests"