da1037423c
Phase 1+2 of multi-platform distribution plan:
- gradle/libs.versions.toml: add `app = "1.08.0"` as single source of truth
- Root build.gradle: allprojects { version = libs.versions.app.get() }
- amethyst/build.gradle: versionName from catalog (versionCode stays local)
- desktopApp/build.gradle.kts: drop hardcoded "1.0.0"; inherit project.version;
add TargetFormat.Rpm; add linux DSL (menuGroup, appCategory, debMaintainer,
rpmLicenseType, rpmPackageVersion with dashes stripped)
- desktopApp/build.gradle.kts: new createReleaseAppImage task wrapping
createReleaseDistributable with linuxdeploy (TargetFormat.AppImage is
broken in Compose 1.10.x — CMP-7101)
- packaging/appimage/: AppRun launcher (sets LD_LIBRARY_PATH for bundled VLC),
amethyst.desktop XDG entry, 512x512 icon extracted from icon.icns
- scripts/asset-name.sh: single source for release asset naming contract
85 lines
2.6 KiB
Groovy
85 lines
2.6 KiB
Groovy
plugins {
|
|
alias(libs.plugins.androidApplication) apply false
|
|
alias(libs.plugins.androidLibrary) apply false
|
|
alias(libs.plugins.jetbrainsKotlinJvm) apply false
|
|
alias(libs.plugins.androidBenchmark) apply false
|
|
alias(libs.plugins.diffplugSpotless)
|
|
alias(libs.plugins.googleServices) apply false
|
|
alias(libs.plugins.jetbrainsComposeCompiler) apply false
|
|
alias(libs.plugins.composeMultiplatform) apply false
|
|
alias(libs.plugins.kotlinMultiplatform) apply false
|
|
alias(libs.plugins.androidKotlinMultiplatformLibrary) apply false
|
|
alias(libs.plugins.serialization)
|
|
}
|
|
|
|
// Shared app version for all subprojects — read from gradle/libs.versions.toml.
|
|
// Android versionCode stays local in amethyst/build.gradle (must be monotonic int).
|
|
// Desktop packageVersion inherits via project.version in desktopApp/build.gradle.kts.
|
|
allprojects {
|
|
version = libs.versions.app.get()
|
|
|
|
configurations.configureEach {
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
|
}
|
|
|
|
apply plugin: 'com.diffplug.spotless'
|
|
|
|
if (project === rootProject) {
|
|
spotless {
|
|
predeclareDeps()
|
|
}
|
|
spotlessPredeclare {
|
|
kotlin {
|
|
ktlint()
|
|
}
|
|
}
|
|
} else {
|
|
spotless {
|
|
kotlin {
|
|
target 'src/**/*.kt'
|
|
|
|
ktlint()
|
|
licenseHeaderFile rootProject.file('.spotless/copyright.kt'), "@file:|package|import|class|object|sealed|open|interface|abstract "
|
|
}
|
|
|
|
groovyGradle {
|
|
target '*.gradle'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
afterEvaluate {
|
|
try {
|
|
tasks.named("preBuild") {
|
|
dependsOn("spotlessApply")
|
|
}
|
|
} catch (UnknownTaskException ignored) {
|
|
tasks.matching {
|
|
it.name.startsWith("pre") && it.name.endsWith("Build")
|
|
}.configureEach {
|
|
dependsOn("spotlessApply")
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
tasks.register('installGitHook', Copy) {
|
|
def dotGit = new File(rootProject.rootDir, '.git')
|
|
def hooksDir
|
|
if (dotGit.isFile()) {
|
|
// Git worktree: .git is a file with "gitdir: <path>"
|
|
def gitDir = new File(dotGit.text.trim().replace('gitdir: ', ''))
|
|
hooksDir = new File(gitDir, 'hooks')
|
|
} else {
|
|
hooksDir = new File(dotGit, 'hooks')
|
|
}
|
|
from new File(rootProject.rootDir, '.git-hooks/pre-commit')
|
|
from new File(rootProject.rootDir, '.git-hooks/pre-push')
|
|
into { hooksDir }
|
|
filePermissions { unix(0777) }
|
|
}
|
|
tasks.getByPath(':amethyst:preBuild').dependsOn installGitHook
|