Skip to content

Commit

Permalink
build: deploy Bill of Materials (BOM). Close LWJGL#481
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMrMilchmann authored and Spasi committed Aug 28, 2019
1 parent 24408ad commit cd8a012
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 38 deletions.
92 changes: 54 additions & 38 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.net.*

plugins {
`java-platform`
`maven-publish`
signing
}
Expand Down Expand Up @@ -66,7 +67,6 @@ enum class Platforms(val classifier: String) {
WINDOWS_X86("windows-x86");

companion object {
val JAVA_ONLY = emptyArray<Platforms>()
val ALL = values()
}
}
Expand Down Expand Up @@ -95,13 +95,11 @@ enum class Artifacts(
),
CUDA(
"lwjgl-cuda", "LWJGL - CUDA bindings",
"A parallel computing platform and programming model developed by NVIDIA for general computing on GPUs.",
*Platforms.JAVA_ONLY
"A parallel computing platform and programming model developed by NVIDIA for general computing on GPUs."
),
EGL(
"lwjgl-egl", "LWJGL - EGL bindings",
"An interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system.",
*Platforms.JAVA_ONLY
"An interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system."
),
GLFW(
"lwjgl-glfw", "LWJGL - GLFW bindings",
Expand All @@ -110,8 +108,7 @@ enum class Artifacts(
),
JAWT(
"lwjgl-jawt", "LWJGL - JAWT bindings",
"The AWT native interface.",
*Platforms.JAVA_ONLY
"The AWT native interface."
),
JEMALLOC(
"lwjgl-jemalloc", "LWJGL - jemalloc bindings",
Expand Down Expand Up @@ -160,8 +157,7 @@ enum class Artifacts(
),
ODBC(
"lwjgl-odbc", "LWJGL - ODBC bindings",
"A C programming language interface that makes it possible for applications to access data from a variety of database management systems (DBMSs).",
*Platforms.JAVA_ONLY
"A C programming language interface that makes it possible for applications to access data from a variety of database management systems (DBMSs)."
),
OPENAL(
"lwjgl-openal", "LWJGL - OpenAL bindings",
Expand All @@ -170,8 +166,7 @@ enum class Artifacts(
),
OPENCL(
"lwjgl-opencl", "LWJGL - OpenCL bindings",
"An open, royalty-free standard for cross-platform, parallel programming of diverse processors found in personal computers, servers, mobile devices and embedded platforms.",
*Platforms.JAVA_ONLY
"An open, royalty-free standard for cross-platform, parallel programming of diverse processors found in personal computers, servers, mobile devices and embedded platforms."
),
OPENGL(
"lwjgl-opengl", "LWJGL - OpenGL bindings",
Expand Down Expand Up @@ -332,6 +327,36 @@ publishing {
and a whole lot more verbose in Maven. Hopefully, the automation
is going to alleviate the pain.
*/
fun org.gradle.api.publish.maven.MavenPom.setupPom(pomName: String, pomDescription: String, pomPackaging: String) {
name.set(pomName)
description.set(pomDescription)
url.set("https://www.lwjgl.org")
packaging = pomPackaging

scm {
connection.set("scm:git:https://github.com/LWJGL/lwjgl3.git")
developerConnection.set("scm:git:https://github.com/LWJGL/lwjgl3.git")
url.set("https://github.com/LWJGL/lwjgl3.git")
}

licenses {
license {
name.set("BSD")
url.set("https://www.lwjgl.org/license")
distribution.set("repo")
}
}

developers {
developer {
id.set("spasi")
name.set("Ioannis Tsakpinis")
email.set("iotsakp@gmail.com")
url.set("https://github.com/Spasi")
}
}
}

Artifacts.values().forEach { module ->
if (module.isActive) {
create<MavenPublication>("maven${module.name}") {
Expand All @@ -356,33 +381,7 @@ publishing {
}

pom {
name.set(module.projectName)
description.set(module.projectDescription)
url.set("https://www.lwjgl.org")
packaging = "jar"

scm {
connection.set("scm:git:https://github.com/LWJGL/lwjgl3.git")
developerConnection.set("scm:git:https://github.com/LWJGL/lwjgl3.git")
url.set("https://github.com/LWJGL/lwjgl3.git")
}

licenses {
license {
name.set("BSD")
url.set("https://www.lwjgl.org/license")
distribution.set("repo")
}
}

developers {
developer {
id.set("spasi")
name.set("Ioannis Tsakpinis")
email.set("iotsakp@gmail.com")
url.set("https://github.com/Spasi")
}
}
setupPom(module.projectName, module.projectDescription, "jar")

if (module != Artifacts.CORE) {
withXml {
Expand All @@ -400,6 +399,15 @@ publishing {
}
}
}

create<MavenPublication>("lwjglBOM") {
from(components["javaPlatform"])
artifactId = "lwjgl-bom"

pom {
setupPom("LWJGL BOM", "A Bill of Materials for LWJGL3.", "pom")
}
}
}
}

Expand All @@ -416,4 +424,12 @@ val copyArchives = tasks.create<Copy>("copyArchives") {

tasks.withType<Sign> {
dependsOn(copyArchives)
}

dependencies {
constraints {
Artifacts.values().forEach { module ->
api("org.lwjgl:${module.artifact}:$lwjglVersion")
}
}
}
1 change: 1 addition & 0 deletions doc/notes/3.2.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This build includes the following changes:
* The default contains x64 shared libraries only. Maven classifier: `windows`
* `lwjgl-natives-windows-x86.jar` contains x86 shared libraries only. Maven classifier: `windows-x86`
* The `32` suffix has been dropped from x86 shared library names.
- Maven: LWJGL artifacts now include a Bill of Materials (BOM). (#481)
- Refactored the layout of native JAR files.
* Shared libraries have been moved from the root to a `<platform>/<arch>/<module>/` subfolder.
* `<platform>`: one of `linux`, `macos`, `windows`.
Expand Down

0 comments on commit cd8a012

Please sign in to comment.