Implement configuration for describing only published runtime dependencies...
and fix runtime dependencies for published scripting artifacts
This commit is contained in:
@@ -4,9 +4,10 @@ import org.codehaus.groovy.runtime.InvokerHelper
|
|||||||
import org.gradle.api.Plugin
|
import org.gradle.api.Plugin
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.artifacts.Dependency
|
import org.gradle.api.artifacts.Dependency
|
||||||
|
import org.gradle.api.artifacts.maven.Conf2ScopeMappingContainer
|
||||||
import org.gradle.api.artifacts.maven.MavenDeployment
|
import org.gradle.api.artifacts.maven.MavenDeployment
|
||||||
import org.gradle.api.artifacts.maven.MavenResolver
|
import org.gradle.api.artifacts.maven.MavenResolver
|
||||||
|
import org.gradle.api.plugins.MavenPluginConvention
|
||||||
import org.gradle.api.plugins.MavenRepositoryHandlerConvention
|
import org.gradle.api.plugins.MavenRepositoryHandlerConvention
|
||||||
import org.gradle.api.publication.maven.internal.deployer.MavenRemoteRepository
|
import org.gradle.api.publication.maven.internal.deployer.MavenRemoteRepository
|
||||||
import org.gradle.api.tasks.Upload
|
import org.gradle.api.tasks.Upload
|
||||||
@@ -30,6 +31,12 @@ open class PublishedKotlinModule : Plugin<Project> {
|
|||||||
|
|
||||||
plugins.apply("maven")
|
plugins.apply("maven")
|
||||||
|
|
||||||
|
val publishedRuntime by configurations.creating {
|
||||||
|
the<MavenPluginConvention>()
|
||||||
|
.conf2ScopeMappings
|
||||||
|
.addMapping(0, this, Conf2ScopeMappingContainer.RUNTIME)
|
||||||
|
}
|
||||||
|
|
||||||
if (!project.hasProperty("prebuiltJar")) {
|
if (!project.hasProperty("prebuiltJar")) {
|
||||||
plugins.apply("signing")
|
plugins.apply("signing")
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import org.gradle.api.Action
|
||||||
|
import org.gradle.api.NamedDomainObjectContainer
|
||||||
|
import org.gradle.api.NamedDomainObjectProvider
|
||||||
|
import org.gradle.api.artifacts.Configuration
|
||||||
|
import org.gradle.api.artifacts.Dependency
|
||||||
|
import org.gradle.api.artifacts.ExternalModuleDependency
|
||||||
|
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||||
|
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
val NamedDomainObjectContainer<Configuration>.publishedRuntime: NamedDomainObjectProvider<Configuration> get() = named("publishedRuntime")
|
||||||
|
|
||||||
|
fun DependencyHandler.publishedRuntime(dependencyNotation: Any): Dependency? =
|
||||||
|
add("publishedRuntime", dependencyNotation)
|
||||||
|
|
||||||
|
fun DependencyHandler.publishedRuntime(
|
||||||
|
dependencyNotation: String,
|
||||||
|
dependencyConfiguration: Action<ExternalModuleDependency>
|
||||||
|
): ExternalModuleDependency =
|
||||||
|
addDependencyTo(this, "publishedRuntime", dependencyNotation, dependencyConfiguration)
|
||||||
|
|
||||||
@@ -5,6 +5,8 @@ plugins {
|
|||||||
|
|
||||||
jvmTarget = "1.6"
|
jvmTarget = "1.6"
|
||||||
|
|
||||||
|
publish()
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(project(":kotlin-script-runtime"))
|
compile(project(":kotlin-script-runtime"))
|
||||||
compile(kotlinStdlib())
|
compile(kotlinStdlib())
|
||||||
@@ -15,6 +17,8 @@ dependencies {
|
|||||||
compileOnly(project(":compiler:cli-common"))
|
compileOnly(project(":compiler:cli-common"))
|
||||||
compileOnly(project(":kotlin-reflect-api"))
|
compileOnly(project(":kotlin-reflect-api"))
|
||||||
compileOnly(intellijCoreDep())
|
compileOnly(intellijCoreDep())
|
||||||
|
publishedRuntime(project(":kotlin-compiler"))
|
||||||
|
publishedRuntime(project(":kotlin-reflect"))
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -22,8 +26,6 @@ sourceSets {
|
|||||||
"test" {}
|
"test" {}
|
||||||
}
|
}
|
||||||
|
|
||||||
publish()
|
|
||||||
|
|
||||||
standardPublicJars()
|
standardPublicJars()
|
||||||
|
|
||||||
projectTest(parallel = true)
|
projectTest(parallel = true)
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ plugins {
|
|||||||
|
|
||||||
jvmTarget = "1.6"
|
jvmTarget = "1.6"
|
||||||
|
|
||||||
|
publish()
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(project(":kotlin-script-runtime"))
|
compile(project(":kotlin-script-runtime"))
|
||||||
compile(kotlinStdlib())
|
compile(kotlinStdlib())
|
||||||
@@ -15,6 +17,10 @@ dependencies {
|
|||||||
compileOnly(project(":compiler:cli"))
|
compileOnly(project(":compiler:cli"))
|
||||||
compileOnly(project(":kotlin-reflect-api"))
|
compileOnly(project(":kotlin-reflect-api"))
|
||||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||||
|
publishedRuntime(project(":kotlin-compiler"))
|
||||||
|
publishedRuntime(project(":kotlin-scripting-compiler"))
|
||||||
|
publishedRuntime(project(":kotlin-reflect"))
|
||||||
|
publishedRuntime(commonDep("org.jetbrains.intellij.deps", "trove4j"))
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -22,7 +28,5 @@ sourceSets {
|
|||||||
"test" {}
|
"test" {}
|
||||||
}
|
}
|
||||||
|
|
||||||
publish()
|
|
||||||
|
|
||||||
standardPublicJars()
|
standardPublicJars()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user