Skip to content

Commit

Permalink
Add BOM
Browse files Browse the repository at this point in the history
  • Loading branch information
SupremeMortal committed Jun 16, 2024
1 parent 27da92a commit 10d9b3e
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
required: true

env:
GRADLE_OPTS: "-Dorg.gradle.parallel=true -Dorg.gradle.daemon=false -Dorg.gradle.caching=true -Dorg.gradle.welcome=never"
GRADLE_OPTS: "-Dorg.gradle.parallel=false -Dorg.gradle.daemon=false -Dorg.gradle.caching=true -Dorg.gradle.welcome=never"

jobs:
publish:
Expand Down
6 changes: 5 additions & 1 deletion gradle/plugin/src/main/kotlin/extensions.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.eclipse.jgit.internal.storage.file.FileRepository
import org.eclipse.jgit.lib.Constants
import org.eclipse.jgit.lib.RepositoryBuilder
import org.gradle.api.Project
import org.gradle.api.initialization.Settings

const val PKG = "it/unimi/dsi/fastutil"

Expand Down Expand Up @@ -83,3 +83,7 @@ fun Project.isRelease(): Boolean {
println("Snapshot build. No tag found for ${headRef.objectId.name}")
return false
}

fun Settings.addModule(name: String) {
include(":modules:$name")
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
plugins {
id("java-library")
id("maven-publish")
id("signing")
}

java {
withJavadocJar()
withSourcesJar()

toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

publishing {
repositories {
maven {
Expand All @@ -28,9 +18,9 @@ publishing {
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
packaging = "jar"
name = project.description
description = "A component of the Fastutil library"
url.set("https://github.com/CloudburstMC/fastutil")

scm {
Expand Down Expand Up @@ -63,18 +53,4 @@ signing {
useInMemoryPgpKeys(System.getenv("PGP_SECRET"), System.getenv("PGP_PASSPHRASE"))
sign(publishing.publications["maven"])
}
}

tasks.javadoc {
options {
(this as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
}
}

tasks.test {
useJUnitPlatform()
}

tasks.compileJava {
options.encoding = Charsets.UTF_8.name();
}
}
38 changes: 38 additions & 0 deletions gradle/plugin/src/main/kotlin/fastutil.module.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
plugins {
id("fastutil.base")
id("java-library")
}

java {
withJavadocJar()
withSourcesJar()

toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

publishing {
publications {
named<MavenPublication>("maven") {
from(components["java"])
pom {
packaging = "jar"
}
}
}
}

tasks.javadoc {
options {
(this as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
}
}

tasks.test {
useJUnitPlatform()
}

tasks.compileJava {
options.encoding = Charsets.UTF_8.name();
}
4 changes: 3 additions & 1 deletion modules/big-lists/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
subprojects {
apply(plugin = "fastutil")
apply(plugin = "fastutil.module")

group = "org.cloudburstmc.fastutil.biglists"

val type = project.getType()
val pkg = type.packagePath()
val cType = type.capitalised()

description = "Fastutil $cType big lists"

dependencies {
"api"(project(":modules:commons:$type-common"))
if (type.parent() == Type.OBJECT) {
Expand Down
29 changes: 29 additions & 0 deletions modules/bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
description = "Fastutil BOM"

plugins {
id("java-platform")
id("fastutil.base")
}

dependencies {
constraints {
gradle.projectsEvaluated {
for (subProject in project.rootProject.subprojects) {
if (subProject != project && subProject.plugins.hasPlugin(MavenPublishPlugin::class.java)) {
api(subProject)
}
}
}
}
}

configure<PublishingExtension> {
publications {
named<MavenPublication>("maven") {
from(components["javaPlatform"])
pom {
packaging = "pom"
}
}
}
}
4 changes: 3 additions & 1 deletion modules/commons/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
subprojects {
apply(plugin = "fastutil")
apply(plugin = "fastutil.module")

group = "org.cloudburstmc.fastutil.commons"

val type = project.getType()
val pkg = type.packagePath()
val cType = type.capitalised()

description = "Fastutil $cType commons"

dependencies {
"api"(project(":modules:core"))
if (type.parent() != null) {
Expand Down
4 changes: 3 additions & 1 deletion modules/core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
description = "Fastutil core"

plugins {
id("fastutil")
id("fastutil.module")
}

sourceSets.main {
Expand Down
4 changes: 3 additions & 1 deletion modules/io/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
description = "Fastutil IO"

plugins {
id("fastutil")
id("fastutil.module")
}

dependencies {
Expand Down
4 changes: 3 additions & 1 deletion modules/maps/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
subprojects {
apply(plugin = "fastutil")
apply(plugin = "fastutil.module")

group = "org.cloudburstmc.fastutil.maps"

Expand All @@ -9,6 +9,8 @@ subprojects {
val cType = key.capitalised()
val valCType = value.capitalised()

description = "Fastutil $cType to $valCType maps"

dependencies {
"api"(project(":modules:sets:object-sets"))
"api"(project(":modules:sets:$key-sets"))
Expand Down
4 changes: 3 additions & 1 deletion modules/queues/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
subprojects {
apply(plugin = "fastutil")
apply(plugin = "fastutil.module")

group = "org.cloudburstmc.fastutil.queues"

val type = project.getType()
val pkg = type.packagePath()
val cType = type.capitalised()

description = "Fastutil $cType queues"

dependencies {
"api"(project(":modules:commons:$type-common"))
}
Expand Down
4 changes: 3 additions & 1 deletion modules/sets/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
subprojects {
apply(plugin = "fastutil")
apply(plugin = "fastutil.module")

group = "org.cloudburstmc.fastutil.sets"

val type = project.getType()
val pkg = type.packagePath()
val cType = type.capitalised()

description = "Fastutil $cType sets"

dependencies {
"api"(project(":modules:commons:$type-common"))
}
Expand Down
6 changes: 1 addition & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

fun addModule(name: String) {
include(":modules:$name")
}


addModule("bom")
addModule("core")
addModule("io")

Expand Down

0 comments on commit 10d9b3e

Please sign in to comment.