restructure, begin implementing libplt
This commit is contained in:
30
plt-build/build.gradle.kts
Normal file
30
plt-build/build.gradle.kts
Normal file
@@ -0,0 +1,30 @@
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
kotlin {
|
||||
jvm()
|
||||
val nativeTarget = if(System.getProperty("os.arch") == "aarch64") {
|
||||
linuxArm64("native")
|
||||
} else {
|
||||
linuxX64("native")
|
||||
}
|
||||
nativeTarget.binaries {
|
||||
executable()
|
||||
}
|
||||
sourceSets {
|
||||
nativeMain.dependencies {
|
||||
implementation(project(":libplt"))
|
||||
}
|
||||
nativeTest.dependencies {
|
||||
implementation(project(":libplt"))
|
||||
implementation(kotlin("test"))
|
||||
}
|
||||
jvmMain.dependencies {
|
||||
implementation(project(":libplt"))
|
||||
}
|
||||
jvmTest.dependencies {
|
||||
implementation(project(":libplt"))
|
||||
implementation(kotlin("test"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.hakurei.planterette.api
|
||||
|
||||
interface Task {
|
||||
val execute: String
|
||||
}
|
||||
class AptInstallTask(val packages: List<String>) : Task {
|
||||
private fun getPackageList(): String {
|
||||
var string = ""
|
||||
packages.forEach { p ->
|
||||
string += "$p "
|
||||
}
|
||||
return string
|
||||
}
|
||||
override val execute: String
|
||||
get() = "sudo apt install ${getPackageList()}"
|
||||
}
|
||||
Reference in New Issue
Block a user