Do not use code preprocessing anymore

This commit is contained in:
Ilya Gorbunov
2018-03-21 20:47:05 +03:00
parent 37787f9769
commit ac3de447ae
9 changed files with 14 additions and 45 deletions
+3 -4
View File
@@ -23,7 +23,7 @@
<mkdir dir="${docs.output}"/>
</target>
<target name="preprocess-common-and-compile-builtins">
<target name="dist-stdlib">
<java classname="org.gradle.wrapper.GradleWrapperMain"
fork="true"
dir="${basedir}/.."
@@ -34,7 +34,6 @@
<pathelement location="${basedir}/../gradle/wrapper/gradle-wrapper.jar"/>
</classpath>
<arg line="--no-daemon"/>
<arg line=":kotlin-stdlib-common:preprocessSourcesMain"/>
<arg line=":kotlin-stdlib:distJar"/>
</java>
</target>
@@ -46,7 +45,7 @@
<fileset dir="${basedir}/stdlib/jvm/build/libs/" includes="dist-kotlin-stdlib.jar"/>
<pathelement location="${basedir}/lib/junit-4.11.jar"/>
</path>
<target name="document" depends="clean,preprocess-common-and-compile-builtins">
<target name="document" depends="clean,dist-stdlib">
<dokka samples="stdlib/samples/test" outputDir="${docs.output}/jre8" moduleName="kotlin-stdlib" skipDeprecated="false" outputFormat="${dokka.format}" jdkversion="8" impliedplatforms="JVM,JS"
include="stdlib/src/Module.md" noStdlibLink="true" classpathref="stdlib.compile.classpath" languageVersion="1.2">
@@ -74,7 +73,7 @@
<sourceRoot path="../core/builtins/native" />
<sourceRoot path="../core/builtins/src" />
<sourceRoot path="stdlib/common/src" />
<sourceRoot path="stdlib/common/build/common-sources" />
<sourceRoot path="stdlib/src" />
<sourcelink path=".." url="http://github.com/JetBrains/kotlin/blob/${github.revision}" linesuffix="#L"/>
-12
View File
@@ -217,15 +217,3 @@ ext.configurePublishing = { Project project ->
}
}
ext.createPreprocessorTask = { Project project, def name, def sourceDir, def targetDir, def profile = "JS" ->
return project.tasks.create("preprocessSources$name", JavaExec) {
// dependsOn(rootProject.prepareBootstrap)
inputs.dir(sourceDir)
outputs.dir(targetDir)
classpath = rootProject.configurations.bootstrapCompile
// classpath = project.files(bootstrapCompilerFile)
main = "org.jetbrains.kotlin.preprocessor.PreprocessorCLI"
args = [sourceDir, targetDir, profile]
}
}
+3 -9
View File
@@ -5,8 +5,8 @@ apply plugin: 'kotlin-platform-common'
configureDist(project)
configurePublishing(project)
def commonSrcDir = "${buildDir}/common-sources"
def commonTestSrcDir = "${buildDir}/common-test-sources"
def commonSrcDir = "../src"
def commonTestSrcDir = "../test"
sourceSets {
main {
@@ -28,11 +28,8 @@ dependencies {
testCompile project(":kotlin-test:kotlin-test-annotations-common")
}
createPreprocessorTask(project, "Main", "${projectDir}/../src/kotlin", commonSrcDir)
createPreprocessorTask(project, "Test", "${projectDir}/../test", commonTestSrcDir)
compileKotlinCommon {
dependsOn preprocessSourcesMain
dependsOn(":prepare:build.version:writeStdlibVersion")
// dependsOn ":prepare:compiler:prepare-compiler-with-bootstrap-runtime"
// compilerJarFile = compilerJarWithBootstrapRuntime
}
@@ -48,9 +45,6 @@ compileKotlinCommon {
}
*/
compileTestKotlinCommon {
dependsOn preprocessSourcesTest
}
kotlin.experimental.coroutines 'enable'
+1 -2
View File
@@ -24,7 +24,7 @@ sourceSets {
if(!System.properties.'idea.active') {
srcDir '../jvm/test'
srcDir '../common/test'
srcDir '../common/build/common-test-sources'
srcDir '../test'
}
}
}
@@ -66,7 +66,6 @@ compileKotlin {
}
compileTestKotlin {
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
}
+1 -2
View File
@@ -26,7 +26,7 @@ sourceSets {
if(!System.properties.'idea.active') {
srcDir '../jvm/test'
srcDir '../common/test'
srcDir '../common/build/common-test-sources'
srcDir '../test'
srcDir '../jdk7/test'
}
}
@@ -69,7 +69,6 @@ compileKotlin {
}
compileTestKotlin {
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
}
+1 -2
View File
@@ -24,7 +24,7 @@ sourceSets {
if(!System.properties.'idea.active') {
srcDir '../jvm/test'
srcDir '../common/test'
srcDir '../common/build/common-test-sources'
srcDir '../test'
}
}
}
@@ -59,7 +59,6 @@ compileKotlin {
}
compileTestKotlin {
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
}
+1 -2
View File
@@ -26,7 +26,7 @@ sourceSets {
if(!System.properties.'idea.active') {
srcDir '../jvm/test'
srcDir '../common/test'
srcDir '../common/build/common-test-sources'
srcDir '../test'
srcDir '../jre7/test'
}
}
@@ -62,7 +62,6 @@ compileKotlin {
}
compileTestKotlin {
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xnormalize-constructor-calls=enable", "-Xmulti-platform"]
}
+4 -6
View File
@@ -13,7 +13,8 @@ configurePublishing(project)
def builtinsSrcDir = "${buildDir}/builtin-sources"
def builtinsSrcDir2 = "${buildDir}/builtin-sources-for-builtins"
def commonSrcDir = "${projectDir}/../common/src/build/common-sources"
def commonSrcDir = "${projectDir}/../src/kotlin"
def commonSrcDir2 = "${projectDir}/../common/src"
def builtinsDir = "${rootDir}/core/builtins"
def experimentalSrcDir = "${rootDir}/libraries/stdlib/experimental"
@@ -43,7 +44,6 @@ sourceSets {
kotlin {
srcDir builtinsSrcDir
srcDir jsSrcDir
srcDir commonSrcDir
}
}
@@ -130,13 +130,12 @@ compileBuiltinsKotlin2Js {
}
compileKotlin2Js {
dependsOn(":kotlin-stdlib-common:preprocessSourcesMain")
dependsOn prepareBuiltinsSources
kotlinOptions {
outputFile = "${buildDir}/classes/main/kotlin.js"
sourceMap = true
sourceMapPrefix = "./"
freeCompilerArgs += ["-source-map-base-dirs", [builtinsSrcDir, jsSrcDir, commonSrcDir].collect { file(it).absoluteFile }.join(File.pathSeparator)]
freeCompilerArgs += ["-source-map-base-dirs", [builtinsSrcDir, jsSrcDir, commonSrcDir, commonSrcDir2].collect { file(it).absoluteFile }.join(File.pathSeparator)]
}
}
@@ -153,7 +152,6 @@ compileExperimentalKotlin2Js {
}
compileTestKotlin2Js {
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
kotlinOptions {
moduleKind = "umd"
}
@@ -213,7 +211,7 @@ task compileJs(type: JavaExec) {
if (prefixToRemove != null) sourcePath.substring(prefixToRemove.length()) else sourcePath
}
def sourceMapSourcesBaseDirs = [jsSrcDir, jsSrcJsDir, builtinsSrcDir, commonSrcDir, projectDir, experimentalSrcDir]
def sourceMapSourcesBaseDirs = [jsSrcDir, jsSrcJsDir, builtinsSrcDir, commonSrcDir, commonSrcDir2, projectDir, experimentalSrcDir]
sourceMap.sourcesContent = sourceMap.sources.collect { sourceName ->
def text = sourceMapSourcesBaseDirs.collect { file("$it/$sourceName") }.find { it.exists() }?.text
-6
View File
@@ -108,8 +108,6 @@ check.dependsOn(dexMethodCount)
compileKotlin {
dependsOn(":core:builtins:serialize")
dependsOn(":prepare:build.version:writeStdlibVersion")
dependsOn(":kotlin-stdlib-common:preprocessSourcesMain")
classpath += files("${rootDir}/dist/builtins")
kotlinOptions {
freeCompilerArgs = [
@@ -123,10 +121,6 @@ compileKotlin {
}
}
compileTestKotlin {
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
}
compileExperimentalKotlin {
kotlinOptions {