diff --git a/build.gradle.kts b/build.gradle.kts index c45e553..39cdc08 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,17 +2,8 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -buildscript { - repositories { - jcenter() - mavenCentral() - maven { setUrl("https://plugins.gradle.org/m2") } - } - - dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72") - } -} +fun DependencyHandler.impl(vararg dep: Any) = dep.forEach { implementation(it) } +fun DependencyHandler.testImpl(vararg dep: Any) = dep.forEach { testImplementation(it) } plugins { java @@ -29,31 +20,12 @@ repositories { } object This { - val version = "0.1" - val groupId = "com.beust" val artifactId = "chip8" - val description = "A CHIP8 emulator" - val url = "https://github.com/cbeust/chip8" - val scm = "github.com/cbeust/chip8.git" - - // Should not need to change anything below - val issueManagementUrl = "https://$scm/issues" - val isSnapshot = version.contains("SNAPSHOT") -} - -allprojects { - group = This.groupId - version = This.version } dependencies { - listOf(kotlin("stdlib"), "com.beust:jcommander:1.72").forEach { - implementation(it) - } - - listOf(kotlin("test"), "org.testng:testng:7.0.0", "org.assertj:assertj-core:3.10.0").forEach { - testImplementation(it) - } + impl(kotlin("stdlib"), "com.beust:jcommander:1.72") + testImpl(kotlin("test"), "org.testng:testng:7.0.0", "org.assertj:assertj-core:3.10.0") } val test by tasks.getting(Test::class) { @@ -68,16 +40,12 @@ tasks { named("shadowJar") { archiveBaseName.set(This.artifactId) mergeServiceFiles() -// excludes = listOf("META-INF/*.DSA", "META-INF/*.RSA", "META-INF/*.SF") manifest { attributes(mapOf( - "Implementation-Title" to rootProject.name, - "Implementation-Version" to rootProject.version, - "Implementation-Vendor-Id" to rootProject.group, - // attributes "Build-Time": ZonedDateTime.now(ZoneId.of("UTC")) - // .format(DateTimeFormatter.ISO_ZONED_DATE_TIME) -// "Built-By" to java.net.InetAddress.localHost.hostName, - "Created-By" to "Gradle "+ gradle.gradleVersion, + "Implementation-Title" to rootProject.name, + "Implementation-Version" to rootProject.version, + "Implementation-Vendor-Id" to rootProject.group, + "Created-By" to "Gradle "+ gradle.gradleVersion, "Main-Class" to "com.beust.cedlinks.MainKt")) } }