mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-02-05 19:32:48 -08:00
Kotlin version of build script
Create standalone directory of executable java scripts
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.6.0'
|
||||
// id 'application'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.0'
|
||||
}
|
||||
81
buildJvm/build.gradle.kts
Normal file
81
buildJvm/build.gradle.kts
Normal file
@@ -0,0 +1,81 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.6.0"
|
||||
id("application")
|
||||
}
|
||||
|
||||
version = "unspecified"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
task("copyScripts", Copy::class) {
|
||||
from(filesType("bin"))
|
||||
into("/tmp/bin7/bin")
|
||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
mustRunAfter(":installDist")
|
||||
}
|
||||
|
||||
task("copyLibs", Copy::class) {
|
||||
from(filesType("lib"))
|
||||
into("/tmp/bin7/lib")
|
||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
mustRunAfter(":installDist")
|
||||
}
|
||||
|
||||
task ("copyAll") {
|
||||
dependsOn(
|
||||
":assemble",
|
||||
":installDist",
|
||||
":copyScripts",
|
||||
":copyLibs"
|
||||
)
|
||||
}
|
||||
|
||||
//
|
||||
//java {
|
||||
// toolchain {
|
||||
// languageVersion = JavaLanguageVersion.of(17)
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//dependencies {
|
||||
// implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.0'
|
||||
//}
|
||||
//
|
||||
//task buildAll {
|
||||
// doLast {
|
||||
// def bins = fileTree(dir: "$buildDir/..").getFiles()
|
||||
// println bins
|
||||
// }
|
||||
//}
|
||||
//tasks.register('fullBuild', Copy) {
|
||||
//// from fileTree(dir: "$buildDir/../").getFiles()
|
||||
//// into file("/tmp/bin6")
|
||||
//// duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
// doLast {
|
||||
// println (fileTree(dir: "$buildDir/../").getFiles())
|
||||
// }
|
||||
//// def i=0
|
||||
//// eachFile {
|
||||
//// details ->
|
||||
//// details.setPath( "bbb${i}")
|
||||
//// i++
|
||||
//// duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
//// }
|
||||
//}
|
||||
|
||||
fun Build_gradle.filesType(type: String) = fileTree("$buildDir/..").files.filter {
|
||||
it.path.contains("build/install/build_.*/$type".toRegex())
|
||||
&& it.isFile
|
||||
}
|
||||
Reference in New Issue
Block a user