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
5 changes: 5 additions & 0 deletions .changeset/nine-plums-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"java-sdk": patch
---

Update build to support jitpack build environment
14 changes: 13 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@ jobs:
name: Java ${{ matrix.java }}
strategy:
matrix:
java: [ '11', '17', '21', '25' ]
java: ['11', '17', '21', '25']

steps:
- uses: actions/checkout@v4
# Gradle will detect the JVM installation from the ubuntu-latest image and use it
# includes execution of unit tests
- run: ./gradlew build -PjavaVersion=${{ matrix.java }} --stacktrace

jitpack-build:
runs-on: ubuntu-latest
name: Jitpack build smoke test
steps:
- uses: actions/checkout@v4
- run: ./gradlew clean build -PjavaVersion=11 --stacktrace
env:
JITPACK: 'TRUE'
- run: ./gradlew sdk:publishToMavenLocal --stacktrace
env:
JITPACK: 'TRUE'
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ tasks.register("downloadGoogleJavaFormat") {
val downloadUrl = "https://github.com/google/google-java-format/releases/download/v$googleJavaFormatVersion/google-java-format_${osSuffix}-${archSuffix}${binarySuffix}"
outputs.file(googleJavaFormatExeFile)

onlyIf {
System.getenv("JITPACK") != "TRUE"
}

doLast {
val file = googleJavaFormatExeFile.get().asFile
if (!file.exists()) {
Expand All @@ -62,6 +66,10 @@ fun Project.registerFormatTasks() {
tasks.register("format") {
dependsOn(rootProject.tasks.named("downloadGoogleJavaFormat"))

onlyIf {
System.getenv("JITPACK") != "TRUE"
}

doLast {
// First, fix the imports
exec {
Expand Down
20 changes: 20 additions & 0 deletions sdk/sdk.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ openApiGenerate {
}

tasks.register("removeDocs") {
onlyIf {
System.getenv("JITPACK") != "TRUE"
}

doLast {
fileTree("$rootDir/docs").files
.filter { it.isFile && it.name != "DecryptionKey.md" && it.name != "Sealed.md" }
Expand All @@ -94,18 +98,30 @@ tasks.register("removeDocs") {
}

tasks.register("removeClasses") {
onlyIf {
System.getenv("JITPACK") != "TRUE"
}

doLast {
File("$rootDir/sdk/src/main/java/com/fingerprint/v4/model").deleteRecursively()
File("$rootDir/sdk/src/main/java/com/fingerprint/v4/api").deleteRecursively()
}
}

tasks.register<Copy>("copyOpenApiGeneratorIgnore") {
onlyIf {
System.getenv("JITPACK") != "TRUE"
}

from("$rootDir/.openapi-generator-ignore")
into(layout.buildDirectory.dir("generated"))
}

tasks.register("copyGeneratedArtifacts") {
onlyIf {
System.getenv("JITPACK") != "TRUE"
}

finalizedBy("format")
doLast {
copy {
Expand All @@ -126,6 +142,10 @@ tasks.register("copyGeneratedArtifacts") {
}

tasks.openApiGenerate {
onlyIf {
System.getenv("JITPACK") != "TRUE"
}

dependsOn("removeDocs", "removeClasses", "copyOpenApiGeneratorIgnore")
finalizedBy("copyGeneratedArtifacts")
}
Expand Down
Loading