From 7f18d5c80f8e5de767a14f13435bb390ba0320d0 Mon Sep 17 00:00:00 2001 From: ice1000 Date: Mon, 25 Sep 2023 11:44:02 -0400 Subject: [PATCH] build: improve some build scripts --- build.gradle.kts | 86 +++++++++++++++++------------------- buildSrc/settings.gradle.kts | 8 +--- settings.gradle.kts | 6 +-- 3 files changed, 45 insertions(+), 55 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a1ac239a6e..7f69359548 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { `java-library` `maven-publish` signing - id("org.beryx.jlink") version "2.26.0" apply false + id("org.beryx.jlink") version "3.0.0" apply false } var currentPlatform: String by rootProject.ext @@ -153,16 +153,14 @@ subprojects { val ossrhUsername = propOrEnv("ossrhUsername") val ossrhPassword = propOrEnv("ossrhPassword") - if (ossrhUsername.isNotEmpty()) publishing.repositories { - maven { - 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 (isRelease) releasesRepoUrl else snapshotsRepoUrl - name = "MavenCentral" - credentials { - username = ossrhUsername - password = ossrhPassword - } + if (ossrhUsername.isNotEmpty()) publishing.repositories.maven { + 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 (isRelease) releasesRepoUrl else snapshotsRepoUrl + name = "MavenCentral" + credentials { + username = ossrhUsername + password = ossrhPassword } } @@ -171,42 +169,40 @@ subprojects { enabled = false } - publishing.publications { - create("maven") { - val githubUrl = "https://github.com/aya-prover/aya-dev" - groupId = proj.group.toString() - version = proj.version.toString() - artifactId = proj.name - from(components["java"]) - pom { - description.set("The Aya proof assistant") - name.set(proj.name) - url.set("https://www.aya-prover.org") - licenses { - license { - name.set("MIT") - url.set("$githubUrl/blob/master/LICENSE") - } - } - developers { - fun dev(i: String, n: String, u: String) = developer { - id.set(i) - name.set(n) - email.set(u) - } - dev("ice1000", "Tesla (Yinsen) Zhang", "ice1000kotlin@foxmail.com") - dev("imkiva", "Kiva Oyama", "imkiva@islovely.icu") - dev("re-xyr", "Xy Ren", "xy.r@outlook.com") - dev("dark-flames", "Darkflames", "dark_flames@outlook.com") - dev("tsao-chi", "tsao-chi", "tsao-chi@the-lingo.org") - dev("lunalunaa", "Luna Xin", "luna.xin@outlook.com") - dev("wsx", "Shuxian Wang", "wsx@berkeley.edu") - dev("HoshinoTented", "Hoshino Tented", "limbolrain@gmail.com") + publishing.publications.create("maven") { + val githubUrl = "https://github.com/aya-prover/aya-dev" + groupId = proj.group.toString() + version = proj.version.toString() + artifactId = proj.name + from(components["java"]) + pom { + description.set("The Aya proof assistant") + name.set(proj.name) + url.set("https://www.aya-prover.org") + licenses { + license { + name.set("MIT") + url.set("$githubUrl/blob/master/LICENSE") } - scm { - connection.set("scm:git:$githubUrl") - url.set(githubUrl) + } + developers { + fun dev(i: String, n: String, u: String) = developer { + id.set(i) + name.set(n) + email.set(u) } + dev("ice1000", "Tesla (Yinsen) Zhang", "ice1000kotlin@foxmail.com") + dev("imkiva", "Kiva Oyama", "imkiva@islovely.icu") + dev("re-xyr", "Xy Ren", "xy.r@outlook.com") + dev("dark-flames", "Darkflames", "dark_flames@outlook.com") + dev("tsao-chi", "tsao-chi", "tsao-chi@the-lingo.org") + dev("lunalunaa", "Luna Xin", "luna.xin@outlook.com") + dev("wsx", "Shuxian Wang", "wsx@berkeley.edu") + dev("HoshinoTented", "Hoshino Tented", "limbolrain@gmail.com") + } + scm { + connection.set("scm:git:$githubUrl") + url.set(githubUrl) } } } diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index 215a5d58e7..aa201314b3 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -1,7 +1,3 @@ -dependencyResolutionManagement { - versionCatalogs { - create("libs") { - from(files("../gradle/libs.versions.toml")) - } - } +dependencyResolutionManagement.versionCatalogs.create("libs") { + from(files("../gradle/libs.versions.toml")) } diff --git a/settings.gradle.kts b/settings.gradle.kts index b1bebf1224..7f3e36a622 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,10 +3,8 @@ rootProject.name = "aya-prover" -dependencyResolutionManagement { - @Suppress("UnstableApiUsage") repositories { - mavenCentral() - } +@Suppress("UnstableApiUsage") dependencyResolutionManagement.repositories { + mavenCentral() } include(