diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 388ad15..196b9f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,4 +22,4 @@ jobs: env: TERM: dumb with: - arguments: clean build --warning-mode=all + arguments: clean build dist --warning-mode=all diff --git a/build.gradle.kts b/build.gradle.kts index 11de6dc..f64fb88 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,7 +27,7 @@ spotless { if (JavaVersion.current() < JavaVersion.VERSION_16) { removeUnusedImports() } else { - // google-format broken on java 16 (https://github.com/diffplug/spotless/issues/834) + // google-format broken on java 16+ (https://github.com/diffplug/spotless/issues/834) println("Warning! Unused imports remove is disabled for Java 16+") } encoding("UTF-8") @@ -48,12 +48,34 @@ spotless { var libProjects = listOf(":raung-common", ":raung-asm", ":raung-disasm") tasks.register("publishLocal") { + group = "raung" + description = "Public library packages into Maven local repo" + libProjects.forEach { dependsOn(tasks.getByPath("$it:publishToMavenLocal")) } } tasks.register("publish") { + group = "raung" + description = "Public library packages into Maven Central repo" + libProjects.forEach { dependsOn(tasks.getByPath("$it:publish")) } } + +tasks.register("dist", Copy::class) { + group = "raung" + description = "Build raung-cli distribution package" + + from(tasks.getByPath(":raung-cli:distZip")) + into(layout.buildDirectory) +} + +tasks.register("clean", Delete::class) { + group = "raung" + description = "Remove all build directories" + + delete(layout.buildDirectory) + subprojects.forEach { sp -> dependsOn(sp.tasks.named("clean")) } +} diff --git a/buildSrc/src/main/kotlin/raung.java-common.gradle.kts b/buildSrc/src/main/kotlin/raung.java-common.gradle.kts index 7f24fc6..a074d30 100644 --- a/buildSrc/src/main/kotlin/raung.java-common.gradle.kts +++ b/buildSrc/src/main/kotlin/raung.java-common.gradle.kts @@ -4,7 +4,7 @@ plugins { } group = "io.github.skylot.raung" -version = "0.0.1" +version = System.getenv("RAUNG_VERSION") ?: "dev" java { sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/buildSrc/src/main/kotlin/raung.java-library.gradle.kts b/buildSrc/src/main/kotlin/raung.java-library.gradle.kts index b4b07fc..6a0ddf5 100644 --- a/buildSrc/src/main/kotlin/raung.java-library.gradle.kts +++ b/buildSrc/src/main/kotlin/raung.java-library.gradle.kts @@ -11,7 +11,7 @@ dependencies { } group = "io.github.skylot" -version = "0.0.1" +version = System.getenv("RAUNG_VERSION") ?: "dev" java { withJavadocJar() @@ -58,7 +58,6 @@ publishing { } repositories { maven { - // change URLs to point to your repos, e.g. http://my.org/repo val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl @@ -71,11 +70,15 @@ publishing { } signing { + setRequired(gradle.taskGraph.hasTask("publish")) sign(publishing.publications["mavenJava"]) } tasks.javadoc { + val stdOptions = options as StandardJavadocDocletOptions if (JavaVersion.current().isJava9Compatible) { - (options as StandardJavadocDocletOptions).addBooleanOption("html5", true) + stdOptions.addBooleanOption("html5", true) } + // disable 'missing' warnings + stdOptions.addStringOption("Xdoclint:all,-missing", "-quiet") }