Skip to content

Commit 5fcfe9d

Browse files
Merge pull request #93 from OneBusAway/release-please--branches--main--changes--next
release: 0.1.0-alpha.37
2 parents c14112a + 9d060cb commit 5fcfe9d

File tree

84 files changed

+2977
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2977
-668
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,31 @@ jobs:
3636

3737
- name: Run lints
3838
run: ./scripts/lint
39+
40+
build:
41+
timeout-minutes: 15
42+
name: build
43+
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
44+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Set up Java
50+
uses: actions/setup-java@v4
51+
with:
52+
distribution: temurin
53+
java-version: |
54+
8
55+
21
56+
cache: gradle
57+
58+
- name: Set up Gradle
59+
uses: gradle/actions/setup-gradle@v4
60+
61+
- name: Build SDK
62+
run: ./scripts/build
63+
3964
test:
4065
timeout-minutes: 15
4166
name: test

.github/workflows/publish-sonatype.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
export -- GPG_SIGNING_KEY_ID
3434
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
3535
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
36-
./gradlew publishAndReleaseToMavenCentral -Dorg.gradle.jvmargs="-Xmx8g" --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
36+
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
3737
env:
3838
SONATYPE_USERNAME: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
3939
SONATYPE_PASSWORD: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
.gradle
33
.idea
44
.kotlin
5-
build
5+
build/
66
codegen.log
77
kls_database.db

.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.36"
2+
".": "0.1.0-alpha.37"
33
}

CHANGELOG.md

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

3+
## 0.1.0-alpha.37 (2025-08-31)
4+
5+
Full Changelog: [v0.1.0-alpha.36...v0.1.0-alpha.37](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.36...v0.1.0-alpha.37)
6+
7+
### Performance Improvements
8+
9+
* **internal:** make formatting faster ([99fbd78](https://github.com/OneBusAway/java-sdk/commit/99fbd78f052b7bd28679a4e4ca63e5486909b40c))
10+
11+
12+
### Chores
13+
14+
* **ci:** add build job ([e9a4334](https://github.com/OneBusAway/java-sdk/commit/e9a4334ed4def5ff07ef7ad9fc959d86531423d4))
15+
* **ci:** reduce log noise ([a44cd60](https://github.com/OneBusAway/java-sdk/commit/a44cd60b985c90043721fdd5e59913bbee7001ef))
16+
* **client:** refactor closing / shutdown ([1a3f6c5](https://github.com/OneBusAway/java-sdk/commit/1a3f6c59f0a6215188bbce3d1117f1008b7e4008))
17+
* increase max gradle JVM heap to 8GB ([09fe22c](https://github.com/OneBusAway/java-sdk/commit/09fe22c50fd3025c2f1da7a37218d6cbfc8a04d9))
18+
* **internal:** codegen related update ([fcda4f9](https://github.com/OneBusAway/java-sdk/commit/fcda4f9e3cadf6574f110689ddb80fda9fe3e87b))
19+
* **internal:** dynamically determine included projects ([87d4c56](https://github.com/OneBusAway/java-sdk/commit/87d4c56d8a6f24de52544ade996e83dd65bedbe0))
20+
* **internal:** support passing arguments to test script ([7bad9c0](https://github.com/OneBusAway/java-sdk/commit/7bad9c0a8741e9ffd6432856434a48a9d76af7af))
21+
* **internal:** support running formatters directly ([bd33d83](https://github.com/OneBusAway/java-sdk/commit/bd33d83283a843365951f3b6f7de65367ae7bcd7))
22+
* **internal:** update comment in script ([d037c17](https://github.com/OneBusAway/java-sdk/commit/d037c17a5b778fc55c8e30534bfd50f23f4d0984))
23+
* remove memory upper bound from publishing step ([9710ffe](https://github.com/OneBusAway/java-sdk/commit/9710ffe8cbce1fbc8870aa4de279524e40ea4153))
24+
* update @stainless-api/prism-cli to v5.15.0 ([3f2a043](https://github.com/OneBusAway/java-sdk/commit/3f2a043a8a41078b57b5d2afa8052824b60d6a43))
25+
326
## 0.1.0-alpha.36 (2025-08-06)
427

528
Full Changelog: [v0.1.0-alpha.35...v0.1.0-alpha.36](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.35...v0.1.0-alpha.36)

README.md

Lines changed: 5 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.36)
6-
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.36/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.36)
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.37)
6+
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.37/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.37)
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.36).
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.37).
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.36")
29+
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.37")
3030
```
3131

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

build.gradle.kts

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

99
allprojects {
1010
group = "org.onebusaway"
11-
version = "0.1.0-alpha.36" // x-release-please-version
11+
version = "0.1.0-alpha.37" // x-release-please-version
12+
}
13+
14+
subprojects {
15+
// These are populated with dependencies by `buildSrc` scripts.
16+
tasks.register("format") {
17+
group = "Verification"
18+
description = "Formats all source files."
19+
}
20+
tasks.register("lint") {
21+
group = "Verification"
22+
description = "Verifies all source files are formatted."
23+
}
24+
apply(plugin = "org.jetbrains.dokka")
1225
}
1326

1427
subprojects {

buildSrc/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ repositories {
1010
}
1111

1212
dependencies {
13-
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
1413
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
1514
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
1615
}

buildSrc/src/main/kotlin/onebusaway-sdk.java.gradle.kts

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
1-
import com.diffplug.gradle.spotless.SpotlessExtension
21
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
32

43
plugins {
54
`java-library`
6-
id("com.diffplug.spotless")
75
}
86

97
repositories {
108
mavenCentral()
119
}
1210

13-
configure<SpotlessExtension> {
14-
java {
15-
importOrder()
16-
removeUnusedImports()
17-
palantirJavaFormat()
18-
toggleOffOn()
19-
}
20-
}
21-
2211
java {
2312
toolchain {
2413
languageVersion.set(JavaLanguageVersion.of(21))
@@ -53,3 +42,86 @@ tasks.withType<Test>().configureEach {
5342
exceptionFormat = TestExceptionFormat.FULL
5443
}
5544
}
45+
46+
val palantir by configurations.creating
47+
dependencies {
48+
palantir("com.palantir.javaformat:palantir-java-format:2.73.0")
49+
}
50+
51+
fun registerPalantir(
52+
name: String,
53+
description: String,
54+
) {
55+
val javaName = "${name}Java"
56+
tasks.register<JavaExec>(javaName) {
57+
group = "Verification"
58+
this.description = description
59+
60+
classpath = palantir
61+
mainClass = "com.palantir.javaformat.java.Main"
62+
63+
// Avoid an `IllegalAccessError` on Java 9+.
64+
jvmArgs(
65+
"--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
66+
"--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
67+
"--add-exports", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
68+
"--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
69+
"--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
70+
)
71+
72+
// Use paths relative to the current module.
73+
val argumentFile =
74+
project.layout.buildDirectory.file("palantir-$name-args.txt").get().asFile
75+
val lastRunTimeFile =
76+
project.layout.buildDirectory.file("palantir-$name-last-run.txt").get().asFile
77+
78+
// Read the time when this task was last executed for this module (if ever).
79+
val lastRunTime = lastRunTimeFile.takeIf { it.exists() }?.readText()?.toLongOrNull() ?: 0L
80+
81+
// Use a `fileTree` relative to the module's source directory.
82+
val javaFiles = project.fileTree("src") { include("**/*.java") }
83+
84+
// Determine if any files need to be formatted or linted and continue only if there is at least
85+
// one file.
86+
onlyIf { javaFiles.any { it.lastModified() > lastRunTime } }
87+
88+
inputs.files(javaFiles)
89+
90+
doFirst {
91+
// Create the argument file and set the preferred formatting style.
92+
argumentFile.parentFile.mkdirs()
93+
argumentFile.writeText("--palantir\n")
94+
95+
if (name == "lint") {
96+
// For lint, do a dry run, so no files are modified. Set the exit code to 1 (instead of
97+
// the default 0) if any files need to be formatted, indicating that linting has failed.
98+
argumentFile.appendText("--dry-run\n")
99+
argumentFile.appendText("--set-exit-if-changed\n")
100+
} else {
101+
// `--dry-run` and `--replace` (for in-place formatting) are mutually exclusive.
102+
argumentFile.appendText("--replace\n")
103+
}
104+
105+
// Write the modified files to the argument file.
106+
javaFiles.filter { it.lastModified() > lastRunTime }
107+
.forEach { argumentFile.appendText("${it.absolutePath}\n") }
108+
}
109+
110+
doLast {
111+
// Record the last execution time for later up-to-date checking.
112+
lastRunTimeFile.writeText(System.currentTimeMillis().toString())
113+
}
114+
115+
// Pass the argument file using the @ symbol
116+
args = listOf("@${argumentFile.absolutePath}")
117+
118+
outputs.upToDateWhen { javaFiles.none { it.lastModified() > lastRunTime } }
119+
}
120+
121+
tasks.named(name) {
122+
dependsOn(tasks.named(javaName))
123+
}
124+
}
125+
126+
registerPalantir(name = "format", description = "Formats all Java source files.")
127+
registerPalantir(name = "lint", description = "Verifies all Java source files are formatted.")

buildSrc/src/main/kotlin/onebusaway-sdk.kotlin.gradle.kts

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import com.diffplug.gradle.spotless.SpotlessExtension
21
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
32
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
43

@@ -7,6 +6,10 @@ plugins {
76
kotlin("jvm")
87
}
98

9+
repositories {
10+
mavenCentral()
11+
}
12+
1013
kotlin {
1114
jvmToolchain {
1215
languageVersion.set(JavaLanguageVersion.of(21))
@@ -27,14 +30,77 @@ kotlin {
2730
}
2831
}
2932

30-
configure<SpotlessExtension> {
31-
kotlin {
32-
ktfmt().kotlinlangStyle()
33-
toggleOffOn()
34-
}
35-
}
36-
3733
tasks.withType<Test>().configureEach {
3834
systemProperty("junit.jupiter.execution.parallel.enabled", true)
3935
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
4036
}
37+
38+
val ktfmt by configurations.creating
39+
dependencies {
40+
ktfmt("com.facebook:ktfmt:0.56")
41+
}
42+
43+
fun registerKtfmt(
44+
name: String,
45+
description: String,
46+
) {
47+
val kotlinName = "${name}Kotlin"
48+
tasks.register<JavaExec>(kotlinName) {
49+
group = "Verification"
50+
this.description = description
51+
52+
classpath = ktfmt
53+
mainClass = "com.facebook.ktfmt.cli.Main"
54+
55+
// Use paths relative to the current module.
56+
val argumentFile = project.layout.buildDirectory.file("ktfmt-$name-args.txt").get().asFile
57+
val lastRunTimeFile =
58+
project.layout.buildDirectory.file("ktfmt-$name-last-run.txt").get().asFile
59+
60+
// Read the time when this task was last executed for this module (if ever).
61+
val lastRunTime = lastRunTimeFile.takeIf { it.exists() }?.readText()?.toLongOrNull() ?: 0L
62+
63+
// Use a `fileTree` relative to the module's source directory.
64+
val kotlinFiles = project.fileTree("src") { include("**/*.kt") }
65+
66+
// Determine if any files need to be formatted or linted and continue only if there is at least
67+
// one file (otherwise Ktfmt will fail).
68+
onlyIf { kotlinFiles.any { it.lastModified() > lastRunTime } }
69+
70+
inputs.files(kotlinFiles)
71+
72+
doFirst {
73+
// Create the argument file and set the preferred formatting style.
74+
argumentFile.parentFile.mkdirs()
75+
argumentFile.writeText("--kotlinlang-style\n")
76+
77+
if (name == "lint") {
78+
// For lint, do a dry run, so no files are modified. Set the exit code to 1 (instead of
79+
// the default 0) if any files need to be formatted, indicating that linting has failed.
80+
argumentFile.appendText("--dry-run\n")
81+
argumentFile.appendText("--set-exit-if-changed\n")
82+
}
83+
84+
// Write the modified files to the argument file.
85+
kotlinFiles.filter { it.lastModified() > lastRunTime }
86+
.forEach { argumentFile.appendText("${it.absolutePath}\n") }
87+
}
88+
89+
doLast {
90+
// Record the last execution time for later up-to-date checking.
91+
lastRunTimeFile.writeText(System.currentTimeMillis().toString())
92+
}
93+
94+
// Pass the argument file using the @ symbol
95+
args = listOf("@${argumentFile.absolutePath}")
96+
97+
outputs.upToDateWhen { kotlinFiles.none { it.lastModified() > lastRunTime } }
98+
}
99+
100+
tasks.named(name) {
101+
dependsOn(tasks.named(kotlinName))
102+
}
103+
}
104+
105+
registerKtfmt(name = "format", description = "Formats all Kotlin source files.")
106+
registerKtfmt(name = "lint", description = "Verifies all Kotlin source files are formatted.")

0 commit comments

Comments
 (0)