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

create more start scripts

This commit is contained in:
Irmen de Jong 2019-09-26 22:00:40 +02:00
parent af99bfdc13
commit 02dca20f8d

View File

@ -1,3 +1,5 @@
import org.gradle.api.internal.plugins.UnixStartScriptGenerator
import org.gradle.api.internal.plugins.WindowsStartScriptGenerator
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import kotlin.math.max
@ -7,10 +9,10 @@ import java.util.Properties
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM.
kotlin("jvm") version "1.3.50"
`maven-publish`
application
id("org.jetbrains.dokka") version "0.9.18"
id("com.jfrog.bintray") version "1.7.3"
id("maven-publish")
id("application")
}
val versionProps = Properties().also {
@ -40,31 +42,51 @@ dependencies {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.1.0")
}
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)
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
named<DokkaTask>("dokka") {
outputFormat = "html"
outputDirectory = "$buildDir/kdoc"
skipEmptyPackages = true
}
}
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()
}
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"
}
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)
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.named<DokkaTask>("dokka") {
outputFormat = "html"
outputDirectory = "$buildDir/kdoc"
skipEmptyPackages = true
applicationDistribution.into("bin") {
from(c64emuScript, ehbasicScript)
fileMode = 493
}
}