added main class for bootRun

This commit is contained in:
Dario Ghunney Ware 2025-07-08 12:30:32 +01:00
parent 05c10d3a9f
commit 9016cf81df
2 changed files with 36 additions and 4 deletions

View File

@ -15,6 +15,8 @@ plugins {
import com.github.jk1.license.render.* import com.github.jk1.license.render.*
import org.gradle.internal.os.OperatingSystem import org.gradle.internal.os.OperatingSystem
import org.panteleyev.jpackage.ImageType
import java.nio.file.Files import java.nio.file.Files
import java.time.Year import java.time.Year
@ -43,6 +45,16 @@ bootJar {
enabled = false 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 { allprojects {
group = 'stirling.software' group = 'stirling.software'
version = '1.0.1' version = '1.0.1'
@ -53,7 +65,6 @@ allprojects {
} }
} }
tasks.register('writeVersion') { tasks.register('writeVersion') {
def propsFile = file("$projectDir/common/src/main/resources/version.properties") def propsFile = file("$projectDir/common/src/main/resources/version.properties")
def propsDir = propsFile.parentFile def propsDir = propsFile.parentFile
@ -200,6 +211,14 @@ openApi {
waitTimeInSeconds = 60 // Increase the wait time to 60 seconds 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 //0.11.5 to 2024.11.5
static def getMacVersion(String version) { static def getMacVersion(String version) {
def currentYear = Year.now().getValue() def currentYear = Year.now().getValue()
@ -251,7 +270,7 @@ jpackage {
winUpgradeUuid = "2a43ed0c-b8c2-40cf-89e1-751129b87641" // Unique identifier for updates winUpgradeUuid = "2a43ed0c-b8c2-40cf-89e1-751129b87641" // Unique identifier for updates
winHelpUrl = "https://github.com/Stirling-Tools/Stirling-PDF" winHelpUrl = "https://github.com/Stirling-Tools/Stirling-PDF"
winUpdateUrl = "https://github.com/Stirling-Tools/Stirling-PDF/releases" winUpdateUrl = "https://github.com/Stirling-Tools/Stirling-PDF/releases"
type = "exe" type = ImageType.EXE
installDir = "C:/Program Files/Stirling-PDF" installDir = "C:/Program Files/Stirling-PDF"
} }
@ -259,7 +278,7 @@ jpackage {
mac { mac {
appVersion = getMacVersion(project.version.toString()) appVersion = getMacVersion(project.version.toString())
icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.icns") icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.icns")
type = "dmg" type = ImageType.DMG
macPackageIdentifier = "Stirling PDF" macPackageIdentifier = "Stirling PDF"
macPackageName = "Stirling PDF" macPackageName = "Stirling PDF"
macAppCategory = "public.app-category.productivity" macAppCategory = "public.app-category.productivity"
@ -281,7 +300,7 @@ jpackage {
linux { linux {
appVersion = project.version appVersion = project.version
icon = layout.projectDirectory.file("stirling-pdf/src/main/resources/static/favicon.png") 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 // Debian package configuration
//linuxPackageName = "stirlingpdf" //linuxPackageName = "stirlingpdf"
@ -514,6 +533,14 @@ swaggerhubUpload {
} }
dependencies { 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' testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2' testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2'
} }

View File

@ -146,5 +146,10 @@ bootJar {
} }
} }
// Configure main class for Spring Boot
springBoot {
mainClass = 'stirling.software.SPDF.SPDFApplication'
}
bootJar.dependsOn ':common:jar' bootJar.dependsOn ':common:jar'
bootJar.dependsOn ':proprietary:jar' bootJar.dependsOn ':proprietary:jar'