Rewrite preprocessor task in gradle without ant

This commit is contained in:
Ilya Gorbunov
2017-03-24 04:41:56 +03:00
parent 8fd8310033
commit 0e1fc0cff2
4 changed files with 13 additions and 35 deletions
+9 -1
View File
@@ -15,7 +15,6 @@ ext.JDK_16 = System.getenv("JDK_16")
ext.JDK_17 = System.getenv("JDK_17")
ext.JDK_18 = System.getenv("JDK_18")
ext.bootstrapCompilerFile = project.file("${rootDir}/../dist/kotlinc/lib/kotlin-compiler.jar")
ext.compilerPreloaderFile = project.file("${rootDir}/../dist/kotlinc/lib/kotlin-preloader.jar")
allprojects {
group = 'org.jetbrains.kotlin'
@@ -122,3 +121,12 @@ static def manifestAttributes(Manifest manifest, Project project, String compone
}
}
def createPreprocessorTask(Project project, def name, def sourceDir, def targetDir, def profile = "JS") {
return project.tasks.create("preprocessSources$name", JavaExec) {
inputs.dir(sourceDir)
outputs.dir(targetDir)
classpath = project.files(bootstrapCompilerFile)
main = "org.jetbrains.kotlin.preprocessor.PreprocessorCLI"
args = [sourceDir, targetDir, profile]
}
}