Skip to content
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
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Test

on:
push:
branches: [master]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "25"
- run: ./gradlew build --no-daemon
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Java SDK for [nuclio][nuclio].
This SDK is for building nuclio Java handlers.

### Adding as a dependency
See https://search.maven.org/artifact/io.nuclio/nuclio-sdk-java/1.1.0/jar
See https://search.maven.org/artifact/io.nuclio/nuclio-sdk-java/1.2.0/jar
Comment thread
rokatyy marked this conversation as resolved.
Resolved

### Building a Handler

Expand Down Expand Up @@ -39,16 +39,18 @@ You can specify dependencies using (inline in Java file or Jar) build configurat
```


The default image is using OpenJDK 9
The default image uses Eclipse Temurin (OpenJDK) 25. The Java runtime is not
supported on 32-bit ARM (armhf) — no upstream Temurin 25 build exists for that
architecture.

If you have dependencies in other packages, create a fat/uber Jar with all the
dependencies. We currently do not support maven/sbt/ant/... builds

### Building the SDK

gradle jar

Please use Java 8 to build the SDK jar for release
./gradlew jar

The SDK jar is compiled for Java 25 bytecode. Build it with JDK 25+.
Comment thread
rokatyy marked this conversation as resolved.
Resolved

[nuclio]: http://nuclio.io/
[nuctl]: https://nuclio.io/docs/latest/reference/nuctl/nuctl_build/
198 changes: 57 additions & 141 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,34 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

version = '1.1.0'

def sonatypeUsernameWithFallback = project.ext.properties.sonatypeUsername
def sonatypePasswordWithFallback = project.ext.properties.sonatypePassword

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
}
plugins {
id 'java'
id 'com.vanniktech.maven.publish' version '0.37.0'
}

apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'

apply plugin: 'org.junit.platform.gradle.plugin'
version = '1.2.0'

task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc.destinationDir
base {
archivesName = 'nuclio-sdk'
}

artifacts {
archives jar
archives sourceJar
archives javadocJar
test {
useJUnitPlatform()
}

signing {
sign configurations.archives
}

dependencies {
testCompile(
'org.junit.jupiter:junit-jupiter-api:5.0.1'
testImplementation(
'org.junit.jupiter:junit-jupiter-api:5.8.2'
)
testRuntime(
'org.junit.jupiter:junit-jupiter-engine:5.0.1',
testRuntimeOnly(
'org.junit.jupiter:junit-jupiter-engine:5.8.2',
'org.junit.platform:junit-platform-launcher',
)
}

Expand All @@ -70,121 +52,55 @@ repositories {
jar {
manifest {
attributes 'Implementation-Title': 'nuclio-sdk',
'Implementation-Version': version,
'Implementation-Vendor': 'io.nuclio'
'Implementation-Version': version,
'Implementation-Vendor': 'io.nuclio'
}
version = version
baseName = 'nuclio-sdk'
}

publishing {
publications {
mavenJava(MavenPublication) {
customizePom(pom)
groupId 'io.nuclio'
artifactId 'nuclio-sdk-java'
version version

from components.java

artifact(sourceJar) {
classifier = 'sources'
}
artifact(javadocJar) {
classifier = 'javadoc'
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username sonatypeUsernameWithFallback
password sonatypePasswordWithFallback
}
}
}

// create the sign pom artifact
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}
// create the signed artifacts
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
// Publishes to Maven Central via the Central Portal. Sources and javadoc jars
// are added automatically, and every artifact (including the POM) is signed.
// Credentials come from the mavenCentralUsername / mavenCentralPassword Gradle
// properties; signing uses the standard signing.* properties or
// signingInMemoryKey / signingInMemoryKeyPassword.
mavenPublishing {
publishToMavenCentral()
signAllPublications()

coordinates('io.nuclio', 'nuclio-sdk-java', version.toString())

pom {
name = 'Nuclio Java SDK'
description = 'Nuclio Java SDK'
url = 'https://github.com/nuclio/nuclio-sdk-java'
organization {
name = 'io.nuclio'
url = 'https://github.com/nuclio'
}
}
}

def customizePom(pom) {
pom.withXml {
def root = asNode()

// eliminate test-scoped dependencies (no need in maven central POMs)
root.dependencies.removeAll { dep ->
dep.scope == "test"
issueManagement {
system = 'GitHub'
url = 'https://github.com/nuclio/nuclio-sdk-java'
}

// add all items necessary for maven central publication
root.children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST

description 'Nuclio Java SDK'
name 'Nuclio Java SDK'
url 'https://github.com/nuclio/nuclio-sdk-java'
organization {
name 'io.nuclio'
url 'https://github.com/nuclio'
}
issueManagement {
system 'GitHub'
url 'https://github.com/nuclio/nuclio-sdk-java'
}
licenses {
license {
name 'Apache License 2.0'
url 'https://github.com/nuclio/nuclio-sdk-java/blob/master/LICENSE'
distribution 'repo'
}
licenses {
license {
name = 'Apache License 2.0'
url = 'https://github.com/nuclio/nuclio-sdk-java/blob/master/LICENSE'
distribution = 'repo'
}
scm {
url 'https://github.com/nuclio/nuclio-sdk-java'
connection 'scm:git:git://github.com/nuclio/nuclio-sdk-java.git'
developerConnection 'scm:git:git@github.com:nuclio/nuclio-sdk-java.git'
}
developers {
developer {
name 'Miki Tebeka'
}
developer {
name 'Gal Topper'
}
}
scm {
url = 'https://github.com/nuclio/nuclio-sdk-java'
connection = 'scm:git:git://github.com/nuclio/nuclio-sdk-java.git'
developerConnection = 'scm:git:git@github.com:nuclio/nuclio-sdk-java.git'
}
developers {
developer {
name = 'Gal Topper'
}
}
}
}

model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
tasks.publishMavenJavaPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToMavenRepository {
dependsOn project.tasks.signArchives
}
// Signing is mandatory for Maven Central, optional for local publishes.
signing {
setRequired { gradle.taskGraph.allTasks.any { it.name.contains('MavenCentral') } }
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading