1
0
mirror of https://github.com/irmen/ksim65.git synced 2024-06-01 21:41:31 +00:00
ksim65/build.gradle.kts

93 lines
2.9 KiB
Plaintext
Raw Normal View History

2019-09-26 20:00:40 +00:00
import org.gradle.api.internal.plugins.UnixStartScriptGenerator
import org.gradle.api.internal.plugins.WindowsStartScriptGenerator
2019-09-11 00:17:59 +00:00
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2019-09-14 16:58:45 +00:00
import kotlin.math.max
import java.util.Properties
2019-09-11 00:17:59 +00:00
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM.
2019-09-14 23:50:35 +00:00
kotlin("jvm") version "1.3.50"
2019-09-26 20:00:40 +00:00
`maven-publish`
application
2019-09-12 23:20:57 +00:00
id("org.jetbrains.dokka") version "0.9.18"
id("com.jfrog.bintray") version "1.7.3"
2019-09-11 00:17:59 +00:00
}
val versionProps = Properties().also {
2019-09-14 23:50:35 +00:00
it.load(File("$projectDir/src/main/resources/version.properties").inputStream())
}
version = versionProps["version"] as String
2019-09-14 23:50:35 +00:00
group = "net.razorvine"
2019-09-12 23:20:57 +00:00
base.archivesBaseName = "ksim65"
2019-09-11 00:17:59 +00:00
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
maven("https://jitpack.io")
2019-09-11 00:17:59 +00:00
}
dependencies {
// 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")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.1.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.1.0")
}
2019-09-26 20:00:40 +00:00
tasks {
named<Test>("test") {
// Enable JUnit 5 (Gradle 4.6+).
useJUnitPlatform()
// Always run tests, even when nothing changed.
dependsOn("cleanTest")
// Show test results.
testLogging.events("failed")
// parallel tests.
systemProperty("junit.jupiter.execution.parallel.enabled", "true")
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
maxParallelForks = max(1, Runtime.getRuntime().availableProcessors() / 2)
}
2019-09-26 20:00:40 +00:00
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
2019-09-11 00:17:59 +00:00
2019-09-26 20:00:40 +00:00
named<DokkaTask>("dokka") {
outputFormat = "html"
outputDirectory = "$buildDir/kdoc"
skipEmptyPackages = true
}
2019-09-11 00:17:59 +00:00
}
2019-09-26 20:00:40 +00:00
val c64emuScript by tasks.registering(CreateStartScripts::class) {
outputDir = File(project.buildDir, "bin")
applicationName = "c64emu"
mainClassName = "razorvine.c64emu.C64MainKt"
classpath = project.tasks["jar"].outputs.files + project.configurations.runtimeClasspath.get()
2019-09-11 00:17:59 +00:00
}
2019-09-26 20:00:40 +00:00
val ehbasicScript by tasks.registering(CreateStartScripts::class) {
outputDir = File(project.buildDir, "bin")
applicationName = "ehbasic"
mainClassName = "razorvine.examplemachines.EhBasicMainKt"
classpath = project.tasks["jar"].outputs.files + project.configurations.runtimeClasspath.get()
}
application {
applicationName = "ksim65vm"
mainClassName = "razorvine.examplemachines.MachineMainKt"
applicationDistribution.into("bin") {
from(c64emuScript, ehbasicScript)
fileMode = 493
}
2019-09-11 00:17:59 +00:00
}