Skip to content

Commit

Permalink
Use Conveyor to package an update the desktop version (#7)
Browse files Browse the repository at this point in the history
* Conveyor experiments
* Conveyor changes, module fixes
  • Loading branch information
martinpaljak committed Oct 26, 2023
1 parent 30155cd commit 9544630
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/robot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
distribution: zulu
cache: 'gradle'
- name: Package
run: date +%y%m%d > version.txt && ./gradlew --no-daemon jar
run: date +%y.%m.%d.${{github.run_number}} > version.txt && ./gradlew --no-daemon shadowJar
- uses: actions/upload-artifact@v3
with:
name: jar
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
conveyor:
./gradlew clean shadowJar
conveyor make site --overwrite
34 changes: 17 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
plugins {
id 'application'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.openjfx.javafxplugin' version '0.0.14'
id 'com.palantir.git-version' version '3.0.0' // for gitVersion()
id 'dev.hydraulic.conveyor' version '1.6'
id 'org.beryx.jlink' version '2.25.0'
// id 'com.gluonhq.client-gradle-plugin' version '0.1.42'
// id 'com.gluonhq.gluonfx-gradle-plugin' version '1.0.16'
}
// Cheap enforcer
assert JavaVersion.current().equals(JavaVersion.VERSION_17)

group 'pro.javacard.nfc4pc'
version = file('version.txt').text.trim()
Expand All @@ -21,6 +23,12 @@ repositories {
mavenCentral()
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

compileJava {
sourceCompatibility = '17'
targetCompatibility = '17'
Expand All @@ -32,17 +40,6 @@ javafx {
//configuration = 'compileOnly'
}

jlink {
launcher {
name = 'nfc4pc'
}
}

//gluonClient {
// reflectionList = ["pro.javacard.nfc4pc.MainWrapper"]
//}


application {
mainModule = "pro.javacard.nfc4pc"
mainClass = "pro.javacard.nfc4pc.MainWrapper"
Expand All @@ -53,12 +50,15 @@ jar {
attributes 'Main-Class': application.mainClass
attributes 'Implementation-Version': gitVersion()
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
// from {
// configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
// }
// duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

shadowJar {
archiveClassifier.set('')
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
Expand Down
75 changes: 75 additions & 0 deletions conveyor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// This is a hashbang include. You can run the command after the #! to see what
// configuration is being extracted from the Gradle build using the Conveyor plugin.
include "#!./gradlew -q printConveyorConfig"

// Config file documentation: https://conveyor.hydraulic.dev/latest/configs
app {
display-name = "NFC4PC"
rdns-name = "pro.javacard.nfc4pc"
vcs-url = "https://github.com/martinpaljak/NFC4PC"
// Windows gets square icons, macOS and Linux icons with rounded corners.
icons = {
label = "NFC"
}
license = "LGPL-3.0-only"
contact-email = "[email protected]"

// Ensure the icons are also included as data files so we can set the window icon.
// See the method HelloApplication.loadIconsFromStage()

windows.inputs += TASK/rendered-icons/windows
linux.inputs += TASK/rendered-icons/linux

// Check for and apply updates synchronously on every app launch instead of in the background.
// Consider removing this line for your own app!
updates = aggressive

// For iteration speed. Remove for release.
compression-level = low

machines = ["mac"]
}

app.site {
display-name = "Download NFC4PC"

# Where the installed packages can check for online updates.
base-url = "localhost:3000"

# Import an HTML template or additional files to the generated site.
#inputs += "my-template-dir/*" -> .

# Change the set of images used for the logo, as found in the resolved inputs.
#icons = "my-icons-*.png"

# Which keys appear in the metadata.properties file in the generated site.
export-keys = [ app.version, app.revision ]

# HTML to add into the <head> area.
extra-header-html = """
<script>
// etc
</script>
"""

# Directory to upload/copy the site to over SFTP.
copy-to = "[email protected]:public_html/nfc4pc/"

# Whether to show the "Packaged by Conveyor" badge at the bottom of the download page.
# Can only be disabled for commercial products.
# Open source projects are required to advertise the fact that they're packaged with Conveyor.
show-conveyor-badge = true
}

app.jvm {
constant-app-arguments = "--desktop"
#modules += "java.{desktop,logging,net.http}"
}

app.mac {
info-plist {
LSUIElement = 1
}
}

conveyor.compatibility-level = 11
2 changes: 1 addition & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module pro.javacard.nfc4pc {
requires javafx.controls;
requires javafx.graphics;
requires javafx.swingEmpty;
requires javafx.swing;
requires apdu4j.pcsc;
requires apdu4j.core;
requires java.desktop;
Expand Down
5 changes: 4 additions & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
next
23.07.25.3



0 comments on commit 9544630

Please sign in to comment.