From 9016cf81df5d60ea22ee4c449aa4d0960e516847 Mon Sep 17 00:00:00 2001 From: Dario Ghunney Ware Date: Tue, 8 Jul 2025 12:30:32 +0100 Subject: [PATCH] added main class for bootRun --- build.gradle | 35 +++++++++++++++++++++++++++++++---- stirling-pdf/build.gradle | 5 +++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 3dba68daa..730b7f9a0 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,8 @@ plugins { import com.github.jk1.license.render.* import org.gradle.internal.os.OperatingSystem +import org.panteleyev.jpackage.ImageType + import java.nio.file.Files import java.time.Year @@ -43,6 +45,16 @@ bootJar { enabled = false } +// Configure main class for the root project +springBoot { + mainClass = 'stirling.software.SPDF.SPDFApplication' +} + +repositories { + mavenCentral() + maven { url = 'https://build.shibboleth.net/maven/releases' } +} + allprojects { group = 'stirling.software' version = '1.0.1' @@ -53,7 +65,6 @@ allprojects { } } - tasks.register('writeVersion') { def propsFile = file("$projectDir/common/src/main/resources/version.properties") def propsDir = propsFile.parentFile @@ -200,6 +211,14 @@ openApi { waitTimeInSeconds = 60 // Increase the wait time to 60 seconds } +// Configure the forked spring boot run task to properly delegate to the stirling-pdf module +tasks.named('forkedSpringBootRun') { + dependsOn ':stirling-pdf:bootRun' + doFirst { + println "Delegating forkedSpringBootRun to :stirling-pdf:bootRun" + } +} + //0.11.5 to 2024.11.5 static def getMacVersion(String version) { def currentYear = Year.now().getValue() @@ -251,7 +270,7 @@ jpackage { winUpgradeUuid = "2a43ed0c-b8c2-40cf-89e1-751129b87641" // Unique identifier for updates winHelpUrl = "https://github.com/Stirling-Tools/Stirling-PDF" winUpdateUrl = "https://github.com/Stirling-Tools/Stirling-PDF/releases" - type = "exe" + type = ImageType.EXE installDir = "C:/Program Files/Stirling-PDF" } @@ -259,7 +278,7 @@ jpackage { mac { appVersion = getMacVersion(project.version.toString()) icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.icns") - type = "dmg" + type = ImageType.DMG macPackageIdentifier = "Stirling PDF" macPackageName = "Stirling PDF" macAppCategory = "public.app-category.productivity" @@ -281,7 +300,7 @@ jpackage { linux { appVersion = project.version icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.png") - type = "deb" // Can also use "rpm" for Red Hat-based systems + type = ImageType.DEB // Can also use "rpm" for Red Hat-based systems // Debian package configuration //linuxPackageName = "stirlingpdf" @@ -514,6 +533,14 @@ swaggerhubUpload { } dependencies { + implementation project(':stirling-pdf') + implementation project(':common') + if (System.getenv('DISABLE_ADDITIONAL_FEATURES') != 'true' + || (project.hasProperty('DISABLE_ADDITIONAL_FEATURES') + && System.getProperty('DISABLE_ADDITIONAL_FEATURES') != 'true')) { + implementation project(':proprietary') + } + testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2' } diff --git a/stirling-pdf/build.gradle b/stirling-pdf/build.gradle index 7014d25fe..0974a0577 100644 --- a/stirling-pdf/build.gradle +++ b/stirling-pdf/build.gradle @@ -146,5 +146,10 @@ bootJar { } } +// Configure main class for Spring Boot +springBoot { + mainClass = 'stirling.software.SPDF.SPDFApplication' +} + bootJar.dependsOn ':common:jar' bootJar.dependsOn ':proprietary:jar'