SaaS Consolidation (#6384)

Co-authored-by: ConnorYoh <[email protected]>
This commit is contained in:
Anthony Stirling
2026-05-21 16:05:35 +01:00
committed by GitHub
co-authored by ConnorYoh
parent 089de247b4
commit 9d081d1792
208 changed files with 14064 additions and 242 deletions
+66
View File
@@ -25,8 +25,74 @@ plugins {
rootProject.name = 'Stirling PDF'
// Flavors: core | proprietary (default) | saas.
// Selectable via STIRLING_FLAVOR or by setting DISABLE_ADDITIONAL_FEATURES/ENABLE_SAAS directly.
// Accepts env var, -D system property, or -P gradle property (camelCase alias too).
def lookupEnvOrProperty = { String name ->
def value = System.getenv(name)
if (value == null || value.isEmpty()) {
value = System.getProperty(name)
}
if (value == null || value.isEmpty()) {
def projectProps = settings.startParameter.projectProperties
value = projectProps.get(name)
if (value == null || value.isEmpty()) {
def camel = name.toLowerCase().split('_').inject('') { acc, part ->
acc.isEmpty() ? part : acc + part.capitalize()
}
value = projectProps.get(camel)
}
}
return value
}
def asBool = { String value -> 'true'.equalsIgnoreCase(value) }
def stirlingFlavor = lookupEnvOrProperty('STIRLING_FLAVOR')?.toLowerCase()
boolean disableAdditional
boolean enableSaas
if (stirlingFlavor != null && !stirlingFlavor.isEmpty()) {
switch (stirlingFlavor) {
case 'core':
disableAdditional = true
enableSaas = false
break
case 'proprietary':
disableAdditional = false
enableSaas = false
break
case 'saas':
disableAdditional = false
enableSaas = true
break
default:
throw new GradleException(
"Unknown STIRLING_FLAVOR='${stirlingFlavor}'. Expected one of: core, proprietary, saas.")
}
} else {
disableAdditional = asBool(lookupEnvOrProperty('DISABLE_ADDITIONAL_FEATURES'))
enableSaas = asBool(lookupEnvOrProperty('ENABLE_SAAS'))
}
if (enableSaas && disableAdditional) {
throw new GradleException(
"ENABLE_SAAS=true requires DISABLE_ADDITIONAL_FEATURES=false " +
"(SaaS builds on top of :proprietary and cannot stand alone).")
}
gradle.ext.disableAdditional = disableAdditional
gradle.ext.enableSaas = enableSaas
include 'stirling-pdf', 'common', 'proprietary'
project(':stirling-pdf').projectDir = file('app/core')
project(':common' ).projectDir = file('app/common')
project(':proprietary' ).projectDir = file('app/proprietary')
if (enableSaas) {
include 'saas'
project(':saas').projectDir = file('app/saas')
}