Switch many common tasks defined in buildSrc to lazy creation
also refactor some locally defined tasks to the creation avoidance API
This commit is contained in:
@@ -69,12 +69,12 @@ fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: Configurabl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
|
fun <T : Jar> Project.runtimeJar(task: TaskProvider<T>, body: T.() -> Unit = {}): TaskProvider<T> {
|
||||||
extra["runtimeJarTask"] = task
|
extra["runtimeJarTask"] = task
|
||||||
tasks.findByName("jar")?.let { defaultJarTask ->
|
tasks.findByName("jar")?.let { defaultJarTask ->
|
||||||
removeArtifacts(configurations.getOrCreate("archives"), defaultJarTask)
|
removeArtifacts(configurations.getOrCreate("archives"), defaultJarTask)
|
||||||
}
|
}
|
||||||
return task.apply {
|
task.configure {
|
||||||
configurations.findByName("embedded")?.let { embedded ->
|
configurations.findByName("embedded")?.let { embedded ->
|
||||||
dependsOn(embedded)
|
dependsOn(embedded)
|
||||||
from {
|
from {
|
||||||
@@ -86,9 +86,10 @@ fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
|
|||||||
body()
|
body()
|
||||||
project.runtimeJarArtifactBy(this, this)
|
project.runtimeJarArtifactBy(this, this)
|
||||||
}
|
}
|
||||||
|
return task
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.runtimeJar(body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask("jar", body), { })
|
fun Project.runtimeJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> = runtimeJar(getOrCreateTask("jar", body), { })
|
||||||
|
|
||||||
fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
||||||
val task = tasks.register<Jar>("sourcesJar") {
|
val task = tasks.register<Jar>("sourcesJar") {
|
||||||
@@ -116,7 +117,7 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
|||||||
return task
|
return task
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar = getOrCreateTask("javadocJar") {
|
fun Project.javadocJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> = getOrCreateTask("javadocJar") {
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
classifier = "javadoc"
|
classifier = "javadoc"
|
||||||
tasks.findByName("javadoc")?.let { it as Javadoc }?.takeIf { it.enabled }?.let {
|
tasks.findByName("javadoc")?.let { it as Javadoc }?.takeIf { it.enabled }?.let {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.file.DuplicatesStrategy
|
import org.gradle.api.file.DuplicatesStrategy
|
||||||
|
import org.gradle.api.tasks.TaskProvider
|
||||||
import org.gradle.jvm.tasks.Jar
|
import org.gradle.jvm.tasks.Jar
|
||||||
import org.gradle.kotlin.dsl.task
|
|
||||||
import org.gradle.kotlin.dsl.*
|
import org.gradle.kotlin.dsl.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@@ -59,12 +59,12 @@ private fun ShadowJar.configureEmbeddableCompilerRelocation(withJavaxInject: Boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Unit): Jar {
|
private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Unit): TaskProvider<out Jar> {
|
||||||
|
|
||||||
val compilerJar = configurations.getOrCreate("compilerJar")
|
val compilerJar = configurations.getOrCreate("compilerJar")
|
||||||
dependencies.add(compilerJar.name, dependencies.project(":kotlin-compiler", configuration = "runtimeJar"))
|
dependencies.add(compilerJar.name, dependencies.project(":kotlin-compiler", configuration = "runtimeJar"))
|
||||||
|
|
||||||
return task<ShadowJar>(taskName) {
|
return tasks.register<ShadowJar>(taskName) {
|
||||||
destinationDir = File(buildDir, "libs")
|
destinationDir = File(buildDir, "libs")
|
||||||
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
||||||
from(compilerJar)
|
from(compilerJar)
|
||||||
@@ -72,31 +72,39 @@ private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Un
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): Jar =
|
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): TaskProvider<out Jar> =
|
||||||
compilerShadowJar(taskName) {
|
compilerShadowJar(taskName) {
|
||||||
configureEmbeddableCompilerRelocation()
|
configureEmbeddableCompilerRelocation()
|
||||||
body()
|
body()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.compilerDummyForDependenciesRewriting(taskName: String = "compilerDummy", body: ShadowJar.() -> Unit = {}): Jar =
|
fun Project.compilerDummyForDependenciesRewriting(
|
||||||
compilerShadowJar(taskName) {
|
taskName: String = "compilerDummy", body: ShadowJar.() -> Unit = {}
|
||||||
exclude(packagesToExcludeFromDummy)
|
): TaskProvider<out Jar> =
|
||||||
body()
|
compilerShadowJar(taskName) {
|
||||||
}
|
exclude(packagesToExcludeFromDummy)
|
||||||
|
body()
|
||||||
|
}
|
||||||
|
|
||||||
const val COMPILER_DUMMY_JAR_CONFIGURATION_NAME = "compilerDummyJar"
|
const val COMPILER_DUMMY_JAR_CONFIGURATION_NAME = "compilerDummyJar"
|
||||||
|
|
||||||
fun Project.compilerDummyJar(task: Jar, body: Jar.() -> Unit = {}) {
|
fun Project.compilerDummyJar(task: TaskProvider<out Jar>, body: Jar.() -> Unit = {}) {
|
||||||
task.body()
|
task.configure(body)
|
||||||
addArtifact(COMPILER_DUMMY_JAR_CONFIGURATION_NAME, task, task)
|
task.configure {
|
||||||
|
addArtifact(COMPILER_DUMMY_JAR_CONFIGURATION_NAME, this, this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.embeddableCompilerDummyForDependenciesRewriting(taskName: String = "embeddable", body: Jar.() -> Unit = {}): Jar {
|
fun Project.embeddableCompilerDummyForDependenciesRewriting(
|
||||||
|
taskName: String = "embeddable", body: Jar.() -> Unit = {}
|
||||||
|
): TaskProvider<ShadowJar> {
|
||||||
val compilerDummyJar = configurations.getOrCreate("compilerDummyJar")
|
val compilerDummyJar = configurations.getOrCreate("compilerDummyJar")
|
||||||
dependencies.add(compilerDummyJar.name,
|
dependencies.add(
|
||||||
dependencies.project(":kotlin-compiler-embeddable", configuration = COMPILER_DUMMY_JAR_CONFIGURATION_NAME))
|
compilerDummyJar.name,
|
||||||
|
dependencies.project(":kotlin-compiler-embeddable", configuration = COMPILER_DUMMY_JAR_CONFIGURATION_NAME)
|
||||||
|
)
|
||||||
|
|
||||||
return task<ShadowJar>(taskName) {
|
return tasks.register<ShadowJar>(taskName) {
|
||||||
destinationDir = File(buildDir, "libs")
|
destinationDir = File(buildDir, "libs")
|
||||||
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
||||||
from(compilerDummyJar)
|
from(compilerDummyJar)
|
||||||
@@ -105,14 +113,16 @@ fun Project.embeddableCompilerDummyForDependenciesRewriting(taskName: String = "
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.rewriteDepsToShadedJar(originalJarTask: Jar, shadowJarTask: Jar, body: Jar.() -> Unit = {}): Jar {
|
fun Project.rewriteDepsToShadedJar(
|
||||||
originalJarTask.apply {
|
originalJarTask: TaskProvider<out Jar>, shadowJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}
|
||||||
|
): TaskProvider<out Jar> {
|
||||||
|
originalJarTask.configure {
|
||||||
classifier = "original"
|
classifier = "original"
|
||||||
}
|
}
|
||||||
|
|
||||||
val compilerDummyJarFile by lazy { configurations.getAt("compilerDummyJar").singleFile }
|
val compilerDummyJarFile by lazy { configurations.getAt("compilerDummyJar").singleFile }
|
||||||
|
|
||||||
return shadowJarTask.apply {
|
shadowJarTask.configure {
|
||||||
dependsOn(originalJarTask)
|
dependsOn(originalJarTask)
|
||||||
from(originalJarTask)// { include("**") }
|
from(originalJarTask)// { include("**") }
|
||||||
|
|
||||||
@@ -123,7 +133,11 @@ fun Project.rewriteDepsToShadedJar(originalJarTask: Jar, shadowJarTask: Jar, bod
|
|||||||
classifier = ""
|
classifier = ""
|
||||||
body()
|
body()
|
||||||
}
|
}
|
||||||
|
return shadowJarTask
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.rewriteDepsToShadedCompiler(originalJarTask: Jar, body: Jar.() -> Unit = {}): Jar =
|
fun Project.rewriteDepsToShadedCompiler(originalJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}): TaskProvider<out Jar> =
|
||||||
rewriteDepsToShadedJar(originalJarTask, embeddableCompilerDummyForDependenciesRewriting(), body)
|
rewriteDepsToShadedJar(originalJarTask, embeddableCompilerDummyForDependenciesRewriting(), body)
|
||||||
|
|
||||||
|
fun Project.rewriteDefaultJarDepsToShadedCompiler(body: Jar.() -> Unit = {}): TaskProvider<out Jar> =
|
||||||
|
rewriteDepsToShadedJar(tasks.named<Jar>("jar"), embeddableCompilerDummyForDependenciesRewriting(), body)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.Task
|
import org.gradle.api.Task
|
||||||
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
|
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
|
||||||
|
import org.gradle.api.tasks.TaskProvider
|
||||||
import org.gradle.api.tasks.testing.Test
|
import org.gradle.api.tasks.testing.Test
|
||||||
import org.gradle.kotlin.dsl.extra
|
import org.gradle.kotlin.dsl.extra
|
||||||
import org.gradle.kotlin.dsl.project
|
import org.gradle.kotlin.dsl.project
|
||||||
@@ -36,7 +37,7 @@ fun Project.projectTest(
|
|||||||
parallel: Boolean = false,
|
parallel: Boolean = false,
|
||||||
shortenTempRootName: Boolean = false,
|
shortenTempRootName: Boolean = false,
|
||||||
body: Test.() -> Unit = {}
|
body: Test.() -> Unit = {}
|
||||||
): Test = getOrCreateTask(taskName) {
|
): TaskProvider<Test> = getOrCreateTask(taskName) {
|
||||||
doFirst {
|
doFirst {
|
||||||
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet()
|
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet()
|
||||||
val patterns = filter.includePatterns + commandLineIncludePatterns
|
val patterns = filter.includePatterns + commandLineIncludePatterns
|
||||||
@@ -141,8 +142,9 @@ fun Project.projectTest(
|
|||||||
|
|
||||||
private inline fun String.isFirstChar(f: (Char) -> Boolean) = isNotEmpty() && f(first())
|
private inline fun String.isFirstChar(f: (Char) -> Boolean) = isNotEmpty() && f(first())
|
||||||
|
|
||||||
inline fun <reified T : Task> Project.getOrCreateTask(taskName: String, body: T.() -> Unit): T =
|
inline fun <reified T : Task> Project.getOrCreateTask(taskName: String, noinline body: T.() -> Unit): TaskProvider<T> =
|
||||||
(tasks.findByName(taskName)?.let { it as T } ?: task<T>(taskName)).apply { body() }
|
if (tasks.names.contains(taskName)) tasks.named(taskName, T::class.java).apply { configure(body) }
|
||||||
|
else tasks.register(taskName, T::class.java, body)
|
||||||
|
|
||||||
object TaskUtils {
|
object TaskUtils {
|
||||||
fun useAndroidSdk(task: Task) {
|
fun useAndroidSdk(task: Task) {
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ sourceSets {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar: Jar by tasks
|
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||||
|
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(jar))
|
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
javadocJar()
|
javadocJar()
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ publish()
|
|||||||
|
|
||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
runtimeJar(task<ShadowJar>("shadowJar")) {
|
runtimeJar(tasks.register<ShadowJar>("shadowJar")) {
|
||||||
from(mainSourceSet.output)
|
from(mainSourceSet.output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ publish()
|
|||||||
|
|
||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
runtimeJar(task<ShadowJar>("shadowJar")) {
|
runtimeJar(tasks.register<ShadowJar>("shadowJar")) {
|
||||||
from(mainSourceSet.output)
|
from(mainSourceSet.output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ fun Project.codegenTest(
|
|||||||
target: Int, jvm: String, jdk: String,
|
target: Int, jvm: String, jdk: String,
|
||||||
targetInTestClass: String = "$target",
|
targetInTestClass: String = "$target",
|
||||||
body: Test.() -> Unit
|
body: Test.() -> Unit
|
||||||
): Test = projectTest("codegenTarget${targetInTestClass}Jvm${jvm}Test") {
|
): TaskProvider<Test> = projectTest("codegenTarget${targetInTestClass}Jvm${jvm}Test") {
|
||||||
dependsOn(":dist")
|
dependsOn(":dist")
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ dependencies {
|
|||||||
baseProtobufSources("com.google.protobuf:protobuf-java:$protobufVersion:sources")
|
baseProtobufSources("com.google.protobuf:protobuf-java:$protobufVersion:sources")
|
||||||
}
|
}
|
||||||
|
|
||||||
val prepare = task<ShadowJar>("prepare") {
|
val prepare = tasks.register<ShadowJar>("prepare") {
|
||||||
destinationDir = File(outputJarsPath)
|
destinationDir = File(outputJarsPath)
|
||||||
version = protobufVersion
|
version = protobufVersion
|
||||||
classifier = ""
|
classifier = ""
|
||||||
|
|||||||
@@ -37,5 +37,5 @@ dependencies {
|
|||||||
|
|
||||||
// Relocate `com.intellij.*` and some other classes to match those in the `kotlin-compiler-embeddable`
|
// Relocate `com.intellij.*` and some other classes to match those in the `kotlin-compiler-embeddable`
|
||||||
// (for example, the actual package at runtime is `org.jetbrains.kotlin.com.intellij.*`):
|
// (for example, the actual package at runtime is `org.jetbrains.kotlin.com.intellij.*`):
|
||||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDepsToShadedCompiler(project, jar, {}), {})
|
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||||
// In a standalone build, you can setup the relocation with the Shadow plugin.
|
// In a standalone build, you can setup the relocation with the Shadow plugin.
|
||||||
@@ -54,7 +54,7 @@ if (deployVersion != null) {
|
|||||||
|
|
||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
task<ShadowJar>("shadowJar") {
|
tasks.register<ShadowJar>("shadowJar") {
|
||||||
callGroovy("manifestAttributes", manifest, project)
|
callGroovy("manifestAttributes", manifest, project)
|
||||||
manifest.attributes["Implementation-Version"] = version
|
manifest.attributes["Implementation-Version"] = version
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ publish()
|
|||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(
|
runtimeJar(rewriteDepsToShadedCompiler(
|
||||||
task<ShadowJar>("shadowJar") {
|
tasks.register<ShadowJar>("shadowJar") {
|
||||||
from(packedJars)
|
from(packedJars)
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ publish()
|
|||||||
|
|
||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
val jar = tasks.getByName<Jar>("jar")
|
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(jar))
|
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
javadocJar()
|
javadocJar()
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ publishing {
|
|||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("internal") {
|
create<MavenPublication>("internal") {
|
||||||
artifactId = "kotlin-stdlib-minimal-for-test"
|
artifactId = "kotlin-stdlib-minimal-for-test"
|
||||||
artifact(jar)
|
artifact(jar.get())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ jar {
|
|||||||
manifestAttributes(manifest, project)
|
manifestAttributes(manifest, project)
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDepsToShadedCompiler(project, jar, {}), {})
|
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact
|
|
||||||
import org.gradle.jvm.tasks.Jar
|
import org.gradle.jvm.tasks.Jar
|
||||||
|
|
||||||
description = "Kapt - Annotation processing for Kotlin"
|
description = "Kapt - Annotation processing for Kotlin"
|
||||||
@@ -22,13 +21,12 @@ projectTest(parallel = true) {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar: Jar by tasks
|
tasks.named<Jar>("jar").configure {
|
||||||
jar.apply {
|
|
||||||
classifier = "base"
|
classifier = "base"
|
||||||
}
|
}
|
||||||
|
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(
|
runtimeJar(rewriteDepsToShadedCompiler(
|
||||||
task<ShadowJar>("shadowJar") {
|
tasks.register<ShadowJar>("shadowJar") {
|
||||||
from(packedJars)
|
from(packedJars)
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ kotlin.target.compilations {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val runBenchmark by tasks.registering(JavaExec::class) {
|
val runBenchmark by tasks.registering<JavaExec> {
|
||||||
classpath = kotlin.target.compilations["benchmark"].run { runtimeDependencyFiles + output.allOutputs }
|
classpath = kotlin.target.compilations["benchmark"].run { runtimeDependencyFiles + output.allOutputs }
|
||||||
main = "com.example.ABenchmarkKt"
|
main = "com.example.ABenchmarkKt"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(
|
runtimeJar(rewriteDepsToShadedCompiler(
|
||||||
task<ShadowJar>("shadowJar") {
|
tasks.register<ShadowJar>("shadowJar") {
|
||||||
from(packedJars)
|
from(packedJars)
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ plugins {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
// todo: make lazy
|
|
||||||
val jar: Jar by tasks
|
|
||||||
val jarContents by configurations.creating
|
val jarContents by configurations.creating
|
||||||
|
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
@@ -91,7 +89,7 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
|||||||
configurations.compile.get().exclude("com.android.tools.external.com-intellij", "intellij-core")
|
configurations.compile.get().exclude("com.android.tools.external.com-intellij", "intellij-core")
|
||||||
}
|
}
|
||||||
|
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(jar)) {
|
runtimeJar(rewriteDefaultJarDepsToShadedCompiler()).configure {
|
||||||
dependsOn(jarContents)
|
dependsOn(jarContents)
|
||||||
|
|
||||||
from {
|
from {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ jar {
|
|||||||
manifestAttributes(manifest, project)
|
manifestAttributes(manifest, project)
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDepsToShadedCompiler(project, jar, {}), {})
|
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ jar {
|
|||||||
manifestAttributes(manifest, project)
|
manifestAttributes(manifest, project)
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDepsToShadedCompiler(project, jar, {}), {})
|
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ compileJava {
|
|||||||
options.fork = false
|
options.fork = false
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
TaskProvider<Jar> jar = tasks.named("jar")
|
||||||
|
jar.configure {
|
||||||
manifestAttributes(manifest, project)
|
manifestAttributes(manifest, project)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ jar {
|
|||||||
manifestAttributes(manifest, project)
|
manifestAttributes(manifest, project)
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDepsToShadedCompiler(project, jar, {}), {})
|
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ dependencies {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar: Jar by tasks
|
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(jar))
|
|
||||||
|
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ publish()
|
|||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(
|
runtimeJar(rewriteDepsToShadedCompiler(
|
||||||
task<ShadowJar>("shadowJar") {
|
tasks.register<ShadowJar>("shadowJar") {
|
||||||
from(packedJars)
|
from(packedJars)
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ publish()
|
|||||||
|
|
||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(
|
runtimeJar(rewriteDepsToShadedCompiler(
|
||||||
task<ShadowJar>("shadowJar") {
|
tasks.register<ShadowJar>("shadowJar") {
|
||||||
from(packedJars)
|
from(packedJars)
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ sourceSets {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar: Jar by tasks
|
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(jar))
|
|
||||||
|
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ dependencies {
|
|||||||
val jar = runtimeJar {
|
val jar = runtimeJar {
|
||||||
from("$rootDir/resources/kotlinManifest.properties")
|
from("$rootDir/resources/kotlinManifest.properties")
|
||||||
archiveName = "kotlin-plugin.jar"
|
archiveName = "kotlin-plugin.jar"
|
||||||
}
|
}.get() // make it eager to avoid corresponding refactorings in the kotlin-ultimate part for now
|
||||||
|
|
||||||
val ideaPluginDir: File by rootProject.extra
|
val ideaPluginDir: File by rootProject.extra
|
||||||
tasks.register<Sync>("ideaPlugin") {
|
tasks.register<Sync>("ideaPlugin") {
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ dependencies {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar: Jar by tasks
|
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(jar))
|
|
||||||
|
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ publish()
|
|||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
runtimeJar(rewriteDepsToShadedCompiler(
|
runtimeJar(rewriteDepsToShadedCompiler(
|
||||||
task<ShadowJar>("shadowJar") {
|
tasks.register<ShadowJar>("shadowJar") {
|
||||||
from(packedJars)
|
from(packedJars)
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|||||||
Reference in New Issue
Block a user