1
0
mirror of https://github.com/irmen/ksim65.git synced 2025-03-18 14:30:11 +00:00
ksim65/build.gradle.kts

112 lines
3.1 KiB
Plaintext
Raw Permalink Normal View History

2019-09-27 22:38:36 +02:00
import java.util.*
2019-09-14 18:58:45 +02:00
import kotlin.math.max
2019-09-11 02:17:59 +02:00
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM.
2024-12-21 04:17:42 +01:00
kotlin("jvm") version "2.1.0"
2019-09-26 22:00:40 +02:00
`maven-publish`
application
2021-07-06 23:37:19 +02:00
java
2019-09-11 02:17:59 +02:00
}
allprojects {
val versionProps = Properties().also {
it.load(File("$projectDir/src/main/resources/version.properties").inputStream())
}
version = versionProps["version"] as String
group = "net.razorvine"
2023-05-26 20:14:55 +02:00
// base.archivesBaseName = "ksim65"
repositories {
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
2021-07-06 23:37:19 +02:00
mavenCentral()
maven("https://jitpack.io")
}
2019-09-11 02:17:59 +02:00
}
dependencies {
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
2022-08-13 21:24:12 +02:00
implementation("org.jetbrains.kotlin:kotlin-reflect")
2019-09-11 02:17:59 +02:00
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// Use the Kotlin test library.
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Use the Kotlin JUnit5 integration.
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
2024-09-26 21:08:57 +02:00
testImplementation("org.junit.jupiter:junit-jupiter-api")
2023-08-15 13:23:19 +02:00
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
subprojects.forEach {
2021-07-06 23:37:19 +02:00
implementation(it)
}
2019-09-11 02:17:59 +02:00
}
2019-09-26 22:00:40 +02:00
tasks {
named<Test>("test") {
useJUnitPlatform()
dependsOn("cleanTest")
testLogging.events("failed")
// parallel tests.
systemProperty("junit.jupiter.execution.parallel.enabled", "true")
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
2019-10-12 16:59:58 +02:00
maxParallelForks = max(1, Runtime.getRuntime().availableProcessors()/2)
2019-09-26 22:00:40 +02:00
}
2019-09-11 02:17:59 +02:00
}
2023-10-30 20:24:14 +01:00
2019-09-26 22:00:40 +02:00
val c64emuScript by tasks.registering(CreateStartScripts::class) {
2023-10-30 20:24:14 +01:00
outputDir = project.layout.buildDirectory.dir("bin").get().asFile
2019-09-26 22:00:40 +02:00
applicationName = "c64emu"
2021-07-06 23:37:19 +02:00
mainClass.set("razorvine.c64emu.C64MainKt")
2019-10-12 16:59:58 +02:00
classpath = project.tasks["jar"].outputs.files+project.configurations.runtimeClasspath.get()
2019-09-11 02:17:59 +02:00
}
2019-09-26 22:00:40 +02:00
val ehbasicScript by tasks.registering(CreateStartScripts::class) {
2023-10-30 20:24:14 +01:00
outputDir = project.layout.buildDirectory.dir("bin").get().asFile
2019-09-26 22:00:40 +02:00
applicationName = "ehbasic"
2021-07-06 23:37:19 +02:00
mainClass.set("razorvine.examplemachines.EhBasicMainKt")
2019-10-12 16:59:58 +02:00
classpath = project.tasks["jar"].outputs.files+project.configurations.runtimeClasspath.get()
2019-09-26 22:00:40 +02:00
}
application {
applicationName = "ksim65vm"
2021-07-06 23:37:19 +02:00
mainClass.set("razorvine.examplemachines.MachineMainKt")
2019-09-26 22:00:40 +02:00
applicationDistribution.into("bin") {
from(c64emuScript, ehbasicScript)
2023-10-30 20:24:14 +01:00
filePermissions {
user {
read=true
execute=true
write=true
}
other.execute = true
group.execute = true
}
2019-09-26 22:00:40 +02:00
}
2019-09-11 02:17:59 +02:00
}
val sourcesJar by tasks.registering(Jar::class) {
dependsOn("classes")
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
publishing {
repositories {
mavenLocal()
}
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
}
}
}