mirror of
https://github.com/wgtunnel/desktop.git
synced 2026-06-02 00:29:09 +02:00
initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
`kotlin-dsl` // enable the Kotlin-DSL
|
||||
}
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.apache.commons:commons-lang3:3.20.0")
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
rootProject.name = "buildSrc"
|
||||
@@ -0,0 +1,19 @@
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.util.*
|
||||
|
||||
object LocalProperties {
|
||||
|
||||
private val properties by lazy {
|
||||
val props = Properties()
|
||||
val file = File("local.properties")
|
||||
if (file.exists()) {
|
||||
FileInputStream(file).use { props.load(it) }
|
||||
}
|
||||
props
|
||||
}
|
||||
|
||||
fun get(key: String): String? = properties.getProperty(key)
|
||||
|
||||
fun getOrDefault(key: String, default: String): String = properties.getProperty(key, default)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
object SystemVar {
|
||||
fun fromEnvironment(envVar : String) : String? {
|
||||
return System.getenv(envVar)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.Exec
|
||||
import org.gradle.kotlin.dsl.register
|
||||
|
||||
|
||||
fun Project.registerConveyorTask(
|
||||
taskName: String,
|
||||
packageType: String,
|
||||
subDir: String,
|
||||
) {
|
||||
tasks.register<Exec>(taskName) {
|
||||
group = "distribution"
|
||||
val outputDir = layout.buildDirectory.dir("conveyor/$subDir")
|
||||
outputs.dir(outputDir)
|
||||
|
||||
environment(
|
||||
"CONVEYOR_PASSPHRASE",
|
||||
SystemVar.fromEnvironment("CONVEYOR_PASSPHRASE") ?: LocalProperties.get("conveyor.passphrase") ?: ""
|
||||
)
|
||||
|
||||
val args = mutableListOf(
|
||||
"conveyor",
|
||||
"--passphrase=env:CONVEYOR_PASSPHRASE",
|
||||
"make",
|
||||
"--output-dir", outputDir.get().asFile.absolutePath,
|
||||
packageType
|
||||
)
|
||||
|
||||
commandLine(args)
|
||||
|
||||
dependsOn(
|
||||
":composeApp:createDistributable",
|
||||
":cli:installDist",
|
||||
":daemon:installDist",
|
||||
":composeApp:writeConveyorConfig"
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user