Skip to content

Commit a1e74ac

Browse files
Merge pull request #88 from OneBusAway/release-please--branches--main--changes--next
release: 0.1.0-alpha.32
2 parents 2684e07 + eb9164b commit a1e74ac

File tree

9 files changed

+344
-7
lines changed

9 files changed

+344
-7
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.31"
2+
".": "0.1.0-alpha.32"
33
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.1.0-alpha.32 (2025-07-29)
4+
5+
Full Changelog: [v0.1.0-alpha.31...v0.1.0-alpha.32](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.31...v0.1.0-alpha.32)
6+
7+
### Features
8+
9+
* **client:** ensure compat with proguard ([06bc3af](https://github.com/OneBusAway/java-sdk/commit/06bc3afc80e34e726f835bbe3eca0ec8dc3c4d43))
10+
311
## 0.1.0-alpha.31 (2025-07-25)
412

513
Full Changelog: [v0.1.0-alpha.30...v0.1.0-alpha.31](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.30...v0.1.0-alpha.31)

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-java)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.31)
6-
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.31/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.31)
5+
[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-java)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.32)
6+
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.32/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.32)
77

88
<!-- x-release-please-end -->
99

@@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).
1515

1616
<!-- x-release-please-start-version -->
1717

18-
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). Javadocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.31).
18+
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). Javadocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.32).
1919

2020
<!-- x-release-please-end -->
2121

@@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.onebusaway.org](https://de
2626
### Gradle
2727

2828
```kotlin
29-
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.31")
29+
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.32")
3030
```
3131

3232
### Maven
@@ -35,7 +35,7 @@ implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.31")
3535
<dependency>
3636
<groupId>org.onebusaway</groupId>
3737
<artifactId>onebusaway-sdk-java</artifactId>
38-
<version>0.1.0-alpha.31</version>
38+
<version>0.1.0-alpha.32</version>
3939
</dependency>
4040
```
4141

@@ -241,6 +241,12 @@ Or to `debug` for more verbose logging:
241241
$ export ONEBUSAWAY_SDK_LOG=debug
242242
```
243243

244+
## ProGuard and R8
245+
246+
Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `onebusaway-sdk-java-core` is published with a [configuration file](onebusaway-sdk-java-core/src/main/resources/META-INF/proguard/onebusaway-sdk-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).
247+
248+
ProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.
249+
244250
## Jackson
245251

246252
The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
allprojects {
1010
group = "org.onebusaway"
11-
version = "0.1.0-alpha.31" // x-release-please-version
11+
version = "0.1.0-alpha.32" // x-release-please-version
1212
}
1313

1414
subprojects {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Jackson uses reflection and depends heavily on runtime attributes.
2+
-keepattributes
3+
4+
# Jackson uses Kotlin reflection utilities, which themselves use reflection to access things.
5+
-keep class kotlin.reflect.** { *; }
6+
-keep class kotlin.Metadata { *; }
7+
8+
# Jackson uses reflection to access enum members (e.g. via `java.lang.Class.getEnumConstants()`).
9+
-keepclassmembers class com.fasterxml.jackson.** extends java.lang.Enum {
10+
<fields>;
11+
public static **[] values();
12+
public static ** valueOf(java.lang.String);
13+
}
14+
15+
# Jackson uses reflection to access annotation members.
16+
-keepclassmembers @interface com.fasterxml.jackson.annotation.** {
17+
*;
18+
}
19+
20+
# Jackson uses reflection to access the default constructors of serializers and deserializers.
21+
-keepclassmembers class * extends org.onebusaway.core.BaseSerializer {
22+
<init>();
23+
}
24+
-keepclassmembers class * extends org.onebusaway.core.BaseDeserializer {
25+
<init>();
26+
}
27+
28+
# Jackson uses reflection to serialize and deserialize our classes based on their constructors and annotated members.
29+
-keepclassmembers class org.onebusaway.** {
30+
<init>(...);
31+
@com.fasterxml.jackson.annotation.* *;
32+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
plugins {
2+
id("onebusaway-sdk.kotlin")
3+
id("com.gradleup.shadow") version "8.3.8"
4+
}
5+
6+
buildscript {
7+
dependencies {
8+
classpath("com.guardsquare:proguard-gradle:7.4.2")
9+
}
10+
}
11+
12+
dependencies {
13+
testImplementation(project(":onebusaway-sdk-java"))
14+
testImplementation(kotlin("test"))
15+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
16+
testImplementation("org.assertj:assertj-core:3.25.3")
17+
testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4")
18+
testImplementation("org.junit.platform:junit-platform-console:1.10.1")
19+
}
20+
21+
tasks.shadowJar {
22+
from(sourceSets.test.get().output)
23+
configurations = listOf(project.configurations.testRuntimeClasspath.get())
24+
}
25+
26+
val proguardJarPath = "${layout.buildDirectory.get()}/libs/${project.name}-${project.version}-proguard.jar"
27+
val proguardJar by tasks.registering(proguard.gradle.ProGuardTask::class) {
28+
group = "verification"
29+
dependsOn(tasks.shadowJar)
30+
notCompatibleWithConfigurationCache("ProGuard")
31+
32+
injars(tasks.shadowJar)
33+
outjars(proguardJarPath)
34+
printmapping("${layout.buildDirectory.get()}/proguard-mapping.txt")
35+
36+
verbose()
37+
dontwarn()
38+
39+
val javaHome = System.getProperty("java.home")
40+
if (System.getProperty("java.version").startsWith("1.")) {
41+
// Before Java 9, the runtime classes were packaged in a single jar file.
42+
libraryjars("$javaHome/lib/rt.jar")
43+
} else {
44+
// As of Java 9, the runtime classes are packaged in modular jmod files.
45+
libraryjars(
46+
// Filters must be specified first, as a map.
47+
mapOf("jarfilter" to "!**.jar", "filter" to "!module-info.class"),
48+
"$javaHome/jmods/java.base.jmod"
49+
)
50+
}
51+
52+
configuration("./test.pro")
53+
configuration("../onebusaway-sdk-java-core/src/main/resources/META-INF/proguard/onebusaway-sdk-java-core.pro")
54+
}
55+
56+
val testProGuard by tasks.registering(JavaExec::class) {
57+
group = "verification"
58+
dependsOn(proguardJar)
59+
notCompatibleWithConfigurationCache("ProGuard")
60+
61+
mainClass.set("org.junit.platform.console.ConsoleLauncher")
62+
classpath = files(proguardJarPath)
63+
args = listOf(
64+
"--classpath", proguardJarPath,
65+
"--scan-classpath",
66+
"--details", "verbose",
67+
)
68+
}
69+
70+
tasks.test {
71+
dependsOn(testProGuard)
72+
// We defer to the tests run via the ProGuard JAR.
73+
enabled = false
74+
}

0 commit comments

Comments
 (0)