Skip to content

Commit 6e7e5b2

Browse files
Release 2.2.0 (#295)
* chore: bump version to 2.2.0 * style(detekt): simplify AvgGradientNode creation and improve formatting * ci(publish): add environment * fix(publish): remove duplicate javadoc JAR from gradle plugin publication DGPv2 (Dokka 2.x) auto-attaches a javadoc JAR when the java plugin is present. The explicit JavadocJar.Dokka(...) in vanniktech's GradlePlugin config added a second one, causing "multiple artifacts with identical extension and classifier" on publish. * chore: bump version to 2.2.0 * docs: update RELEASE.md for Gradle command improvements and clarification * fix(publication): update publishAllToMavenLocal task to use Maven Local * docs: update RELEASE.md with instructions for bootstrapping the test repository
1 parent 672e48c commit 6e7e5b2

File tree

10 files changed

+70
-34
lines changed

10 files changed

+70
-34
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
jobs:
1414
publish-maven-central:
15+
environment: publish
1516
name: Publish to Maven Central
1617
runs-on: ubuntu-latest
1718
permissions:

app.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION=2.1.3
1+
VERSION=2.2.0
22
LAST_MODIFIED=2026-04-02

buildSrc/src/main/kotlin/dev/tonholo/s2c/conventions/publication/PublicationTasks.kt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
package dev.tonholo.s2c.conventions.publication
22

33
import org.gradle.api.Project
4-
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
4+
import org.gradle.api.publish.maven.tasks.PublishToMavenLocal
55
import org.gradle.kotlin.dsl.withType
66

77
fun Project.registerPublishAllToMavenLocalTask() {
8-
tasks.create("publishAllToMavenLocal") {
8+
val publishTask = tasks.register("publishAllToMavenLocal") {
99
group = "publishing"
10-
description = "Publish all subprojects to maven local"
11-
doLast {
12-
println("After ${project.name}:publishToLocalMaven")
13-
}
14-
subprojects {
15-
tasks.withType<PublishToMavenRepository> {
16-
doLast {
17-
println("After ${project.name}:publishAllPublicationsToTestMavenRepository")
18-
}
19-
this@create.dependsOn(this)
10+
description = "Publish all subprojects to Maven Local (~/.m2)"
11+
}
12+
subprojects {
13+
afterEvaluate {
14+
tasks.withType<PublishToMavenLocal>().all {
15+
publishTask.configure { dependsOn(this@all) }
2016
}
2117
}
2218
}

docs/RELEASE.md

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,67 @@ With optimization (requires [svgo](https://github.com/svg/svgo) and
6464

6565
## Phase 3: Integration Validation
6666

67-
These test real-world Gradle plugin behavior that functional tests cannot
68-
fully cover.
67+
These test real-world Gradle plugin behaviour that functional tests cannot fully
68+
cover.
6969

70+
- [ ] Bootstrap the test repository (needed by included builds):
71+
```bash
72+
export CI=true
73+
./gradlew publishAllPublicationsToTestMavenRepository
74+
```
7075
- [ ] Build the playground app:
7176
```bash
72-
./gradlew :playground:app:assembleDebug
77+
./gradlew -p playground :app:assembleDebug
78+
```
79+
- [ ] Run again and confirm tasks show `UP-TO-DATE` (incremental cache works):
80+
```bash
81+
./gradlew -p playground :app:assembleDebug --info 2>&1 | grep -E "UP-TO-DATE|is not up-to-date"
82+
```
83+
- [ ] Modify a sample file and rebuild; only the changed file should be
84+
reprocessed (Gradle uses content hashing, so `touch` alone is not enough):
85+
```bash
86+
sed -i.bak '2i\
87+
<!-- release test -->' samples/svg/android.svg
88+
./gradlew -p playground :app:assembleDebug --info 2>&1 | grep -E "parseSvgToComposeIcon.*(not up-to-date)|android\.svg has changed"
89+
git checkout samples/svg/android.svg && rm -f samples/svg/android.svg.bak
90+
```
91+
- [ ] Clean build after incremental (verifies clean state recovery):
92+
```bash
93+
./gradlew -p playground :app:clean :app:assembleDebug
94+
```
95+
- [ ] Build the playground-kmp app (all KMP targets: Android, iOS, JVM, JS,
96+
WasmJS):
97+
```bash
98+
./gradlew -p playground-kmp :composeApp:assemble
7399
```
74100
- [ ] Run again and confirm tasks show `UP-TO-DATE` (incremental cache works):
75101
```bash
76-
./gradlew :playground:app:assembleDebug --info 2>&1 | grep -E "UP-TO-DATE|is not up-to-date"
102+
./gradlew -p playground-kmp :composeApp:assemble --info 2>&1 | grep -E "UP-TO-DATE|is not up-to-date"
77103
```
78-
- [ ] Touch a sample file and rebuild; only the changed file should be
104+
- [ ] Modify a sample file and rebuild; only the changed file should be
79105
reprocessed:
80106
```bash
81-
touch samples/svg/android.svg
82-
./gradlew :playground:app:assembleDebug --info 2>&1 | grep -E "incremental|out-of-date"
107+
sed -i.bak '2i\
108+
<!-- release test -->' samples/svg/android.svg
109+
./gradlew -p playground-kmp :composeApp:assemble --info 2>&1 | grep -E "parseSvgToComposeIcon.*(not up-to-date)|android\.svg has changed"
110+
git checkout samples/svg/android.svg && rm -f samples/svg/android.svg.bak
83111
```
84112
- [ ] Clean build after incremental (verifies clean state recovery):
85113
```bash
86-
./gradlew :playground:app:clean :playground:app:assembleDebug
114+
./gradlew -p playground-kmp :composeApp:clean :composeApp:assemble
87115
```
88116

89117
## Phase 4: Publish Smoke Test
90118

91119
Publish to Maven Local and verify the artifacts are generated correctly.
92120

93-
- [ ] Publish:
121+
- [ ] Bootstrap the test repository (skip if Phase 3 already ran in this
122+
session):
123+
```bash
124+
export CI=true
125+
./gradlew publishAllPublicationsToTestMavenRepository
126+
```
127+
- [ ] Publish to Maven Local:
94128
```bash
95129
./gradlew publishAllToMavenLocal
96130
```
@@ -146,7 +180,8 @@ Full local validation in a single script:
146180
./.github/actions/cli-integrity-check/script.sh . xml
147181

148182
# Integration
149-
./gradlew :playground:app:assembleDebug
183+
./gradlew -p playground :app:assembleDebug
184+
./gradlew -p playground-kmp :composeApp:assemble
150185

151186
# Publish smoke test
152187
./gradlew publishAllToMavenLocal

gradle/libs.playground-kmp.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ compose-multiplatform = "1.10.3"
1111
composeHotReload = "1.0.0"
1212
kotlinx-coroutines = "1.10.2"
1313
material3 = "1.10.0-alpha05"
14-
s2c = "2.1.3"
14+
s2c = "2.2.0"
1515

1616
[libraries]
1717
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }

gradle/libs.playground.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ compose-bom = "2026.02.00"
55
core-ktx = "1.17.0"
66
googleMaterial = "1.13.0"
77
lifecycle-runtime-ktx = "2.10.0"
8-
s2c = "2.1.3"
8+
s2c = "2.2.0"
99

1010
[libraries]
1111
activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activity-compose" }

gradle/libs.website.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ compose-multiplatform = "1.10.2"
55
compose-runtime = "1.10.2"
66
compose-viewmodel = "2.10.0"
77
jszip = "3.10.1"
8-
s2c = "2.1.3"
8+
s2c = "2.2.0"
99

1010
[libraries]
1111
dev-tonholo-s2c = { module = "dev.tonholo.s2c:svg-to-compose", version.ref = "s2c" }

svg-to-compose-gradle-plugin/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ kotlin {
5757
mavenPublishing {
5858
configure(
5959
GradlePlugin(
60-
javadocJar = JavadocJar.Dokka("dokkaGeneratePublicationHtml"),
60+
// DGPv2 (Dokka 2.x) auto-attaches a javadoc JAR when the java plugin
61+
// is present. Using JavadocJar.Dokka(...) here would add a second one,
62+
// causing "multiple artifacts with identical extension and classifier"
63+
// on publish.
64+
javadocJar = JavadocJar.None(),
6165
sourcesJar = true,
6266
)
6367
)

svg-to-compose/src/commonMain/kotlin/dev/tonholo/s2c/domain/avg/AvgGradientNode.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ private fun AvgGradientNode.getColorStops(): Pair<List<AvgColor>, List<Float>> {
126126
stops = when {
127127
centerColor != null && startColor != null && endColor != null ->
128128
listOf(0f, CENTER_COLOR_STOP_OFFSET, 1f)
129+
129130
shorthandColors.size == 2 -> listOf(0f, 1f)
131+
130132
else -> emptyList()
131133
}
132134
} else {

svg-to-compose/src/commonTest/kotlin/dev/tonholo/s2c/domain/avg/AvgGradientNodeTest.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ class AvgGradientNodeTest {
1818
private fun createGradient(
1919
attributes: MutableMap<String, String>,
2020
children: MutableSet<XmlNode> = mutableSetOf(),
21-
): AvgGradientNode {
22-
return AvgGradientNode(
23-
parent = root,
24-
children = children,
25-
attributes = attributes,
26-
)
27-
}
21+
): AvgGradientNode = AvgGradientNode(
22+
parent = root,
23+
children = children,
24+
attributes = attributes,
25+
)
2826

2927
private fun createItem(
3028
parent: AvgGradientNode,

0 commit comments

Comments
 (0)