From 2229f38602defecbeed1c0bdcbd26d9c7a624c03 Mon Sep 17 00:00:00 2001 From: Dario Ghunney Ware Date: Fri, 17 Jan 2025 12:25:02 +0000 Subject: [PATCH] #2418 updating jpackage config (#2713) # Description Updating the `jpackage` configuration in our build.gradle and CI to enable installation of the app on multiple OSs Closes #2418 ## Checklist - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have performed a self-review of my own code - [x] I have attached images of the change if it is UI based - [x] I have commented my code, particularly in hard-to-understand areas - [x] If my code has heavily changed functionality I have updated relevant docs on [Stirling-PDFs doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) - [x] My changes generate no new warnings - [x] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) --- .github/workflows/multiOSReleases.yml | 9 +++++---- .gitignore | 1 + build.gradle | 20 ++++++------------- .../software/SPDF/EE/EEAppConfig.java | 2 +- .../security/database/DatabaseConfig.java | 6 +++++- .../controller/web/GeneralWebController.java | 5 ++++- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/multiOSReleases.yml b/.github/workflows/multiOSReleases.yml index a0839047..324b1c8e 100644 --- a/.github/workflows/multiOSReleases.yml +++ b/.github/workflows/multiOSReleases.yml @@ -130,8 +130,8 @@ jobs: include: - os: windows-latest platform: win- - # - os: macos-latest - # platform: mac- + - os: macos-latest + platform: mac- # - os: ubuntu-latest # platform: linux- runs-on: ${{ matrix.os }} @@ -168,6 +168,7 @@ jobs: env: DOCKER_ENABLE_SECURITY: false STIRLING_PDF_DESKTOP_UI: true + BROWSER_OPEN: true # Rename and collect artifacts based on OS - name: Prepare artifacts @@ -202,8 +203,8 @@ jobs: include: - os: windows-latest platform: win- - # - os: macos-latest - # platform: mac- + - os: macos-latest + platform: mac- # - os: ubuntu-latest # platform: linux- runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index ba6fd4d9..7a4101e9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ pipeline/finishedFolders/ customFiles/ configs/ watchedFolders/ +clientWebUI/ !cucumber/ !cucumber/exampleFiles/ !cucumber/exampleFiles/example_html.zip diff --git a/build.gradle b/build.gradle index 6ee40e95..de253f39 100644 --- a/build.gradle +++ b/build.gradle @@ -111,18 +111,15 @@ def getMacVersion(String version) { jpackage { input = "build/libs" - + destination = "${projectDir}/build/jpackage" + mainJar = "Stirling-PDF-${project.version}.jar" appName = "Stirling-PDF" appVersion = project.version vendor = "Stirling-Software" - appDescription = "Stirling PDF - Your Local PDF Editor" - - mainJar = "Stirling-PDF-${project.version}.jar" - mainClass = "org.springframework.boot.loader.launch.JarLauncher" - + appDescription = "Stirling PDF - Your Local PDF Editor" icon = "src/main/resources/static/favicon.ico" - - + verbose = true +// mainClass = "org.springframework.boot.loader.launch.JarLauncher" // JVM Options javaOptions = [ @@ -136,14 +133,9 @@ jpackage { "--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED", "--add-opens=java.desktop/sun.awt.windows=ALL-UNNAMED", "--add-opens=java.desktop/sun.lwawt=ALL-UNNAMED", - "--add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED" + "--add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED", ] - - verbose = true - - destination = "${projectDir}/build/jpackage" - // Windows-specific configuration windows { launcherAsService = false diff --git a/src/main/java/stirling/software/SPDF/EE/EEAppConfig.java b/src/main/java/stirling/software/SPDF/EE/EEAppConfig.java index ab504b90..4648c033 100644 --- a/src/main/java/stirling/software/SPDF/EE/EEAppConfig.java +++ b/src/main/java/stirling/software/SPDF/EE/EEAppConfig.java @@ -25,7 +25,7 @@ public class EEAppConfig { @Bean(name = "runningEE") public boolean runningEnterpriseEdition() { - return licenseKeyChecker.getEnterpriseEnabledResult(); + return licenseKeyChecker.getEnterpriseEnabledResult(); } @Bean(name = "SSOAutoLogin") diff --git a/src/main/java/stirling/software/SPDF/config/security/database/DatabaseConfig.java b/src/main/java/stirling/software/SPDF/config/security/database/DatabaseConfig.java index 262ef994..32856d0e 100644 --- a/src/main/java/stirling/software/SPDF/config/security/database/DatabaseConfig.java +++ b/src/main/java/stirling/software/SPDF/config/security/database/DatabaseConfig.java @@ -33,7 +33,11 @@ public class DatabaseConfig { public DatabaseConfig( ApplicationProperties applicationProperties, @Qualifier("runningEE") boolean runningEE) { - DATASOURCE_DEFAULT_URL = "jdbc:h2:file:" + InstallationPathConfig.getConfigPath() + File.separator + "stirling-pdf-DB-2.3.232;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"; + DATASOURCE_DEFAULT_URL = + "jdbc:h2:file:" + + InstallationPathConfig.getConfigPath() + + File.separator + + "stirling-pdf-DB-2.3.232;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"; this.applicationProperties = applicationProperties; this.runningEE = runningEE; } diff --git a/src/main/java/stirling/software/SPDF/controller/web/GeneralWebController.java b/src/main/java/stirling/software/SPDF/controller/web/GeneralWebController.java index 97d7517a..5bfb11b3 100644 --- a/src/main/java/stirling/software/SPDF/controller/web/GeneralWebController.java +++ b/src/main/java/stirling/software/SPDF/controller/web/GeneralWebController.java @@ -55,7 +55,10 @@ public class GeneralWebController { List pipelineConfigs = new ArrayList<>(); List> pipelineConfigsWithNames = new ArrayList<>(); if (new File(InstallationPathConfig.getPipelineDefaultWebUIConfigsDir()).exists()) { - try (Stream paths = Files.walk(Paths.get(InstallationPathConfig.getPipelineDefaultWebUIConfigsDir()))) { + try (Stream paths = + Files.walk( + Paths.get( + InstallationPathConfig.getPipelineDefaultWebUIConfigsDir()))) { List jsonFiles = paths.filter(Files::isRegularFile) .filter(p -> p.toString().endsWith(".json"))