Skip to content

Commit

Permalink
build: improve some build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed Sep 25, 2023
1 parent d111e48 commit 7f18d5c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 55 deletions.
86 changes: 41 additions & 45 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}

Expand All @@ -171,42 +169,40 @@ subprojects {
enabled = false
}

publishing.publications {
create<MavenPublication>("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<MavenPublication>("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)
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
dependencyResolutionManagement.versionCatalogs.create("libs") {
from(files("../gradle/libs.versions.toml"))
}
6 changes: 2 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

rootProject.name = "aya-prover"

dependencyResolutionManagement {
@Suppress("UnstableApiUsage") repositories {
mavenCentral()
}
@Suppress("UnstableApiUsage") dependencyResolutionManagement.repositories {
mavenCentral()
}

include(
Expand Down

0 comments on commit 7f18d5c

Please sign in to comment.