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
+2 -7
View File
@@ -13,14 +13,9 @@ sourceSets {
}
}
ant.properties.baseDir = projectDir
ant.properties.commonSrcDir = commonSrcDir
ant.properties.kotlinCompiler = bootstrapCompilerFile.path
ant.properties.compilerPreloader = compilerPreloaderFile.path
createPreprocessorTask(project, "Main", "${projectDir}/../src/kotlin", commonSrcDir)
ant.importBuild('tasks.xml')
compileKotlinCommon.dependsOn commonSources
compileKotlinCommon.dependsOn preprocessSourcesMain
/*
// TODO: currently unsupported
-20
View File
@@ -1,20 +0,0 @@
<project>
<target name="commonSources">
<delete dir="${commonSrcDir}" failonerror="false"/>
<mkdir dir="${commonSrcDir}"/>
<java classname="org.jetbrains.kotlin.preloading.Preloader" failonerror="true" fork="true">
<classpath>
<pathelement location="${compilerPreloader}"/>
</classpath>
<assertions>
<enable/>
</assertions>
<arg value="-cp"/>
<arg value="${kotlinCompiler}"/>
<arg value="org.jetbrains.kotlin.preprocessor.PreprocessorCLI"/>
<arg value="${basedir}/../src/kotlin"/>
<arg value="${commonSrcDir}"/>
<arg value="JS"/>
</java>
</target>
</project>
+2 -7
View File
@@ -60,12 +60,7 @@ sourceSets {
}
}
ant.properties.baseDir = projectDir
ant.properties.commonSrcDir = commonSrcDir
ant.properties.kotlinCompiler = bootstrapCompilerFile.path
ant.properties.compilerPreloader = compilerPreloaderFile.path
ant.importBuild('../common/tasks.xml')
createPreprocessorTask(project, "Main", "${projectDir}/../src/kotlin", commonSrcDir)
kotlin.experimental.coroutines "enable"
@@ -88,7 +83,7 @@ compileBuiltinsKotlin2Js {
}
compileKotlin2Js {
dependsOn commonSources
dependsOn preprocessSourcesMain
kotlinOptions {
outputFile = "${buildDir}/classes/main/kotlin.js"
}