-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathbuild.gradle.kts
71 lines (58 loc) · 2.35 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Copyright 2024-2025 JetBrains s.r.o. and Compose Hot Reload contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
@file:Suppress("UnstableApiUsage", "unused")
tasks.maybeCreate<Delete>("clean").apply {
delete(layout.buildDirectory)
}
val updateVersions = tasks.register<UpdateVersionTask>("updateVersions") {
sources = fileTree(".") {
include("samples/**/settings.gradle.kts")
include("samples/**/build.gradle.kts")
include("hot-reload-test/idea-plugin/*.gradle.kts")
include("hot-reload-test/sample/*.gradle.kts")
exclude("**/build/**/*")
}
projectVersion = project.version.toString()
kotlinFireworkVersion = deps.versions.kotlin.get()
}
val checkPublishLocally by tasks.registering(CheckPublicationTask::class) {
publicationDirectory.set(layout.buildDirectory.dir("repo"))
}
val publishLocally by tasks.registering {
dependsOn(updateVersions)
finalizedBy(checkPublishLocally)
}
val cleanDeploy by tasks.registering(Delete::class) {
delete(layout.buildDirectory.dir("deploy"))
}
val checkPublishDeploy by tasks.registering(CheckPublicationTask::class) {
publicationDirectory.set(layout.buildDirectory.dir("deploy"))
}
val publishDeploy by tasks.registering {
dependsOn(updateVersions)
finalizedBy(checkPublishDeploy)
}
subprojects {
publishLocally.configure {
this.dependsOn(tasks.named { name -> name == "publishAllPublicationsToLocalRepository" })
}
/* Configure 'publishDeploy' */
tasks.configureEach { mustRunAfter(cleanDeploy) }
val publishDeployTasks = tasks.named { name -> name == "publishAllPublicationsToDeployRepository" }
publishDeployTasks.configureEach { dependsOn(cleanDeploy) }
publishDeploy.configure { dependsOn(publishDeployTasks) }
}
val buildMavenCentralDeployBundle by tasks.registering(Zip::class) {
dependsOn(publishDeploy)
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
from(layout.buildDirectory.dir("deploy"))
archiveBaseName.set("mavenCentral.deploy")
destinationDirectory.set(layout.buildDirectory)
}
val deployMavenCentralDeployBundle by tasks.registering(PublishToMavenCentralTask::class) {
dependsOn(buildMavenCentralDeployBundle)
deploymentBundle.set(buildMavenCentralDeployBundle.flatMap { it.archiveFile })
}