Skip to content
Open
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

### 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+.

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

version = '1.1.0'
version = '1.2.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'
}
}

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

apply plugin: 'org.junit.platform.gradle.plugin'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}

base {
archivesName = 'nuclio-sdk'
}

test {
useJUnitPlatform()
}

task sourceJar(type: Jar) {
classifier "sources"
archiveClassifier.set("sources")
from sourceSets.main.allJava
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
archiveClassifier.set("javadoc")
from javadoc.destinationDir
}

Expand All @@ -51,15 +54,20 @@ artifacts {
}

signing {
sign configurations.archives
// Check if signing properties are available and sign the archives
if (project.hasProperty('signing.keyId') && project.hasProperty('signing.secretKeyRingFile') && project.hasProperty('signing.password')) {
useGpgCmd() // Use the GPG command line tool to sign artifacts
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,11 +78,10 @@ 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 {
Expand Down Expand Up @@ -103,7 +110,7 @@ publishing {
}
}

// create the sign pom artifact
// Create the signed pom artifact
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
Expand All @@ -113,16 +120,14 @@ publishing {
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
// Create the signed artifacts for sources and javadoc
tasks.withType(Sign).configureEach {
if (it.name == "signArchives") {
it.doLast {
project.tasks.withType(Jar).matching { it.name.contains("sources") || it.name.contains("javadoc") }.each { jarTask ->
signing.sign(jarTask)
}
}
extension = 'jar.asc'
}
}
}
Expand All @@ -133,12 +138,12 @@ def customizePom(pom) {
pom.withXml {
def root = asNode()

// eliminate test-scoped dependencies (no need in maven central POMs)
// Eliminate test-scoped dependencies (no need in Maven Central POMs)
root.dependencies.removeAll { dep ->
dep.scope == "test"
}

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

Expand Down
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