Change previous gradle build for compatibility with the centralized build
incompatible with the main build yet
This commit is contained in:
@@ -5,14 +5,14 @@ String jdkPath(String version) {
|
||||
return path
|
||||
}
|
||||
|
||||
ext {
|
||||
JDK_16 = jdkPath("1.6")
|
||||
JDK_17 = jdkPath("1.7")
|
||||
JDK_18 = jdkPath("1.8")
|
||||
distDir = file("$kotlin_root/dist")
|
||||
distLibDir = file("$kotlin_root/dist/kotlinc/lib")
|
||||
bootstrapCompilerFile = file("$distDir/kotlin-compiler-for-maven.jar")
|
||||
}
|
||||
//ext {
|
||||
// JDK_16 = jdkPath("1.6")
|
||||
// JDK_17 = jdkPath("1.7")
|
||||
// JDK_18 = jdkPath("1.8")
|
||||
// distDir = file("$kotlin_root/dist")
|
||||
// distLibDir = file("$kotlin_root/dist/kotlinc/lib")
|
||||
// bootstrapCompilerFile = file("$distDir/kotlin-compiler-for-maven.jar")
|
||||
//}
|
||||
|
||||
ext.configureJvmProject = { Project project ->
|
||||
project.configure(project) {
|
||||
@@ -159,9 +159,11 @@ 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 = project.files(bootstrapCompilerFile)
|
||||
classpath = rootProject.configurations.bootstrapCompile
|
||||
// classpath = project.files(bootstrapCompilerFile)
|
||||
main = "org.jetbrains.kotlin.preprocessor.PreprocessorCLI"
|
||||
args = [sourceDir, targetDir, profile]
|
||||
}
|
||||
@@ -170,13 +172,15 @@ ext.createPreprocessorTask = { Project project, def name, def sourceDir, def tar
|
||||
ext.createScriptTask = { Project project, def name, Closure<JavaExec> configureClosure = null ->
|
||||
JavaExec task = project.tasks.create(name, JavaExec)
|
||||
return project.configure(task) {
|
||||
classpath = project.configurations.scriptCompile
|
||||
// dependsOn(rootProject.prepareBootstrap)
|
||||
classpath = rootProject.configurations.scriptCompile
|
||||
println(rootProject.configurations.scriptCompile.files)
|
||||
main = "org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"
|
||||
args = [
|
||||
"-script",
|
||||
"-version",
|
||||
"-no-stdlib",
|
||||
"-cp", project.configurations.scriptRuntime.asPath]
|
||||
"-cp", rootProject.configurations.scriptRuntime.asPath]
|
||||
|
||||
if (configureClosure != null) {
|
||||
configureClosure.delegate = it
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
configure([project(':kotlin-gradle-plugin'), project(':kotlin-allopen'), project(':kotlin-noarg')]) { project ->
|
||||
apply plugin: 'com.gradle.plugin-publish'
|
||||
|
||||
if (project.hasProperty('publishPluginsVersion')) {
|
||||
configurations.archives.artifacts.all {
|
||||
version = project.getProperty('publishPluginsVersion')
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("${project.name}-jar")) {
|
||||
println("Using pre-built artifact for ${project.name}")
|
||||
configurations.archives.artifacts.clear()
|
||||
|
||||
artifacts {
|
||||
archives(file(project.getProperty("${project.name}-jar"))) {
|
||||
name project.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishPlugins.doFirst {
|
||||
assert !kotlin_version.contains('SNAPSHOT')
|
||||
}
|
||||
|
||||
pluginBundle {
|
||||
website = 'https://kotlinlang.org/'
|
||||
vcsUrl = 'https://github.com/JetBrains/kotlin/'
|
||||
description = 'Kotlin plugins for Gradle'
|
||||
tags = ['kotlin']
|
||||
|
||||
mavenCoordinates {
|
||||
groupId = "org.jetbrains.kotlin"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#Fri Apr 28 16:02:26 MSK 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
//task clean {
|
||||
// doLast {
|
||||
// delete "${buildDir}/repo"
|
||||
// }
|
||||
//}
|
||||
|
||||
configure([project(':kotlin-gradle-plugin'), project(':kotlin-allopen'), project(':kotlin-noarg')]) { project ->
|
||||
apply plugin: 'com.gradle.plugin-publish'
|
||||
|
||||
if (project.hasProperty('publishPluginsVersion')) {
|
||||
configurations.archives.artifacts.all {
|
||||
version = project.getProperty('publishPluginsVersion')
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("${project.name}-jar")) {
|
||||
println("Using pre-built artifact for ${project.name}")
|
||||
configurations.archives.artifacts.clear()
|
||||
|
||||
artifacts {
|
||||
archives(file(project.getProperty("${project.name}-jar"))) {
|
||||
name project.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishPlugins.doFirst {
|
||||
assert !kotlin_version.contains('SNAPSHOT')
|
||||
}
|
||||
|
||||
pluginBundle {
|
||||
website = 'https://kotlinlang.org/'
|
||||
vcsUrl = 'https://github.com/JetBrains/kotlin/'
|
||||
description = 'Kotlin plugins for Gradle'
|
||||
tags = ['kotlin']
|
||||
|
||||
mavenCoordinates {
|
||||
groupId = "org.jetbrains.kotlin"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ sourceSets {
|
||||
annotations {
|
||||
if(!System.properties.'idea.active') {
|
||||
java {
|
||||
srcDir "${rootDir}/../core/runtime.jvm/src"
|
||||
srcDir "${rootDir}/core/runtime.jvm/src"
|
||||
include 'org/jetbrains/annotations/**'
|
||||
}
|
||||
kotlin {
|
||||
@@ -19,13 +19,13 @@ sourceSets {
|
||||
}
|
||||
builtins {
|
||||
java {
|
||||
srcDir "${rootDir}/../core/builtins/src"
|
||||
srcDir "${rootDir}/../core/runtime.jvm/src"
|
||||
srcDir "${rootDir}/core/builtins/src"
|
||||
srcDir "${rootDir}/core/runtime.jvm/src"
|
||||
exclude 'org/jetbrains/annotations/**'
|
||||
}
|
||||
kotlin {
|
||||
srcDir "${rootDir}/../core/builtins/src"
|
||||
srcDir "${rootDir}/../core/runtime.jvm/src"
|
||||
srcDir "${rootDir}/core/builtins/src"
|
||||
srcDir "${rootDir}/core/runtime.jvm/src"
|
||||
exclude 'org/jetbrains/annotations/**'
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,8 @@ task originalStdlibJar(type: Jar) {
|
||||
|
||||
jar {
|
||||
manifestAttributes(manifest, project, 'Main')
|
||||
from("${rootDir}/../dist/builtins")
|
||||
dependsOn ":core:builtins:serialize"
|
||||
from("${rootDir}/dist/builtins")
|
||||
from sourceSets.builtins.output
|
||||
}
|
||||
|
||||
@@ -64,14 +65,14 @@ task distJar(type: Jar) {
|
||||
baseName = 'dist-kotlin-stdlib'
|
||||
version = null
|
||||
manifestAttributes(manifest, project, 'Main')
|
||||
from("${rootDir}/../dist/builtins")
|
||||
from("${rootDir}/dist/builtins")
|
||||
from sourceSets.annotations.output
|
||||
from sourceSets.builtins.output
|
||||
from sourceSets.main.output
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
from "${rootDir}/../core/builtins/native"
|
||||
from "${rootDir}/core/builtins/native"
|
||||
from sourceSets.builtins.kotlin
|
||||
}
|
||||
|
||||
@@ -102,7 +103,7 @@ compileBuiltinsKotlin {
|
||||
"-version",
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xdump-declarations-to", "${buildDir}/runtime-declarations.json",
|
||||
"-cp", "${rootDir}/../dist/builtins",
|
||||
"-cp", "${rootDir}/dist/builtins",
|
||||
"-module-name", "kotlin-runtime"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -17,7 +17,11 @@ sourceSets {
|
||||
|
||||
createPreprocessorTask(project, "Main", "${projectDir}/../src/kotlin", commonSrcDir)
|
||||
|
||||
compileKotlinCommon.dependsOn preprocessSourcesMain
|
||||
compileKotlinCommon {
|
||||
dependsOn preprocessSourcesMain
|
||||
// dependsOn ":prepare:compiler:prepare-compiler-with-bootstrap-runtime"
|
||||
// compilerJarFile = compilerJarWithBootstrapRuntime
|
||||
}
|
||||
|
||||
/*
|
||||
// TODO: currently unsupported
|
||||
|
||||
@@ -13,8 +13,8 @@ def builtinsSrcDir = "${buildDir}/builtin-sources"
|
||||
def builtinsSrcDir2 = "${buildDir}/builtin-sources-for-builtins"
|
||||
def commonSrcDir = "${buildDir}/common-sources"
|
||||
def commonTestSrcDir = "${buildDir}/common-test-sources"
|
||||
def builtinsDir = "${rootDir}/../core/builtins"
|
||||
def jsLibrariesDir = "${rootDir}/../js/js.libraries"
|
||||
def builtinsDir = "${rootDir}/core/builtins"
|
||||
def jsLibrariesDir = "${rootDir}/js/js.libraries"
|
||||
def jsSrcDir = "${jsLibrariesDir}/src"
|
||||
def jsTestSrcDir = "${jsLibrariesDir}/test"
|
||||
def jsSrcJsDir = "${jsSrcDir}/js"
|
||||
@@ -205,7 +205,7 @@ task mergedJar(type: Jar, dependsOn: classes) {
|
||||
|
||||
// TODO: Use standard implementation title after js stdlib detector becomes more flexible
|
||||
Properties properties = new Properties()
|
||||
new File("${rootDir}/../resources/kotlinManifest.properties").withInputStream {
|
||||
new File("${rootDir}/resources/kotlinManifest.properties").withInputStream {
|
||||
properties.load(it)
|
||||
}
|
||||
manifest.attributes 'Implementation-Title' : properties."manifest.impl.title.kotlin.javascript.stdlib"
|
||||
|
||||
@@ -18,6 +18,7 @@ allprojects {
|
||||
}
|
||||
|
||||
apply from: "${kotlin_root}/libraries/commonConfiguration.gradle"
|
||||
apply from: "${kotlin_root}/libraries/configureGradleTools.gradle"
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
@@ -58,38 +59,3 @@ task clean {
|
||||
}
|
||||
}
|
||||
|
||||
configure([project(':kotlin-gradle-plugin'), project(':kotlin-allopen'), project(':kotlin-noarg')]) { project ->
|
||||
apply plugin: 'com.gradle.plugin-publish'
|
||||
|
||||
if (project.hasProperty('publishPluginsVersion')) {
|
||||
configurations.archives.artifacts.all {
|
||||
version = project.getProperty('publishPluginsVersion')
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("${project.name}-jar")) {
|
||||
println("Using pre-built artifact for ${project.name}")
|
||||
configurations.archives.artifacts.clear()
|
||||
|
||||
artifacts {
|
||||
archives(file(project.getProperty("${project.name}-jar"))) {
|
||||
name project.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishPlugins.doFirst {
|
||||
assert !kotlin_version.contains('SNAPSHOT')
|
||||
}
|
||||
|
||||
pluginBundle {
|
||||
website = 'https://kotlinlang.org/'
|
||||
vcsUrl = 'https://github.com/JetBrains/kotlin/'
|
||||
description = 'Kotlin plugins for Gradle'
|
||||
tags = ['kotlin']
|
||||
|
||||
mavenCoordinates {
|
||||
groupId = "org.jetbrains.kotlin"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,10 +14,10 @@ dependencies {
|
||||
testCompile project(':kotlin-gradle-subplugin-example')
|
||||
testCompile project(':kotlin-allopen')
|
||||
|
||||
testCompile "org.jetbrains.kotlin:annotation-processor-example:$kotlin_version"
|
||||
testCompile project (path: ':examples:annotation-processor-example')
|
||||
testCompile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
|
||||
testCompile "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
|
||||
testCompile "org.jetbrains.kotlin:kotlin-build-common-test:$kotlin_version"
|
||||
testCompile project (path: ':build-common', configuration: 'tests-jar')
|
||||
|
||||
testCompile 'org.jetbrains.kotlin:gradle-api:2.2'
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ dependencies {
|
||||
agp25CompileOnly 'org.codehaus.groovy:groovy-all:2.3.9'
|
||||
agp25CompileOnly gradleApi()
|
||||
|
||||
testCompile "org.jetbrains.kotlin:kotlin-build-common-test:$kotlin_version"
|
||||
testCompile project (path: ':build-common', configuration: 'tests-jar')
|
||||
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
|
||||
testCompile "junit:junit:4.12"
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ configureJvmProject(project)
|
||||
configurePublishing(project)
|
||||
|
||||
|
||||
def core = "${rootDir}/../core"
|
||||
def core = "${rootDir}//core"
|
||||
def annotationsSrc = "${buildDir}/annotations"
|
||||
def relocatedCoreSrc = "${buildDir}/core-relocated"
|
||||
|
||||
@@ -47,9 +47,10 @@ configurations {
|
||||
dependencies {
|
||||
proguardDeps project(':kotlin-stdlib')
|
||||
shadows 'javax.inject:javax.inject:1'
|
||||
shadows project(path: ':tools:protobuf-lite')
|
||||
shadows project(path: ':custom-dependencies:protobuf-lite', configuration: 'default')
|
||||
|
||||
compile project(':kotlin-stdlib')
|
||||
compile project(path: ':custom-dependencies:protobuf-lite', configuration: 'default')
|
||||
}
|
||||
|
||||
task copyAnnotations(type: Sync) {
|
||||
@@ -70,6 +71,7 @@ compileJava {
|
||||
|
||||
compileKotlin {
|
||||
dependsOn copyAnnotations
|
||||
dependsOn ':custom-dependencies:protobuf-lite:prepare'
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = ["-version",
|
||||
"-Xallow-kotlin-package",
|
||||
@@ -107,7 +109,7 @@ createScriptTask(project, "stripMetadata") {
|
||||
inputs.file(inputJar)
|
||||
outputs.file(outputJar)
|
||||
args += [
|
||||
"${rootDir}/../generators/infrastructure/strip-kotlin-annotations.kts",
|
||||
"${rootDir}/generators/infrastructure/strip-kotlin-annotations.kts",
|
||||
"kotlin/Metadata",
|
||||
"kotlin/reflect/jvm/internal/impl/.*",
|
||||
inputJar,
|
||||
@@ -115,7 +117,6 @@ createScriptTask(project, "stripMetadata") {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
def mainArchiveName = "${archivesBaseName}-${project.version}.jar"
|
||||
def outputJarPath = "${libsDir}/${mainArchiveName}"
|
||||
def rtJar = ['jre/lib/rt.jar', '../Classes/classes.jar'].collect { new File(JDK_16, it) }.find { it.isFile() }
|
||||
|
||||
@@ -5,7 +5,7 @@ sourceSets {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_gradle_plugin_version"
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
@@ -17,5 +17,5 @@ task run(type: JavaExec) {
|
||||
group 'application'
|
||||
main 'generators.GenerateStandardLibKt'
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
args = ["${rootDir}/.."]
|
||||
args = ["${rootDir}"]
|
||||
}
|
||||
@@ -3,7 +3,7 @@ description = 'Merge utility for Kotlin Standard Library for JS'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
dependencies {
|
||||
compile files("$distDir/kotlin-compiler-for-maven.jar")
|
||||
compile "org.jetbrains.kotlin:kotlin-compiler:$kotlin_version"
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -13,8 +13,8 @@ sourceSets {
|
||||
if(!System.properties.'idea.active')
|
||||
main {
|
||||
java {
|
||||
srcDir "${rootDir}/../core/builtins/src"
|
||||
srcDir "${rootDir}/../core/runtime.jvm/src"
|
||||
srcDir "${rootDir}/core/builtins/src"
|
||||
srcDir "${rootDir}/core/runtime.jvm/src"
|
||||
exclude 'org/jetbrains/annotations/**'
|
||||
}
|
||||
kotlin {
|
||||
@@ -25,13 +25,13 @@ sourceSets {
|
||||
|
||||
jar {
|
||||
manifestAttributes(manifest, project, 'Main')
|
||||
from("${rootDir}/../dist/builtins")
|
||||
from("${rootDir}/dist/builtins")
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.kotlin
|
||||
from "${rootDir}/../core/builtins/native"
|
||||
from "${rootDir}/core/builtins/native"
|
||||
}
|
||||
|
||||
artifacts {
|
||||
@@ -44,7 +44,7 @@ compileKotlin {
|
||||
freeCompilerArgs = [
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xdump-declarations-to", "${buildDir}/runtime-declarations.json",
|
||||
"-cp", "${rootDir}/../dist/builtins",
|
||||
"-cp", "${rootDir}/dist/builtins",
|
||||
"-module-name", project.name
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ dependencies {
|
||||
sourceSets {
|
||||
main {
|
||||
kotlin {
|
||||
srcDir "${rootDir}/../core/script.runtime/src"
|
||||
srcDir "${rootDir}/core/script.runtime/src"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user