Add classes dirs artifact helpers, minor cleanup
This commit is contained in:
@@ -8,12 +8,29 @@ import org.gradle.api.artifacts.Configuration
|
|||||||
import org.gradle.api.artifacts.ConfigurationContainer
|
import org.gradle.api.artifacts.ConfigurationContainer
|
||||||
import org.gradle.api.artifacts.Dependency
|
import org.gradle.api.artifacts.Dependency
|
||||||
import org.gradle.api.file.DuplicatesStrategy
|
import org.gradle.api.file.DuplicatesStrategy
|
||||||
|
import org.gradle.api.file.FileCollection
|
||||||
import org.gradle.api.plugins.BasePluginConvention
|
import org.gradle.api.plugins.BasePluginConvention
|
||||||
import org.gradle.api.plugins.JavaPluginConvention
|
import org.gradle.api.plugins.JavaPluginConvention
|
||||||
import org.gradle.api.tasks.javadoc.Javadoc
|
import org.gradle.api.tasks.javadoc.Javadoc
|
||||||
import org.gradle.jvm.tasks.Jar
|
import org.gradle.jvm.tasks.Jar
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
fun Project.classesDirsArtifact(): FileCollection {
|
||||||
|
val classesDirsCfg = configurations.getOrCreate("classes-dirs")
|
||||||
|
|
||||||
|
val classesDirs = the<JavaPluginConvention>().sourceSets["main"].output.classesDirs
|
||||||
|
|
||||||
|
val classesTask = tasks["classes"]
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
classesDirs.files.forEach {
|
||||||
|
addArtifact(classesDirsCfg, classesTask, it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return classesDirs
|
||||||
|
}
|
||||||
|
|
||||||
fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
|
fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
|
||||||
val testsJarCfg = configurations.getOrCreate("tests-jar").extendsFrom(configurations["testCompile"])
|
val testsJarCfg = configurations.getOrCreate("tests-jar").extendsFrom(configurations["testCompile"])
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.gradle.api.artifacts.Dependency
|
|||||||
import org.gradle.api.artifacts.ProjectDependency
|
import org.gradle.api.artifacts.ProjectDependency
|
||||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||||
import org.gradle.api.file.ConfigurableFileCollection
|
import org.gradle.api.file.ConfigurableFileCollection
|
||||||
|
import org.gradle.api.plugins.JavaPluginConvention
|
||||||
import org.gradle.kotlin.dsl.*
|
import org.gradle.kotlin.dsl.*
|
||||||
import org.gradle.plugin.use.PluginDependenciesSpec
|
import org.gradle.plugin.use.PluginDependenciesSpec
|
||||||
import org.gradle.plugin.use.PluginDependencySpec
|
import org.gradle.plugin.use.PluginDependencySpec
|
||||||
@@ -62,6 +63,7 @@ fun DependencyHandler.projectDist(name: String): Dependency = project(name, conf
|
|||||||
fun DependencyHandler.projectTests(name: String): Dependency = project(name, configuration = "tests-jar").apply { isTransitive = false }
|
fun DependencyHandler.projectTests(name: String): Dependency = project(name, configuration = "tests-jar").apply { isTransitive = false }
|
||||||
fun DependencyHandler.projectRuntimeJar(name: String): Dependency = project(name, configuration = "runtimeJar")
|
fun DependencyHandler.projectRuntimeJar(name: String): Dependency = project(name, configuration = "runtimeJar")
|
||||||
fun DependencyHandler.projectArchives(name: String): Dependency = project(name, configuration = "archives")
|
fun DependencyHandler.projectArchives(name: String): Dependency = project(name, configuration = "archives")
|
||||||
|
fun DependencyHandler.projectClasses(name: String): Dependency = project(name, configuration = "classes-dirs")
|
||||||
|
|
||||||
val protobufLiteProject = ":custom-dependencies:protobuf-lite"
|
val protobufLiteProject = ":custom-dependencies:protobuf-lite"
|
||||||
fun DependencyHandler.protobufLite(): ProjectDependency =
|
fun DependencyHandler.protobufLite(): ProjectDependency =
|
||||||
|
|||||||
+108
-5
@@ -311,6 +311,7 @@
|
|||||||
"configurations": [
|
"configurations": [
|
||||||
"apiElements",
|
"apiElements",
|
||||||
"archives",
|
"archives",
|
||||||
|
"classes-dirs",
|
||||||
"compile",
|
"compile",
|
||||||
"compileClasspath",
|
"compileClasspath",
|
||||||
"compileOnly",
|
"compileOnly",
|
||||||
@@ -1194,13 +1195,41 @@
|
|||||||
},
|
},
|
||||||
":kotlin-runtime": {
|
":kotlin-runtime": {
|
||||||
"conventions": {
|
"conventions": {
|
||||||
|
"base": "org.gradle.api.plugins.BasePluginConvention",
|
||||||
|
"java": "org.gradle.api.plugins.JavaPluginConvention",
|
||||||
|
"maven": "org.gradle.api.plugins.MavenPluginConvention"
|
||||||
},
|
},
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
"apiElements",
|
||||||
|
"archives",
|
||||||
|
"compile",
|
||||||
|
"compileClasspath",
|
||||||
|
"compileOnly",
|
||||||
|
"default",
|
||||||
|
"distJar",
|
||||||
|
"implementation",
|
||||||
|
"kapt",
|
||||||
|
"kaptTest",
|
||||||
|
"runtime",
|
||||||
|
"runtimeClasspath",
|
||||||
|
"runtimeElements",
|
||||||
|
"runtimeOnly",
|
||||||
|
"signatures",
|
||||||
|
"testCompile",
|
||||||
|
"testCompileClasspath",
|
||||||
|
"testCompileOnly",
|
||||||
|
"testImplementation",
|
||||||
|
"testRuntime",
|
||||||
|
"testRuntimeClasspath",
|
||||||
|
"testRuntimeOnly"
|
||||||
],
|
],
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension"
|
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
|
||||||
|
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension",
|
||||||
|
"kapt": "org.jetbrains.kotlin.gradle.plugin.KaptExtension",
|
||||||
|
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
|
||||||
|
"reporting": "org.gradle.api.reporting.ReportingExtension",
|
||||||
|
"signing": "org.gradle.plugins.signing.SigningExtension"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
":kotlin-sam-with-receiver": {
|
":kotlin-sam-with-receiver": {
|
||||||
@@ -1740,6 +1769,44 @@
|
|||||||
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension"
|
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
":ultimate": {
|
||||||
|
"conventions": {
|
||||||
|
"base": "org.gradle.api.plugins.BasePluginConvention",
|
||||||
|
"java": "org.gradle.api.plugins.JavaPluginConvention"
|
||||||
|
},
|
||||||
|
"configurations": [
|
||||||
|
"apiElements",
|
||||||
|
"archives",
|
||||||
|
"buildVersion",
|
||||||
|
"compile",
|
||||||
|
"compileClasspath",
|
||||||
|
"compileOnly",
|
||||||
|
"default",
|
||||||
|
"ideaCommunityPlugin",
|
||||||
|
"implementation",
|
||||||
|
"kapt",
|
||||||
|
"kaptTest",
|
||||||
|
"runtime",
|
||||||
|
"runtimeClasspath",
|
||||||
|
"runtimeElements",
|
||||||
|
"runtimeJar",
|
||||||
|
"runtimeOnly",
|
||||||
|
"testCompile",
|
||||||
|
"testCompileClasspath",
|
||||||
|
"testCompileOnly",
|
||||||
|
"testImplementation",
|
||||||
|
"testRuntime",
|
||||||
|
"testRuntimeClasspath",
|
||||||
|
"testRuntimeOnly"
|
||||||
|
],
|
||||||
|
"extensions": {
|
||||||
|
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
|
||||||
|
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension",
|
||||||
|
"kapt": "org.jetbrains.kotlin.gradle.plugin.KaptExtension",
|
||||||
|
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
|
||||||
|
"reporting": "org.gradle.api.reporting.ReportingExtension"
|
||||||
|
}
|
||||||
|
},
|
||||||
":compiler:android-tests": {
|
":compiler:android-tests": {
|
||||||
"conventions": {
|
"conventions": {
|
||||||
"base": "org.gradle.api.plugins.BasePluginConvention",
|
"base": "org.gradle.api.plugins.BasePluginConvention",
|
||||||
@@ -2914,7 +2981,8 @@
|
|||||||
"testImplementation",
|
"testImplementation",
|
||||||
"testRuntime",
|
"testRuntime",
|
||||||
"testRuntimeClasspath",
|
"testRuntimeClasspath",
|
||||||
"testRuntimeOnly"
|
"testRuntimeOnly",
|
||||||
|
"tests-jar"
|
||||||
],
|
],
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
|
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
|
||||||
@@ -3019,7 +3087,8 @@
|
|||||||
"testImplementation",
|
"testImplementation",
|
||||||
"testRuntime",
|
"testRuntime",
|
||||||
"testRuntimeClasspath",
|
"testRuntimeClasspath",
|
||||||
"testRuntimeOnly"
|
"testRuntimeOnly",
|
||||||
|
"tests-jar"
|
||||||
],
|
],
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
|
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
|
||||||
@@ -3455,6 +3524,40 @@
|
|||||||
"signing": "org.gradle.plugins.signing.SigningExtension"
|
"signing": "org.gradle.plugins.signing.SigningExtension"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
":kotlin-test:kotlin-test-js-it": {
|
||||||
|
"conventions": {
|
||||||
|
"base": "org.gradle.api.plugins.BasePluginConvention",
|
||||||
|
"java": "org.gradle.api.plugins.JavaPluginConvention"
|
||||||
|
},
|
||||||
|
"configurations": [
|
||||||
|
"apiElements",
|
||||||
|
"archives",
|
||||||
|
"compile",
|
||||||
|
"compileClasspath",
|
||||||
|
"compileOnly",
|
||||||
|
"default",
|
||||||
|
"implement",
|
||||||
|
"implementation",
|
||||||
|
"runtime",
|
||||||
|
"runtimeClasspath",
|
||||||
|
"runtimeElements",
|
||||||
|
"runtimeOnly",
|
||||||
|
"testCompile",
|
||||||
|
"testCompileClasspath",
|
||||||
|
"testCompileOnly",
|
||||||
|
"testImplementation",
|
||||||
|
"testRuntime",
|
||||||
|
"testRuntimeClasspath",
|
||||||
|
"testRuntimeOnly"
|
||||||
|
],
|
||||||
|
"extensions": {
|
||||||
|
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
|
||||||
|
"node": "com.moowork.gradle.node.NodeExtension",
|
||||||
|
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension",
|
||||||
|
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
|
||||||
|
"reporting": "org.gradle.api.reporting.ReportingExtension"
|
||||||
|
}
|
||||||
|
},
|
||||||
":kotlin-test:kotlin-test-junit": {
|
":kotlin-test:kotlin-test-junit": {
|
||||||
"conventions": {
|
"conventions": {
|
||||||
"base": "org.gradle.api.plugins.BasePluginConvention",
|
"base": "org.gradle.api.plugins.BasePluginConvention",
|
||||||
|
|||||||
@@ -105,3 +105,5 @@ projectTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testsJar {}
|
testsJar {}
|
||||||
|
|
||||||
|
classesDirsArtifact()
|
||||||
|
|||||||
@@ -18,15 +18,9 @@ apply { plugin("kotlin") }
|
|||||||
|
|
||||||
val ideaCommunityPlugin by configurations.creating
|
val ideaCommunityPlugin by configurations.creating
|
||||||
|
|
||||||
val ideaProjectClasses = project(":idea").the<JavaPluginConvention>().sourceSets["main"].output.classesDirs
|
|
||||||
val ideaProjectResources = project(":idea").the<JavaPluginConvention>().sourceSets["main"].output.resourcesDir
|
val ideaProjectResources = project(":idea").the<JavaPluginConvention>().sourceSets["main"].output.resourcesDir
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
val compile by configurations
|
|
||||||
val compileOnly by configurations
|
|
||||||
val testCompile by configurations
|
|
||||||
val testCompileOnly by configurations
|
|
||||||
val testRuntime by configurations
|
|
||||||
compile(projectDist(":kotlin-reflect"))
|
compile(projectDist(":kotlin-reflect"))
|
||||||
compile(projectDist(":kotlin-stdlib"))
|
compile(projectDist(":kotlin-stdlib"))
|
||||||
compile(project(":core")) { isTransitive = false }
|
compile(project(":core")) { isTransitive = false }
|
||||||
@@ -34,7 +28,7 @@ dependencies {
|
|||||||
compile(project(":compiler:light-classes")) { isTransitive = false }
|
compile(project(":compiler:light-classes")) { isTransitive = false }
|
||||||
compile(project(":compiler:frontend")) { isTransitive = false }
|
compile(project(":compiler:frontend")) { isTransitive = false }
|
||||||
compile(project(":compiler:frontend.java")) { isTransitive = false }
|
compile(project(":compiler:frontend.java")) { isTransitive = false }
|
||||||
compile(ideaProjectClasses)
|
compile(projectClasses(":idea"))
|
||||||
compile(project(":idea:idea-core")) { isTransitive = false }
|
compile(project(":idea:idea-core")) { isTransitive = false }
|
||||||
compile(project(":idea:ide-common")) { isTransitive = false }
|
compile(project(":idea:ide-common")) { isTransitive = false }
|
||||||
compile(project(":idea:idea-gradle")) { isTransitive = false }
|
compile(project(":idea:idea-gradle")) { isTransitive = false }
|
||||||
|
|||||||
Reference in New Issue
Block a user