mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
build: Add Sync app version to AUR PKGBUILD files (#6222)
This commit is contained in:
+17
-1
@@ -89,10 +89,12 @@ def appVersionStr = project.version.toString()
|
||||
def tauriConfigPath = layout.projectDirectory.file('frontend/src-tauri/tauri.conf.json').asFile.path
|
||||
def sim1Path = layout.projectDirectory.file('frontend/src/core/testing/serverExperienceSimulations.ts').asFile.path
|
||||
def sim2Path = layout.projectDirectory.file('frontend/src/proprietary/testing/serverExperienceSimulations.ts').asFile.path
|
||||
def aurDesktopPkgbuildPath = layout.projectDirectory.file('.github/aur/stirling-pdf-desktop/PKGBUILD').asFile.path
|
||||
def aurServerPkgbuildPath = layout.projectDirectory.file('.github/aur/stirling-pdf-server-bin/PKGBUILD').asFile.path
|
||||
|
||||
tasks.register('syncAppVersion') {
|
||||
group = 'versioning'
|
||||
description = 'Synchronizes app version across desktop and simulation configs.'
|
||||
description = 'Synchronizes app version across desktop, simulation, and AUR PKGBUILD configs.'
|
||||
|
||||
doLast {
|
||||
println "Synchronizing application version to ${appVersionStr}"
|
||||
@@ -120,6 +122,20 @@ tasks.register('syncAppVersion') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[new File(aurDesktopPkgbuildPath), new File(aurServerPkgbuildPath)].each { f ->
|
||||
if (f.exists()) {
|
||||
def content = f.getText('UTF-8')
|
||||
def matcher = (content =~ /(?m)^(pkgver=)(.*)$/)
|
||||
if (!matcher.find()) {
|
||||
throw new GradleException("Could not locate pkgver in ${f} for synchronization")
|
||||
}
|
||||
def updatedContent = matcher.replaceFirst("\$1${appVersionStr}")
|
||||
if (content != updatedContent) {
|
||||
f.write(updatedContent, 'UTF-8')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user