diff --git a/build.gradle.kts b/build.gradle.kts index dfb00b00c91..4c9400146c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -104,6 +104,7 @@ extra["versions.jline"] = "3.3.1" extra["versions.junit"] = "4.12" extra["versions.javaslang"] = "2.0.6" extra["versions.ant"] = "1.8.2" +extra["versions.android"] = "2.3.1" extra["ideaCoreSdkJars"] = arrayOf("annotations", "asm-all", "guava", "intellij-core", "jdom", "jna", "log4j", "picocontainer", "snappy-in-java", "streamex", "trove4j", "xpp3-1.1.4-min", "xstream") diff --git a/buildSrc/src/main/kotlin/artifacts.kt b/buildSrc/src/main/kotlin/artifacts.kt index 3aa5b22d464..537a956ef3e 100644 --- a/buildSrc/src/main/kotlin/artifacts.kt +++ b/buildSrc/src/main/kotlin/artifacts.kt @@ -83,6 +83,7 @@ fun Project.runtimeJar(taskName: String = "jar", body: Jar.() -> Unit = {}): Jar fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar = getOrCreateTask("sourcesJar") { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE setupPublicJar("Sources") try { project.pluginManager.withPlugin("java-base") { @@ -98,6 +99,7 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar = fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar = getOrCreateTask("javadocJar") { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE setupPublicJar("JavaDoc") tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let { dependsOn(it) diff --git a/gradle/project-schema.json b/gradle/project-schema.json index 56abb422ed4..6dbdf2cf026 100644 --- a/gradle/project-schema.json +++ b/gradle/project-schema.json @@ -50,7 +50,7 @@ "reporting": "org.gradle.api.reporting.ReportingExtension" } }, - ":android-extensions-compiler": { + ":kotlin-android-extensions": { "conventions": { "base": "org.gradle.api.plugins.BasePluginConvention", "java": "org.gradle.api.plugins.JavaPluginConvention", diff --git a/libraries/tools/kotlin-allopen/build.gradle b/libraries/tools/kotlin-allopen/build.gradle index 0e6118705bf..0ce41176cbd 100644 --- a/libraries/tools/kotlin-allopen/build.gradle +++ b/libraries/tools/kotlin-allopen/build.gradle @@ -14,7 +14,7 @@ dependencies { compile project(':kotlin-stdlib') compileOnly project(path: ':kotlin-compiler-embeddable', configuration: 'runtimeJar') - compile project(':kotlin-allopen-compiler-plugin') + compileOnly project(':kotlin-allopen-compiler-plugin') compileOnly 'org.jetbrains.kotlin:gradle-api:1.6' } @@ -32,8 +32,13 @@ def originalSrc = "$kotlin_root/plugins/allopen/allopen-cli/src" //compileKotlin.dependsOn preprocessSources +evaluationDependsOn(":kotlin-allopen-compiler-plugin") + jar { - from(originalSrc) { include("META-INF/**") } +// from(originalSrc) { include("META-INF/**") } + from(project(":kotlin-allopen-compiler-plugin").sourceSets.main.output.classesDirs) + from(project(":kotlin-allopen-compiler-plugin").sourceSets.main.output.resourcesDir) + manifestAttributes(manifest, project) } artifacts { diff --git a/libraries/tools/kotlin-gradle-plugin-api/build.gradle b/libraries/tools/kotlin-gradle-plugin-api/build.gradle index ea2b0e3f7ff..b8059718ad6 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/build.gradle +++ b/libraries/tools/kotlin-gradle-plugin-api/build.gradle @@ -19,4 +19,8 @@ dependencies { artifacts { archives sourcesJar archives javadocJar +} + +jar { + manifestAttributes(manifest, project) } \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle b/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle index 2a0b283bf65..245d391566e 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle @@ -19,7 +19,7 @@ dependencies { testCompile project(path: ':examples:annotation-processor-example') testCompile project(':kotlin-stdlib-jre8') testCompile project(':kotlin-reflect') - testCompile project(':android-extensions-compiler') + testCompile project(':kotlin-android-extensions') testCompile project(path: ':kotlin-build-common', configuration: 'tests-jar') testCompile project(path: ':compiler:incremental-compilation-impl', configuration: 'tests-jar') diff --git a/libraries/tools/kotlin-gradle-plugin/build.gradle b/libraries/tools/kotlin-gradle-plugin/build.gradle index b268171138e..3837a8f08be 100644 --- a/libraries/tools/kotlin-gradle-plugin/build.gradle +++ b/libraries/tools/kotlin-gradle-plugin/build.gradle @@ -31,7 +31,7 @@ dependencies { compile project(path: ':kotlin-compiler-embeddable', configuration: "runtimeJar") compile project(':kotlin-stdlib') - compile project(':android-extensions-compiler') + compile project(':kotlin-android-extensions') compile project(':kotlin-build-common') compile project(':kotlin-compiler-runner') // compileOnly project(":compiler:daemon") @@ -81,6 +81,7 @@ jar.dependsOn agp25Classes jar { from compileGroovy.destinationDir from sourceSets.agp25.output.classesDir + manifestAttributes(manifest, project) } artifacts { diff --git a/libraries/tools/kotlin-noarg/build.gradle b/libraries/tools/kotlin-noarg/build.gradle index c31986b0cca..2792ccab169 100644 --- a/libraries/tools/kotlin-noarg/build.gradle +++ b/libraries/tools/kotlin-noarg/build.gradle @@ -20,7 +20,7 @@ dependencies { compile project(':kotlin-stdlib') compileOnly project(':compiler') - compile project(':kotlin-noarg-compiler-plugin') + compileOnly project(':kotlin-noarg-compiler-plugin') compileOnly 'org.jetbrains.kotlin:gradle-api:1.6' } @@ -38,8 +38,13 @@ def originalSrc = "$kotlin_root/plugins/noarg/noarg-cli/src" //compileKotlin.dependsOn preprocessSources +evaluationDependsOn(":kotlin-noarg-compiler-plugin") + jar { - from(originalSrc) { include("META-INF/**") } +// from(originalSrc) { include("META-INF/**") } + from(project(":kotlin-noarg-compiler-plugin").sourceSets.main.output.classesDirs) + from(project(":kotlin-noarg-compiler-plugin").sourceSets.main.output.resourcesDir) + manifestAttributes(manifest, project) } artifacts { diff --git a/libraries/tools/kotlin-sam-with-receiver/build.gradle b/libraries/tools/kotlin-sam-with-receiver/build.gradle index 54eeb2aef76..ef0045b3e32 100644 --- a/libraries/tools/kotlin-sam-with-receiver/build.gradle +++ b/libraries/tools/kotlin-sam-with-receiver/build.gradle @@ -20,7 +20,7 @@ dependencies { compile project(':kotlin-stdlib') compileOnly project(':compiler') - compile project(':kotlin-sam-with-receiver-compiler-plugin') + compileOnly project(':kotlin-sam-with-receiver-compiler-plugin') compileOnly 'org.jetbrains.kotlin:gradle-api:1.6' } @@ -38,8 +38,13 @@ def originalSrc = "$kotlin_root/plugins/sam-with-receiver/sam-with-receiver-cli/ //compileKotlin.dependsOn preprocessSources +evaluationDependsOn(":kotlin-sam-with-receiver-compiler-plugin") + jar { - from(originalSrc) { include("META-INF/**") } +// from(originalSrc) { include("META-INF/**") } + from(project(":kotlin-sam-with-receiver-compiler-plugin").sourceSets.main.output.classesDirs) + from(project(":kotlin-sam-with-receiver-compiler-plugin").sourceSets.main.output.resourcesDir) + manifestAttributes(manifest, project) } artifacts { diff --git a/plugins/android-extensions/android-extensions-runtime/build.gradle.kts b/plugins/android-extensions/android-extensions-runtime/build.gradle.kts index 605d8be5b55..3748e356835 100644 --- a/plugins/android-extensions/android-extensions-runtime/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-runtime/build.gradle.kts @@ -4,8 +4,9 @@ description = "Kotlin Android Extensions Runtime" apply { plugin("kotlin") } dependencies { - compile(projectDist(":kotlin-stdlib")) + compile(project(":kotlin-stdlib")) compile(ideaPluginDeps("layoutlib", plugin = "android")) + runtime(commonDep("com.google.android", "android")) } sourceSets { diff --git a/prepare/android-extensions-compiler-gradle/build.gradle.kts b/prepare/android-extensions-compiler-gradle/build.gradle.kts index 24fff3c141d..65ae6034df2 100644 --- a/prepare/android-extensions-compiler-gradle/build.gradle.kts +++ b/prepare/android-extensions-compiler-gradle/build.gradle.kts @@ -30,7 +30,7 @@ dependencies { compileOnly(project(":compiler:backend")) compileOnly(project(":kotlin-android-extensions-runtime")) runtime(projectRuntimeJar(":kotlin-compiler-embeddable")) - runtime("com.google.android:android:2.3.1") + runtime(commonDep("com.google.android", "android")) } //val originalSrc = "$projectDir/src" diff --git a/prepare/idea-plugin/build.gradle.kts b/prepare/idea-plugin/build.gradle.kts index 07256b9d6cd..f5353ba9adb 100644 --- a/prepare/idea-plugin/build.gradle.kts +++ b/prepare/idea-plugin/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.gradle.jvm.tasks.Jar diff --git a/settings.gradle b/settings.gradle index 831712e84ed..492db255b21 100644 --- a/settings.gradle +++ b/settings.gradle @@ -71,7 +71,7 @@ include ":kotlin-build-common", ":plugins:lint", ":plugins:kapt3-idea", ":plugins:android-extensions-compiler", - ":android-extensions-compiler", + ":kotlin-android-extensions", ":kotlin-android-extensions-runtime", ":plugins:android-extensions-ide", ":plugins:android-extensions-jps", @@ -171,7 +171,7 @@ project(':compiler:ir.ir2cfg').projectDir = "$rootDir/compiler/ir/ir.ir2cfg" as project(':kotlin-jps-plugin').projectDir = "$rootDir/prepare/jps-plugin" as File project(':idea:idea-android-output-parser').projectDir = "$rootDir/idea/idea-android/idea-android-output-parser" as File project(':plugins:android-extensions-compiler').projectDir = "$rootDir/plugins/android-extensions/android-extensions-compiler" as File -project(':android-extensions-compiler').projectDir = "$rootDir/prepare/android-extensions-compiler-gradle" as File +project(':kotlin-android-extensions').projectDir = "$rootDir/prepare/android-extensions-compiler-gradle" as File project(':kotlin-android-extensions-runtime').projectDir = "$rootDir/plugins/android-extensions/android-extensions-runtime" as File project(':plugins:android-extensions-ide').projectDir = "$rootDir/plugins/android-extensions/android-extensions-idea" as File project(':plugins:android-extensions-jps').projectDir = "$rootDir/plugins/android-extensions/android-extensions-jps" as File diff --git a/ultimate/build.gradle.kts b/ultimate/build.gradle.kts index 48e14d6f0cb..12c6ca93bc2 100644 --- a/ultimate/build.gradle.kts +++ b/ultimate/build.gradle.kts @@ -20,6 +20,8 @@ val ideaCommunityPlugin by configurations.creating val ideaProjectResources = project(":idea").the().sourceSets["main"].output.resourcesDir +evaluationDependsOn(":prepare:idea-plugin") + dependencies { compile(projectDist(":kotlin-reflect")) compile(projectDist(":kotlin-stdlib"))