Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.1.0-alpha.2 #5

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Publish to Sonatype
run: |
./gradlew --parallel --no-daemon publish
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
env:
SONATYPE_USERNAME: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.1"
".": "0.1.0-alpha.2"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.2 (2024-09-30)

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

### Features

* **api:** manual updates ([#4](https://github.com/OneBusAway/java-sdk/issues/4)) ([e9c7b74](https://github.com/OneBusAway/java-sdk/commit/e9c7b741ad5a0469d4f44899a0be89fc14ad2246))

## 0.1.0-alpha.1 (2024-09-27)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/OneBusAway/java-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

[![Maven Central](https://img.shields.io/maven-central/v/com.open_transit.api/onebusaway-sdk-java)](https://central.sonatype.com/artifact/com.open_transit.api/onebusaway-sdk-java/0.1.0-alpha.1)
[![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.2)

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

Expand All @@ -27,16 +27,16 @@ The REST API documentation can be found on [developer.onebusaway.org](https://d
<!-- x-release-please-start-version -->

```kotlin
implementation("com.open_transit.api:onebusaway-sdk-java:0.1.0-alpha.1")
implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.2")
```

#### Maven

```xml
<dependency>
<groupId>com.open_transit.api</groupId>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-sdk-java</artifactId>
<version>0.1.0-alpha.1</version>
<version>0.1.0-alpha.2</version>
</dependency>
```

Expand All @@ -47,8 +47,8 @@ implementation("com.open_transit.api:onebusaway-sdk-java:0.1.0-alpha.1")
Use `OnebusawaySdkOkHttpClient.builder()` to configure the client. At a minimum you need to set `.apiKey()`:

```java
import com.open_transit.api.client.OnebusawaySdkClient;
import com.open_transit.api.client.okhttp.OnebusawaySdkOkHttpClient;
import org.onebusaway.client.OnebusawaySdkClient;
import org.onebusaway.client.okhttp.OnebusawaySdkOkHttpClient;

OnebusawaySdkClient client = OnebusawaySdkOkHttpClient.builder()
.apiKey("My API Key")
Expand Down Expand Up @@ -81,8 +81,8 @@ To create a new current time, first use the `CurrentTimeRetrieveParams` builder
then pass that to the `retrieve` method of the `currentTime` service.

```java
import com.open_transit.api.models.CurrentTimeRetrieveParams;
import com.open_transit.api.models.CurrentTimeRetrieveResponse;
import org.onebusaway.models.CurrentTimeRetrieveParams;
import org.onebusaway.models.CurrentTimeRetrieveResponse;

CurrentTimeRetrieveParams params = CurrentTimeRetrieveParams.builder().build();
CurrentTimeRetrieveResponse currentTime = client.currentTime().retrieve(params);
Expand All @@ -103,7 +103,7 @@ Sometimes, the API may support other properties that are not yet supported in th
you can attach them using the `putAdditionalProperty` method.

```java
import com.open_transit.api.models.core.JsonValue;
import org.onebusaway.models.core.JsonValue;
CurrentTimeRetrieveParams params = CurrentTimeRetrieveParams.builder()
// ... normal properties
.putAdditionalProperty("secret_param", JsonValue.from("4242"))
Expand Down
16 changes: 3 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"

}

allprojects {
group = "com.open_transit.api"
version = "0.1.0-alpha.1" // x-release-please-version
group = "org.onebusaway"
version = "0.1.0-alpha.2" // x-release-please-version
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))

username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}
4 changes: 4 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
plugins {
`kotlin-dsl`
kotlin("jvm") version "1.9.22"
id("com.vanniktech.maven.publish") version "0.28.0"
}

repositories {
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
14 changes: 4 additions & 10 deletions buildSrc/src/main/kotlin/onebusaway-sdk.java.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import java.util.Locale
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost

plugins {
`java-library`
Expand All @@ -11,11 +14,6 @@ repositories {
mavenCentral()
}

configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
}

configure<SpotlessExtension> {
java {
importOrder()
Expand All @@ -35,10 +33,6 @@ tasks.withType<JavaCompile>().configureEach {
options.release.set(8)
}

tasks.named<Jar>("javadocJar") {
setZip64(true)
}

tasks.named<Jar>("jar") {
manifest {
attributes(mapOf(
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/onebusaway-sdk.kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.vanniktech.maven.publish.*

plugins {
id("onebusaway-sdk.java")
Expand Down
83 changes: 35 additions & 48 deletions buildSrc/src/main/kotlin/onebusaway-sdk.publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,52 @@ import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.get
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost

plugins {
`maven-publish`
`signing`
id("com.vanniktech.maven.publish")
}

configure<PublishingExtension> {
publications {
register<MavenPublication>("maven") {
from(components["java"])
repositories {
gradlePluginPortal()
mavenCentral()
}

pom {
name.set("OneBusAway")
description.set("The OneBusAway REST API. For use with servers like\nhttps://api.pugetsound.onebusaway.org")
url.set("https://developer.onebusaway.org")
extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")

licenses {
license {
name.set("Apache-2.0")
}
}
configure<MavenPublishBaseExtension> {
signAllPublications()
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

developers {
developer {
name.set("Onebusaway SDK")
email.set("[email protected]")
}
}
this.coordinates(project.group.toString(), project.name, project.version.toString())

scm {
connection.set("scm:git:git://github.com/OneBusAway/java-sdk.git")
developerConnection.set("scm:git:git://github.com/OneBusAway/java-sdk.git")
url.set("https://github.com/OneBusAway/java-sdk")
}
pom {
name.set("OneBusAway")
description.set("The OneBusAway REST API. For use with servers like\nhttps://api.pugetsound.onebusaway.org")
url.set("https://developer.onebusaway.org")

versionMapping {
allVariants {
fromResolutionResult()
}
}
licenses {
license {
name.set("Apache-2.0")
}
}
}
}

signing {
val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null }
val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null }
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null }
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(
signingKeyId,
signingKey,
signingPassword,
)
sign(publishing.publications["maven"])
}
}
developers {
developer {
name.set("Onebusaway SDK")
email.set("[email protected]")
}
}

tasks.named("publish") {
dependsOn(":closeAndReleaseSonatypeStagingRepository")
scm {
connection.set("scm:git:git://github.com/OneBusAway/java-sdk.git")
developerConnection.set("scm:git:git://github.com/OneBusAway/java-sdk.git")
url.set("https://github.com/OneBusAway/java-sdk")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
package com.open_transit.api.client.okhttp
package org.onebusaway.client.okhttp

import com.google.common.collect.ListMultimap
import com.google.common.collect.MultimapBuilder
import com.open_transit.api.core.RequestOptions
import com.open_transit.api.core.http.HttpClient
import com.open_transit.api.core.http.HttpMethod
import com.open_transit.api.core.http.HttpRequest
import com.open_transit.api.core.http.HttpRequestBody
import com.open_transit.api.core.http.HttpResponse
import com.open_transit.api.errors.OnebusawaySdkIoException
import java.io.IOException
import java.io.InputStream
import java.net.Proxy
Expand All @@ -26,6 +19,13 @@ import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import okio.BufferedSink
import org.onebusaway.core.RequestOptions
import org.onebusaway.core.http.HttpClient
import org.onebusaway.core.http.HttpMethod
import org.onebusaway.core.http.HttpRequest
import org.onebusaway.core.http.HttpRequestBody
import org.onebusaway.core.http.HttpResponse
import org.onebusaway.errors.OnebusawaySdkIoException

class OkHttpClient
private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// File generated from our OpenAPI spec by Stainless.

package com.open_transit.api.client.okhttp
package org.onebusaway.client.okhttp

import com.fasterxml.jackson.databind.json.JsonMapper
import com.open_transit.api.client.OnebusawaySdkClient
import com.open_transit.api.client.OnebusawaySdkClientImpl
import com.open_transit.api.core.ClientOptions
import java.net.Proxy
import java.time.Clock
import java.time.Duration
import org.onebusaway.client.OnebusawaySdkClient
import org.onebusaway.client.OnebusawaySdkClientImpl
import org.onebusaway.core.ClientOptions

class OnebusawaySdkOkHttpClient private constructor() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// File generated from our OpenAPI spec by Stainless.

package com.open_transit.api.client.okhttp
package org.onebusaway.client.okhttp

import com.fasterxml.jackson.databind.json.JsonMapper
import com.open_transit.api.client.OnebusawaySdkClientAsync
import com.open_transit.api.client.OnebusawaySdkClientAsyncImpl
import com.open_transit.api.core.ClientOptions
import java.net.Proxy
import java.time.Clock
import java.time.Duration
import org.onebusaway.client.OnebusawaySdkClientAsync
import org.onebusaway.client.OnebusawaySdkClientAsyncImpl
import org.onebusaway.core.ClientOptions

class OnebusawaySdkOkHttpClientAsync private constructor() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102

package com.open_transit.api.client
package org.onebusaway.client

import com.open_transit.api.models.*
import com.open_transit.api.services.blocking.*
import org.onebusaway.models.*
import org.onebusaway.services.blocking.*

interface OnebusawaySdkClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102

package com.open_transit.api.client
package org.onebusaway.client

import com.open_transit.api.models.*
import com.open_transit.api.services.async.*
import org.onebusaway.models.*
import org.onebusaway.services.async.*

interface OnebusawaySdkClientAsync {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// File generated from our OpenAPI spec by Stainless.

package com.open_transit.api.client

import com.open_transit.api.core.ClientOptions
import com.open_transit.api.core.http.HttpResponse.Handler
import com.open_transit.api.errors.OnebusawaySdkError
import com.open_transit.api.models.*
import com.open_transit.api.services.async.*
import com.open_transit.api.services.errorHandler
package org.onebusaway.client

import org.onebusaway.core.ClientOptions
import org.onebusaway.core.http.HttpResponse.Handler
import org.onebusaway.errors.OnebusawaySdkError
import org.onebusaway.models.*
import org.onebusaway.services.async.*
import org.onebusaway.services.errorHandler

class OnebusawaySdkClientAsyncImpl
constructor(
Expand Down
Loading
Loading