File tree Expand file tree Collapse file tree 3 files changed +27
-234
lines changed
Expand file tree Collapse file tree 3 files changed +27
-234
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ repositories {
1212 }
1313}
1414
15+
16+
1517dependencies {
1618 testImplementation(kotlin(" test" ))
1719}
Original file line number Diff line number Diff line change @@ -103,3 +103,28 @@ publishing {
103103 }
104104 }
105105}
106+
107+ gradle.taskGraph.whenReady {
108+ if (hasTask(" :publishSnapshots" )) {
109+ rootProject.version = " 1.0.0-SNAPSHOT"
110+ println (" 📌 Setting root project version to 1.0.0-SNAPSHOT for publishSnapshots task" )
111+ }
112+ }
113+
114+ tasks.register(" publishSnapshots" ) {
115+ val snapshotModules = rootProject.subprojects.filter { project ->
116+ project.version.toString().contains(" -SNAPSHOT" ) && project.tasks.names.contains(" publish" )
117+ }
118+
119+ if (snapshotModules.isNotEmpty()) {
120+ dependsOn(snapshotModules.map { " :${it.name} :publish" })
121+ }
122+
123+ doLast {
124+ if (snapshotModules.isEmpty()) {
125+ println (" ❌ No snapshot modules to publish." )
126+ } else {
127+ println (" 📦 Successfully published snapshots for: ${snapshotModules.map { it.name }} " )
128+ }
129+ }
130+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments