Build common standard library headers and kotlin-test (common and jvm) as multiplatform projects.
This commit is contained in:
@@ -1,2 +1,68 @@
|
||||
description = 'Kotlin Common Standard Library'
|
||||
|
||||
apply plugin: 'kotlin-platform-common'
|
||||
|
||||
ext.commonSrcDir = "${buildDir}/common-sources"
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
kotlin {
|
||||
srcDir 'src'
|
||||
srcDir commonSrcDir
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ant.properties.baseDir = projectDir
|
||||
ant.properties.commonSrcDir = commonSrcDir
|
||||
ant.properties.kotlinCompiler = bootstrapCompilerFile.path
|
||||
ant.properties.compilerPreloader = compilerPreloaderFile.path
|
||||
|
||||
ant.importBuild('tasks.xml')
|
||||
|
||||
compileKotlinCommon.dependsOn commonSources
|
||||
|
||||
/*
|
||||
// TODO: currently unsupported
|
||||
compileKotlinCommon {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = [
|
||||
"-module-name", "${project.name}".toString()
|
||||
]
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
compileKotlinCommon.compilerJarFile = bootstrapCompilerFile
|
||||
|
||||
|
||||
|
||||
jar {
|
||||
baseName = project.name
|
||||
manifest {
|
||||
attributes 'Implementation-Vendor': 'JetBrains',
|
||||
'Implementation-Title': "${project.description ?: project.name}", // TODO: project.description is resolved after evaluating this, therefore this attribute is repeated in the projects; seek for a solution
|
||||
'Implementation-Version': version,
|
||||
'Build-Jdk': System.getProperty('java.version'),
|
||||
'Built-By': 'JetBrains'
|
||||
}
|
||||
from("${rootDir}/../dist/kotlinc/build.txt") { into("META-INF/") }
|
||||
}
|
||||
|
||||
|
||||
// TODO: use dokka instead?
|
||||
javadoc {
|
||||
failOnError = false
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn:classes) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.kotlin
|
||||
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn:javadoc) {
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
description = ''
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user