Files
cloud-sync/build.gradle.kts
T
claude-timemachine 31062e98b9
CI / build (push) Failing after 2s
CI / release (push) Has been skipped
feat: CLI parser, restic discovery+download, pull/push via restic CLI
- Args.kt: parses --url, --pack-folder, --token-file, --restic-binary,
    --no-download, -g/--no-gui. Inline and space-separated value forms.
  - Restic.kt: locates restic via 1) --restic-binary override, 2) cached
    <pack-folder>/.cloud-sync/restic-<ver>, 3) system PATH (version match),
    4) auto-download from github releases + sha256 verify against SHA256SUMS.
    bz2 decompression via commons-compress (bzcat fallback).
  - Scope.kt: per-distribution cloud-scope.json with sensible defaults
    (options.txt, config/, journeymap/data/, screenshots/). Auto-excludes
    .cloud-sync/ so we never leak our own credentials.
  - Sync.kt: pull = restic restore latest --target <pack-folder>;
    push = restic backup --files-from <generated> --exclude-file <generated>.
    Empty repos handled (pull is no-op when no snapshots yet).
  - 18 tests pass. Fat jar grew to 6 MB (commons-compress).
2026-06-02 22:41:00 +02:00

66 lines
1.8 KiB
Kotlin

plugins {
kotlin("jvm") version "2.1.0"
kotlin("plugin.serialization") version "2.1.0"
id("com.gradleup.shadow") version "8.3.5"
application
}
group = "center.timemachine.cloud"
version = "0.1.0"
repositories {
mavenCentral()
}
dependencies {
// FlatLaf gives us an IntelliJ-style dark theme on Swing —
// closest visual match to Prism Launcher's Qt look in pure Java.
implementation("com.formdev:flatlaf:3.5.4")
implementation("com.formdev:flatlaf-intellij-themes:3.5.4")
// JSON via Kotlin's official lib; supports kotlin data classes natively.
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
// bz2 decompression of restic release archives without shelling out to
// system bzcat (covers stripped-down containers).
implementation("org.apache.commons:commons-compress:1.27.1")
testImplementation(kotlin("test"))
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2")
}
// Target Java 17 bytecode using whatever JDK is installed locally (we
// require >= 17). Avoids the Gradle toolchain auto-provisioning dance,
// at the cost of needing a manual JDK 17+ on dev machines and CI runners.
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
application {
mainClass.set("center.timemachine.cloud.MainKt")
}
tasks.test {
useJUnitPlatform()
}
tasks.shadowJar {
archiveBaseName.set("cloud-sync")
archiveClassifier.set("")
archiveVersion.set(project.version.toString())
mergeServiceFiles()
}
// Defer to shadowJar for the canonical artifact; the default 'jar' task
// produces a thin jar without dependencies which would be useless to ship.
tasks.jar {
enabled = false
}