Skip to content

Commit

Permalink
Package restructure and initial impl of conveyor (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-griffith authored May 1, 2023
1 parent bf963b2 commit 52fbf01
Show file tree
Hide file tree
Showing 81 changed files with 376 additions and 483 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/delete-package-versions@v4
with:
package-version-ids: ${{ env.project_version }}
package-name: 'io.github.paulgriffith.kindling'
package-name: 'io.github.inductiveautomation.kindling'
package-type: 'maven'
continue-on-error: true
- name: Publish to Github Packages
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
.idea/

**build/
jdeploy/
jdeploy-bundle/

output/
31 changes: 31 additions & 0 deletions NOTICES
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
NOTICES

This repository incorporates material as listed below or described in the code.

### Build Dependencies
- Java - GPL license 2.0
- Kotlin - Apache License 2.0 - https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt
- Kotlin Coroutines - Apache License 2.0 - https://github.com/Kotlin/kotlinx.coroutines/blob/master/LICENSE.txt
- Kotlin Serialization - Apache License 2.0 - https://github.com/Kotlin/kotlinx.serialization/blob/master/LICENSE.txt
- Gradle - Apache License 2.0 - https://docs.gradle.org/current/userguide/licenses.html
- Ktlint Gradle Plugin - MIT License - https://github.com/JLLeitschuh/ktlint-gradle/blob/master/LICENSE.txt
- Ktlint - MIT License - https://github.com/pinterest/ktlint/blob/master/LICENSE

### Core Dependencies
- FlatLaf - Apache License 2.0 - https://github.com/JFormDesigner/FlatLaf/blob/main/LICENSE
- SQLite - Public Domain - https://www.sqlite.org/copyright.html
- Xerial JDBC Driver - Apache License 2.0 - https://github.com/xerial/sqlite-jdbc/blob/master/LICENSE
- Logback - Eclipse Public License 1.0 - https://logback.qos.ch/license.html
- HyperSQL - Modified BSD License - https://hsqldb.org/web/hsqlLicense.html
- ExcelKt - MIT License - https://github.com/evanrupert/ExcelKt/blob/master/LICENSE
- MigLayout - BSD License - http://miglayout.com/
- SvgSalamander - BSD License - https://github.com/JFormDesigner/svgSalamander/blob/master/licenses/license-BSD.txt
- Jide Common Layer - GPL with classpath exception - http://www.jidesoft.com/products/oss.htm
- JSystemThemeDetector - Apache License 2.0 - https://github.com/Dansoftowner/jSystemThemeDetector/blob/master/LICENSE
- RSyntaxTextArea - BSD 3-Clause - https://github.com/bobbylight/RSyntaxTextArea/blob/master/LICENSE.md

### Test Dependencies
- Kotest - Apache License 2.0 - https://github.com/kotest/kotest/blob/master/LICENSE

### Assets
- BoxIcons - MIT License - https://boxicons.com/usage#license
108 changes: 3 additions & 105 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import org.gradle.internal.os.OperatingSystem
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.CHECKSTYLE
import java.time.LocalDate

plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.serialization)
alias(libs.plugins.ktlint)
alias(libs.plugins.conveyor)
application
alias(libs.plugins.shadow)
alias(libs.plugins.runtime)
`maven-publish`
}

apply {
Expand Down Expand Up @@ -58,39 +54,16 @@ dependencies {
testImplementation(libs.bundles.kotest)
}

group = "io.github.paulgriffith"
group = "io.github.inductiveautomation"

application {
mainClass.set("io.github.paulgriffith.kindling.MainPanel")
mainClass.set("io.github.inductiveautomation.kindling.MainPanel")
}

tasks {
test {
useJUnitPlatform()
}

val cleanupJDeploy by registering(Delete::class) {
delete("jdeploy", "jdeploy-bundle")
}
clean {
finalizedBy(cleanupJDeploy)
}

shadowJar {
manifest {
attributes["Main-Class"] = "io.github.paulgriffith.kindling.MainPanel"
}
archiveBaseName.set("kindling-bundle")
archiveClassifier.set("")
archiveVersion.set("")
mergeServiceFiles()
}

register("printVersion") {
doLast { // add a task action
println(project.version)
}
}
}

kotlin {
Expand All @@ -102,78 +75,3 @@ ktlint {
reporter(CHECKSTYLE)
}
}

runtime {
options.set(listOf("--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages"))

modules.set(
listOf(
"java.desktop",
"java.sql",
"java.logging",
"java.naming",
"java.xml",
"jdk.zipfs",
),
)

jpackage {
val currentOs = OperatingSystem.current()
val imgType = if (currentOs.isWindows) "ico" else "png"
appVersion = project.version.toString()
imageOptions = listOf("--icon", "src/main/resources/icons/ignition.$imgType")
val options: Map<String, String?> = buildMap {
put("resource-dir", "src/main/resources")
put("vendor", "Paul Griffith")
put("copyright", LocalDate.now().year.toString())
put("description", "A collection of useful tools for troubleshooting Ignition")

when {
currentOs.isWindows -> {
put("win-per-user-install", null)
put("win-dir-chooser", null)
put("win-menu", null)
put("win-shortcut", null)
// random (consistent) UUID makes upgrades smoother
put("win-upgrade-uuid", "8e7428c8-bbc6-460a-9995-db6d8b04a690")
}

currentOs.isLinux -> {
put("linux-shortcut", null)
}
}
}

// add-exports is used to bypass Java modular restrictions
jvmArgs = listOf("--add-exports", "java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED")

installerOptions = options.flatMap { (key, value) ->
listOfNotNull("--$key", value)
}

imageName = "kindling"
installerName = "kindling"
mainJar = "kindling-bundle.jar"
}
}

configure<PublishingExtension> {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/paul-griffith/kindling")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
register<MavenPublication>("gpr") {
from(components["kotlin"])
pom {
description.set("Kindling core API and first-party tools, packaged for ease of extension by third parties.")
}
}
}
}
6 changes: 6 additions & 0 deletions buildSrc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:latest

RUN wget https://downloads.hydraulic.dev/conveyor/hydraulic-conveyor_8.1_amd64.deb \
&& apt install ./hydraulic-conveyor_8.1_amd64.deb

ENTRYPOINT /bin/sh
14 changes: 14 additions & 0 deletions ci.conveyor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include required("conveyor.conf")

app {
signing-key = ${env.SIGNING_KEY}

mac.certificate = apple.cer
windows.certificate = windows.cer

mac.notarization {
app-specific-password = ${env.APPLE_ASP}
team-id = TODO
apple-id = "TODO"
}
}
35 changes: 35 additions & 0 deletions conveyor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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"

include required("https://raw.githubusercontent.com/hydraulic-software/conveyor/master/configs/jvm/extract-native-libraries.conf")

app {
version = "1.0.0"
// The base URL is where the download site will be placed. Packages will check here for updates.
site.base-url = "localhost:3000"

// This is optional. If not specified the last component of the rdns name will be turned into a display name.
display-name = "Kindling"

// A global identifier for the app.
rdns-name = "io.github.inductiveautomation.kindling"

jvm {
modules += java.desktop
modules += java.sql
modules += java.logging
modules += java.naming
modules += java.xml
modules += jdk.zipfs

options += "--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED"
options += "--add-exports=java.base/sun.security.action=ALL-UNNAMED"
options += "--add-exports=java.desktop/apple.laf=ALL-UNNAMED"
options += "--add-reads=com.formdev.flatlaf.extras=ALL-UNNAMED"
}

// icons = "icons/icon.svg"
}

conveyor.compatibility-level = 8
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=0.6.2-SNAPSHOT
version=1.0.0-SNAPSHOT
org.gradle.jvmargs=-Xmx2G
7 changes: 3 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
[versions]
java = "17"
kotlin = "1.8.21"
coroutines = "1.6.4"
coroutines = "1.7.0-RC"
flatlaf = "3.1.1"
kotest = "5.6.1"
ignition = "8.1.1"

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
conveyor = { id = "dev.hydraulic.conveyor", version = "1.5" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "11.3.2" }
shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" }
runtime = { id = "org.beryx.runtime", version = "1.13.0" }

[libraries]
# core functionality
Expand All @@ -35,7 +34,7 @@ flatlaf-jide = { group = "com.formdev", name = "flatlaf-jide-oss", version.ref =
flatlaf-swingx = { group = "com.formdev", name = "flatlaf-swingx", version.ref = "flatlaf" }
svgSalamander = { group = "com.formdev", name = "svgSalamander", version = "1.1.4" }
jide-common = { group = "com.formdev", name = "jide-oss", version = "3.7.12" }
swingx = { group = "org.swinglabs.swingx", name = "swingx-core", version = "1.6.5-1" }
swingx = { group = "org.swinglabs.swingx", name = "swingx-all", version = "1.6.5-1" }
osthemedetector = { group = "com.github.Dansoftowner", name = "jSystemThemeDetector", version = "3.8" }
rsyntaxtextarea = { group = "com.fifesoft", name = "rsyntaxtextarea", version = "3.3.3" }
jfreechart = { group = "org.jfree", name = "jfreechart", version = "1.5.4" }
Expand Down
Loading

0 comments on commit 52fbf01

Please sign in to comment.