Do not use code preprocessing anymore
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
<mkdir dir="${docs.output}"/>
|
<mkdir dir="${docs.output}"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="preprocess-common-and-compile-builtins">
|
<target name="dist-stdlib">
|
||||||
<java classname="org.gradle.wrapper.GradleWrapperMain"
|
<java classname="org.gradle.wrapper.GradleWrapperMain"
|
||||||
fork="true"
|
fork="true"
|
||||||
dir="${basedir}/.."
|
dir="${basedir}/.."
|
||||||
@@ -34,7 +34,6 @@
|
|||||||
<pathelement location="${basedir}/../gradle/wrapper/gradle-wrapper.jar"/>
|
<pathelement location="${basedir}/../gradle/wrapper/gradle-wrapper.jar"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
<arg line="--no-daemon"/>
|
<arg line="--no-daemon"/>
|
||||||
<arg line=":kotlin-stdlib-common:preprocessSourcesMain"/>
|
|
||||||
<arg line=":kotlin-stdlib:distJar"/>
|
<arg line=":kotlin-stdlib:distJar"/>
|
||||||
</java>
|
</java>
|
||||||
</target>
|
</target>
|
||||||
@@ -46,7 +45,7 @@
|
|||||||
<fileset dir="${basedir}/stdlib/jvm/build/libs/" includes="dist-kotlin-stdlib.jar"/>
|
<fileset dir="${basedir}/stdlib/jvm/build/libs/" includes="dist-kotlin-stdlib.jar"/>
|
||||||
<pathelement location="${basedir}/lib/junit-4.11.jar"/>
|
<pathelement location="${basedir}/lib/junit-4.11.jar"/>
|
||||||
</path>
|
</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"
|
<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">
|
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/native" />
|
||||||
<sourceRoot path="../core/builtins/src" />
|
<sourceRoot path="../core/builtins/src" />
|
||||||
<sourceRoot path="stdlib/common/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"/>
|
<sourcelink path=".." url="http://github.com/JetBrains/kotlin/blob/${github.revision}" linesuffix="#L"/>
|
||||||
|
|
||||||
|
|||||||
@@ -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]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ apply plugin: 'kotlin-platform-common'
|
|||||||
configureDist(project)
|
configureDist(project)
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
|
|
||||||
def commonSrcDir = "${buildDir}/common-sources"
|
def commonSrcDir = "../src"
|
||||||
def commonTestSrcDir = "${buildDir}/common-test-sources"
|
def commonTestSrcDir = "../test"
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@@ -28,11 +28,8 @@ dependencies {
|
|||||||
testCompile project(":kotlin-test:kotlin-test-annotations-common")
|
testCompile project(":kotlin-test:kotlin-test-annotations-common")
|
||||||
}
|
}
|
||||||
|
|
||||||
createPreprocessorTask(project, "Main", "${projectDir}/../src/kotlin", commonSrcDir)
|
|
||||||
createPreprocessorTask(project, "Test", "${projectDir}/../test", commonTestSrcDir)
|
|
||||||
|
|
||||||
compileKotlinCommon {
|
compileKotlinCommon {
|
||||||
dependsOn preprocessSourcesMain
|
dependsOn(":prepare:build.version:writeStdlibVersion")
|
||||||
// dependsOn ":prepare:compiler:prepare-compiler-with-bootstrap-runtime"
|
// dependsOn ":prepare:compiler:prepare-compiler-with-bootstrap-runtime"
|
||||||
// compilerJarFile = compilerJarWithBootstrapRuntime
|
// compilerJarFile = compilerJarWithBootstrapRuntime
|
||||||
}
|
}
|
||||||
@@ -48,9 +45,6 @@ compileKotlinCommon {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
compileTestKotlinCommon {
|
|
||||||
dependsOn preprocessSourcesTest
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin.experimental.coroutines 'enable'
|
kotlin.experimental.coroutines 'enable'
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ sourceSets {
|
|||||||
if(!System.properties.'idea.active') {
|
if(!System.properties.'idea.active') {
|
||||||
srcDir '../jvm/test'
|
srcDir '../jvm/test'
|
||||||
srcDir '../common/test'
|
srcDir '../common/test'
|
||||||
srcDir '../common/build/common-test-sources'
|
srcDir '../test'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,6 @@ compileKotlin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileTestKotlin {
|
compileTestKotlin {
|
||||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
|
|
||||||
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
|
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ sourceSets {
|
|||||||
if(!System.properties.'idea.active') {
|
if(!System.properties.'idea.active') {
|
||||||
srcDir '../jvm/test'
|
srcDir '../jvm/test'
|
||||||
srcDir '../common/test'
|
srcDir '../common/test'
|
||||||
srcDir '../common/build/common-test-sources'
|
srcDir '../test'
|
||||||
srcDir '../jdk7/test'
|
srcDir '../jdk7/test'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,6 @@ compileKotlin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileTestKotlin {
|
compileTestKotlin {
|
||||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
|
|
||||||
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
|
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ sourceSets {
|
|||||||
if(!System.properties.'idea.active') {
|
if(!System.properties.'idea.active') {
|
||||||
srcDir '../jvm/test'
|
srcDir '../jvm/test'
|
||||||
srcDir '../common/test'
|
srcDir '../common/test'
|
||||||
srcDir '../common/build/common-test-sources'
|
srcDir '../test'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,6 @@ compileKotlin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileTestKotlin {
|
compileTestKotlin {
|
||||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
|
|
||||||
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
|
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xmulti-platform"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ sourceSets {
|
|||||||
if(!System.properties.'idea.active') {
|
if(!System.properties.'idea.active') {
|
||||||
srcDir '../jvm/test'
|
srcDir '../jvm/test'
|
||||||
srcDir '../common/test'
|
srcDir '../common/test'
|
||||||
srcDir '../common/build/common-test-sources'
|
srcDir '../test'
|
||||||
srcDir '../jre7/test'
|
srcDir '../jre7/test'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,6 @@ compileKotlin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileTestKotlin {
|
compileTestKotlin {
|
||||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
|
|
||||||
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xnormalize-constructor-calls=enable", "-Xmulti-platform"]
|
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xnormalize-constructor-calls=enable", "-Xmulti-platform"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ configurePublishing(project)
|
|||||||
|
|
||||||
def builtinsSrcDir = "${buildDir}/builtin-sources"
|
def builtinsSrcDir = "${buildDir}/builtin-sources"
|
||||||
def builtinsSrcDir2 = "${buildDir}/builtin-sources-for-builtins"
|
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 builtinsDir = "${rootDir}/core/builtins"
|
||||||
def experimentalSrcDir = "${rootDir}/libraries/stdlib/experimental"
|
def experimentalSrcDir = "${rootDir}/libraries/stdlib/experimental"
|
||||||
@@ -43,7 +44,6 @@ sourceSets {
|
|||||||
kotlin {
|
kotlin {
|
||||||
srcDir builtinsSrcDir
|
srcDir builtinsSrcDir
|
||||||
srcDir jsSrcDir
|
srcDir jsSrcDir
|
||||||
srcDir commonSrcDir
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,13 +130,12 @@ compileBuiltinsKotlin2Js {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileKotlin2Js {
|
compileKotlin2Js {
|
||||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesMain")
|
|
||||||
dependsOn prepareBuiltinsSources
|
dependsOn prepareBuiltinsSources
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
outputFile = "${buildDir}/classes/main/kotlin.js"
|
outputFile = "${buildDir}/classes/main/kotlin.js"
|
||||||
sourceMap = true
|
sourceMap = true
|
||||||
sourceMapPrefix = "./"
|
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 {
|
compileTestKotlin2Js {
|
||||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
moduleKind = "umd"
|
moduleKind = "umd"
|
||||||
}
|
}
|
||||||
@@ -213,7 +211,7 @@ task compileJs(type: JavaExec) {
|
|||||||
if (prefixToRemove != null) sourcePath.substring(prefixToRemove.length()) else sourcePath
|
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 ->
|
sourceMap.sourcesContent = sourceMap.sources.collect { sourceName ->
|
||||||
def text = sourceMapSourcesBaseDirs.collect { file("$it/$sourceName") }.find { it.exists() }?.text
|
def text = sourceMapSourcesBaseDirs.collect { file("$it/$sourceName") }.find { it.exists() }?.text
|
||||||
|
|||||||
@@ -108,8 +108,6 @@ check.dependsOn(dexMethodCount)
|
|||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
dependsOn(":core:builtins:serialize")
|
dependsOn(":core:builtins:serialize")
|
||||||
dependsOn(":prepare:build.version:writeStdlibVersion")
|
|
||||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesMain")
|
|
||||||
classpath += files("${rootDir}/dist/builtins")
|
classpath += files("${rootDir}/dist/builtins")
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
freeCompilerArgs = [
|
freeCompilerArgs = [
|
||||||
@@ -123,10 +121,6 @@ compileKotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileTestKotlin {
|
|
||||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
compileExperimentalKotlin {
|
compileExperimentalKotlin {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|||||||
Reference in New Issue
Block a user