Skip to content

Commit 362fb69

Browse files
chore: go live (#6)
1 parent f01f468 commit 362fb69

File tree

135 files changed

+4729
-901
lines changed

Some content is hidden

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

135 files changed

+4729
-901
lines changed

.github/workflows/publish-sonatype.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Publish to Sonatype
3232
run: |
33-
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
33+
./gradlew --parallel --no-daemon publish
3434
env:
3535
SONATYPE_USERNAME: ${{ secrets.OPENLAYER_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
3636
SONATYPE_PASSWORD: ${{ secrets.OPENLAYER_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.prism.log
12
.gradle
23
.idea
34
build

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 6
1+
configured_endpoints: 8

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
[![Maven Central](https://img.shields.io/maven-central/v/org.openlayer/openlayer-java)](https://central.sonatype.com/artifact/org.openlayer/openlayer-java/0.1.0-alpha.1)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.1.0-alpha.1)
66

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

@@ -27,14 +27,14 @@ The REST API documentation can be found [on openlayer.com](https://openlayer.co
2727
<!-- x-release-please-start-version -->
2828

2929
```kotlin
30-
implementation("org.openlayer:openlayer-java:0.1.0-alpha.1")
30+
implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.1")
3131
```
3232

3333
#### Maven
3434

3535
```xml
3636
<dependency>
37-
<groupId>org.openlayer</groupId>
37+
<groupId>com.openlayer.api</groupId>
3838
<artifactId>openlayer-java</artifactId>
3939
<version>0.1.0-alpha.1</version>
4040
</dependency>
@@ -72,9 +72,9 @@ To create a new inference pipeline data, first use the `InferencePipelineDataStr
7272
then pass that to the `stream` method of the `data` service.
7373

7474
```java
75+
import com.openlayer.api.models.InferencePipelineDataStreamParams;
76+
import com.openlayer.api.models.InferencePipelineDataStreamResponse;
7577
import java.util.List;
76-
import org.openlayer.models.InferencePipelineDataStreamParams;
77-
import org.openlayer.models.InferencePipelineDataStreamResponse;
7878

7979
InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.builder()
8080
.rows(List.of(InferencePipelineDataStreamParams.Row.builder().build()))

build.gradle.kts

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
plugins {
2-
2+
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
33
}
44

55
allprojects {
6-
group = "org.openlayer"
6+
group = "com.openlayer.api"
77
version = "0.1.0-alpha.1" // x-release-please-version
88
}
99

10+
nexusPublishing {
11+
repositories {
12+
sonatype {
13+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
14+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
1015

16+
username.set(System.getenv("SONATYPE_USERNAME"))
17+
password.set(System.getenv("SONATYPE_PASSWORD"))
18+
}
19+
}
20+
}

buildSrc/build.gradle.kts

-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
plugins {
22
`kotlin-dsl`
3-
kotlin("jvm") version "1.9.22"
4-
id("com.vanniktech.maven.publish") version "0.28.0"
53
}
64

75
repositories {
86
gradlePluginPortal()
9-
mavenCentral()
107
}
118

129
dependencies {
1310
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
1411
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
15-
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
1612
}

buildSrc/src/main/kotlin/openlayer.java.gradle.kts

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import com.diffplug.gradle.spotless.SpotlessExtension
22
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
3-
import com.vanniktech.maven.publish.JavaLibrary
4-
import com.vanniktech.maven.publish.JavadocJar
5-
import com.vanniktech.maven.publish.MavenPublishBaseExtension
6-
import com.vanniktech.maven.publish.SonatypeHost
3+
import java.util.Locale
74

85
plugins {
96
`java-library`
@@ -14,6 +11,11 @@ repositories {
1411
mavenCentral()
1512
}
1613

14+
configure<JavaPluginExtension> {
15+
withJavadocJar()
16+
withSourcesJar()
17+
}
18+
1719
configure<SpotlessExtension> {
1820
java {
1921
importOrder()
@@ -33,6 +35,10 @@ tasks.withType<JavaCompile>().configureEach {
3335
options.release.set(8)
3436
}
3537

38+
tasks.named<Jar>("javadocJar") {
39+
setZip64(true)
40+
}
41+
3642
tasks.named<Jar>("jar") {
3743
manifest {
3844
attributes(mapOf(

buildSrc/src/main/kotlin/openlayer.kotlin.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import com.diffplug.gradle.spotless.SpotlessExtension
22
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3-
import com.vanniktech.maven.publish.*
43

54
plugins {
65
id("openlayer.java")

buildSrc/src/main/kotlin/openlayer.publish.gradle.kts

+48-35
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,65 @@ import org.gradle.api.publish.maven.MavenPublication
33
import org.gradle.kotlin.dsl.configure
44
import org.gradle.kotlin.dsl.register
55
import org.gradle.kotlin.dsl.get
6-
import com.vanniktech.maven.publish.JavaLibrary
7-
import com.vanniktech.maven.publish.JavadocJar
8-
import com.vanniktech.maven.publish.MavenPublishBaseExtension
9-
import com.vanniktech.maven.publish.SonatypeHost
106

117
plugins {
12-
id("com.vanniktech.maven.publish")
8+
`maven-publish`
9+
`signing`
1310
}
1411

15-
repositories {
16-
gradlePluginPortal()
17-
mavenCentral()
18-
}
12+
configure<PublishingExtension> {
13+
publications {
14+
register<MavenPublication>("maven") {
15+
from(components["java"])
1916

20-
extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
21-
extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
22-
extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")
17+
pom {
18+
name.set("Openlayer API")
19+
description.set("API for interacting with the Openlayer server.")
20+
url.set("https://openlayer.com/docs/api-reference/rest/overview")
2321

24-
configure<MavenPublishBaseExtension> {
25-
signAllPublications()
26-
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
22+
licenses {
23+
license {
24+
name.set("Apache-2.0")
25+
}
26+
}
2727

28-
this.coordinates(project.group.toString(), project.name, project.version.toString())
28+
developers {
29+
developer {
30+
name.set("Openlayer")
31+
email.set("[email protected]")
32+
}
33+
}
2934

30-
pom {
31-
name.set("Openlayer API")
32-
description.set("API for interacting with the Openlayer server.")
33-
url.set("https://openlayer.com/docs/api-reference/rest/overview")
35+
scm {
36+
connection.set("scm:git:git://github.com/openlayer-ai/openlayer-java.git")
37+
developerConnection.set("scm:git:git://github.com/openlayer-ai/openlayer-java.git")
38+
url.set("https://github.com/openlayer-ai/openlayer-java")
39+
}
3440

35-
licenses {
36-
license {
37-
name.set("Apache-2.0")
38-
}
39-
}
40-
41-
developers {
42-
developer {
43-
name.set("Openlayer")
44-
email.set("[email protected]")
41+
versionMapping {
42+
allVariants {
43+
fromResolutionResult()
44+
}
45+
}
4546
}
4647
}
48+
}
49+
}
4750

48-
scm {
49-
connection.set("scm:git:git://github.com/openlayer-ai/openlayer-java.git")
50-
developerConnection.set("scm:git:git://github.com/openlayer-ai/openlayer-java.git")
51-
url.set("https://github.com/openlayer-ai/openlayer-java")
52-
}
51+
signing {
52+
val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null }
53+
val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null }
54+
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null }
55+
if (signingKey != null && signingPassword != null) {
56+
useInMemoryPgpKeys(
57+
signingKeyId,
58+
signingKey,
59+
signingPassword,
60+
)
61+
sign(publishing.publications["maven"])
5362
}
5463
}
64+
65+
tasks.named("publish") {
66+
dependsOn(":closeAndReleaseSonatypeStagingRepository")
67+
}

openlayer-java-client-okhttp/src/main/kotlin/org/openlayer/client/okhttp/OkHttpClient.kt openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OkHttpClient.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
package org.openlayer.client.okhttp
1+
package com.openlayer.api.client.okhttp
22

33
import com.google.common.collect.ListMultimap
44
import com.google.common.collect.MultimapBuilder
5+
import com.openlayer.api.core.RequestOptions
6+
import com.openlayer.api.core.http.HttpClient
7+
import com.openlayer.api.core.http.HttpMethod
8+
import com.openlayer.api.core.http.HttpRequest
9+
import com.openlayer.api.core.http.HttpRequestBody
10+
import com.openlayer.api.core.http.HttpResponse
11+
import com.openlayer.api.errors.OpenlayerIoException
512
import java.io.IOException
613
import java.io.InputStream
714
import java.net.Proxy
@@ -19,13 +26,6 @@ import okhttp3.RequestBody
1926
import okhttp3.RequestBody.Companion.toRequestBody
2027
import okhttp3.Response
2128
import okio.BufferedSink
22-
import org.openlayer.core.RequestOptions
23-
import org.openlayer.core.http.HttpClient
24-
import org.openlayer.core.http.HttpMethod
25-
import org.openlayer.core.http.HttpRequest
26-
import org.openlayer.core.http.HttpRequestBody
27-
import org.openlayer.core.http.HttpResponse
28-
import org.openlayer.errors.OpenlayerIoException
2929

3030
class OkHttpClient
3131
private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :

openlayer-java-client-okhttp/src/main/kotlin/org/openlayer/client/okhttp/OpenlayerOkHttpClient.kt openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClient.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// File generated from our OpenAPI spec by Stainless.
22

3-
package org.openlayer.client.okhttp
3+
package com.openlayer.api.client.okhttp
44

55
import com.fasterxml.jackson.databind.json.JsonMapper
6+
import com.openlayer.api.client.OpenlayerClient
7+
import com.openlayer.api.client.OpenlayerClientImpl
8+
import com.openlayer.api.core.ClientOptions
69
import java.net.Proxy
710
import java.time.Clock
811
import java.time.Duration
9-
import org.openlayer.client.OpenlayerClient
10-
import org.openlayer.client.OpenlayerClientImpl
11-
import org.openlayer.core.ClientOptions
1212

1313
class OpenlayerOkHttpClient private constructor() {
1414

openlayer-java-client-okhttp/src/main/kotlin/org/openlayer/client/okhttp/OpenlayerOkHttpClientAsync.kt openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClientAsync.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// File generated from our OpenAPI spec by Stainless.
22

3-
package org.openlayer.client.okhttp
3+
package com.openlayer.api.client.okhttp
44

55
import com.fasterxml.jackson.databind.json.JsonMapper
6+
import com.openlayer.api.client.OpenlayerClientAsync
7+
import com.openlayer.api.client.OpenlayerClientAsyncImpl
8+
import com.openlayer.api.core.ClientOptions
69
import java.net.Proxy
710
import java.time.Clock
811
import java.time.Duration
9-
import org.openlayer.client.OpenlayerClientAsync
10-
import org.openlayer.client.OpenlayerClientAsyncImpl
11-
import org.openlayer.core.ClientOptions
1212

1313
class OpenlayerOkHttpClientAsync private constructor() {
1414

openlayer-java-core/src/main/kotlin/org/openlayer/client/OpenlayerClient.kt openlayer-java-core/src/main/kotlin/com/openlayer/api/client/OpenlayerClient.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

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

5-
package org.openlayer.client
5+
package com.openlayer.api.client
66

7-
import org.openlayer.models.*
8-
import org.openlayer.services.blocking.*
7+
import com.openlayer.api.models.*
8+
import com.openlayer.api.services.blocking.*
99

1010
interface OpenlayerClient {
1111

openlayer-java-core/src/main/kotlin/org/openlayer/client/OpenlayerClientAsync.kt openlayer-java-core/src/main/kotlin/com/openlayer/api/client/OpenlayerClientAsync.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

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

5-
package org.openlayer.client
5+
package com.openlayer.api.client
66

7-
import org.openlayer.models.*
8-
import org.openlayer.services.async.*
7+
import com.openlayer.api.models.*
8+
import com.openlayer.api.services.async.*
99

1010
interface OpenlayerClientAsync {
1111

openlayer-java-core/src/main/kotlin/org/openlayer/client/OpenlayerClientAsyncImpl.kt openlayer-java-core/src/main/kotlin/com/openlayer/api/client/OpenlayerClientAsyncImpl.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// File generated from our OpenAPI spec by Stainless.
22

3-
package org.openlayer.client
4-
5-
import org.openlayer.core.ClientOptions
6-
import org.openlayer.core.http.HttpResponse.Handler
7-
import org.openlayer.errors.OpenlayerError
8-
import org.openlayer.models.*
9-
import org.openlayer.services.async.*
10-
import org.openlayer.services.errorHandler
3+
package com.openlayer.api.client
4+
5+
import com.openlayer.api.core.ClientOptions
6+
import com.openlayer.api.core.http.HttpResponse.Handler
7+
import com.openlayer.api.errors.OpenlayerError
8+
import com.openlayer.api.models.*
9+
import com.openlayer.api.services.async.*
10+
import com.openlayer.api.services.errorHandler
1111

1212
class OpenlayerClientAsyncImpl
1313
constructor(

openlayer-java-core/src/main/kotlin/org/openlayer/client/OpenlayerClientImpl.kt openlayer-java-core/src/main/kotlin/com/openlayer/api/client/OpenlayerClientImpl.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// File generated from our OpenAPI spec by Stainless.
22

3-
package org.openlayer.client
4-
5-
import org.openlayer.core.ClientOptions
6-
import org.openlayer.core.http.HttpResponse.Handler
7-
import org.openlayer.errors.OpenlayerError
8-
import org.openlayer.models.*
9-
import org.openlayer.services.blocking.*
10-
import org.openlayer.services.errorHandler
3+
package com.openlayer.api.client
4+
5+
import com.openlayer.api.core.ClientOptions
6+
import com.openlayer.api.core.http.HttpResponse.Handler
7+
import com.openlayer.api.errors.OpenlayerError
8+
import com.openlayer.api.models.*
9+
import com.openlayer.api.services.blocking.*
10+
import com.openlayer.api.services.errorHandler
1111

1212
class OpenlayerClientImpl
1313
constructor(

openlayer-java-core/src/main/kotlin/org/openlayer/core/BaseDeserializer.kt openlayer-java-core/src/main/kotlin/com/openlayer/api/core/BaseDeserializer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.openlayer.core
1+
package com.openlayer.api.core
22

33
import com.fasterxml.jackson.core.JsonParser
44
import com.fasterxml.jackson.core.ObjectCodec

openlayer-java-core/src/main/kotlin/org/openlayer/core/BaseSerializer.kt openlayer-java-core/src/main/kotlin/com/openlayer/api/core/BaseSerializer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.openlayer.core
1+
package com.openlayer.api.core
22

33
import com.fasterxml.jackson.databind.ser.std.StdSerializer
44
import kotlin.reflect.KClass

0 commit comments

Comments
 (0)