1
0
mirror of https://github.com/irmen/ksim65.git synced 2024-05-29 03:41:30 +00:00
ksim65/build.gradle.kts

147 lines
4.1 KiB
Plaintext
Raw Normal View History

2019-09-11 00:17:59 +00:00
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2019-09-27 20:38:36 +00:00
import java.util.*
2019-09-14 16:58:45 +00:00
import kotlin.math.max
2019-09-11 00:17:59 +00:00
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM.
2020-12-19 13:58:48 +00:00
kotlin("jvm") version "1.4.20"
2019-09-26 20:00:40 +00:00
`maven-publish`
application
2019-10-12 12:56:04 +00:00
id("org.jetbrains.dokka") version "0.10.0"
id("com.jfrog.bintray") version "1.8.4"
2019-09-11 00:17:59 +00:00
}
allprojects {
val versionProps = Properties().also {
it.load(File("$projectDir/src/main/resources/version.properties").inputStream())
}
version = versionProps["version"] as String
group = "net.razorvine"
base.archivesBaseName = "ksim65"
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
jcenter()
maven("https://jitpack.io")
}
2019-09-11 00:17:59 +00:00
}
2019-10-12 14:59:58 +00:00
2019-09-11 00:17:59 +00:00
dependencies {
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
2019-09-11 00:17:59 +00: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")
2019-10-12 12:56:04 +00:00
testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.4.0")
subprojects.forEach {
archives(it)
}
2019-09-11 00:17:59 +00:00
}
2019-09-26 20:00:40 +00: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 14:59:58 +00:00
maxParallelForks = max(1, Runtime.getRuntime().availableProcessors()/2)
2019-09-26 20:00:40 +00:00
}
2019-09-26 20:00:40 +00:00
withType<KotlinCompile> {
2020-12-19 13:58:48 +00:00
kotlinOptions.jvmTarget = "11"
2019-09-26 20:00:40 +00:00
}
2019-09-11 00:17:59 +00:00
2019-09-26 20:00:40 +00:00
named<DokkaTask>("dokka") {
outputFormat = "html"
outputDirectory = "$buildDir/kdoc"
2019-10-12 12:56:04 +00:00
configuration {
skipEmptyPackages = true
}
2019-09-26 20:00:40 +00:00
}
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"
2019-10-12 14:59:58 +00:00
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"
2019-10-12 14:59:58 +00:00
classpath = project.tasks["jar"].outputs.files+project.configurations.runtimeClasspath.get()
2019-09-26 20:00:40 +00:00
}
application {
applicationName = "ksim65vm"
mainClassName = "razorvine.examplemachines.MachineMainKt"
applicationDistribution.into("bin") {
from(c64emuScript, ehbasicScript)
fileMode = 493
}
2019-09-11 00:17:59 +00:00
}
val sourcesJar by tasks.registering(Jar::class) {
dependsOn("classes")
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val dokkaDocs by tasks.registering(Jar::class) {
dependsOn("dokka")
archiveClassifier.set("kdoc")
from(fileTree(File(project.buildDir, "kdoc")))
}
publishing {
repositories {
mavenLocal()
}
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
artifact(dokkaDocs.get())
}
}
}
2019-10-12 14:59:58 +00:00
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
2020-02-01 16:48:42 +00:00
2019-10-12 14:59:58 +00:00
setPublications(* publishing.publications.names.toTypedArray())
2020-02-01 16:48:42 +00:00
// setConfigurations("archives")
2019-10-12 14:59:58 +00:00
pkg = PackageConfig().also {
it.name = "ksim65"
it.repo = "maven"
it.setLicenses("MIT")
it.vcsUrl = "https://github.com/irmen/ksim65.git"
it.setLabels("6502", "retro", "emulation", "c64")
it.githubRepo = it.vcsUrl
2020-02-05 23:57:53 +00:00
it.version = VersionConfig().also {
it.gpg = GpgConfig().also {
it.sign = true
}
}
2019-10-12 14:59:58 +00:00
}
}