Skip to content

Commit cd49b18

Browse files
authored
Publish Serial and IO libraries to Maven Central (#1421)
* serial: use jssc from maven instead of bundled jar * io: port from ant to gradle, add maven publishing * move io and net from legacy to regular library build * revert serial changes for separate pr * serial: add maven publishing, keep bundled jssc jar
1 parent 173f646 commit cd49b18

File tree

3 files changed

+144
-4
lines changed

3 files changed

+144
-4
lines changed

java/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ tasks.register<Copy>("copyCore"){
6868
into(coreProject.layout.projectDirectory.dir("library"))
6969
}
7070

71-
val legacyLibraries = arrayOf("io","net")
71+
val legacyLibraries = emptyArray<String>()
7272
legacyLibraries.forEach { library ->
7373
tasks.register<Copy>("library-$library-extraResources"){
7474
val build = project(":java:libraries:$library").tasks.named("build")
@@ -88,7 +88,7 @@ legacyLibraries.forEach { library ->
8888
}
8989
}
9090

91-
val libraries = arrayOf("dxf", "pdf", "serial", "svg")
91+
val libraries = arrayOf("dxf", "io", "net", "pdf", "serial", "svg")
9292

9393
libraries.forEach { library ->
9494
val name = "create-$library-library"

java/libraries/io/build.gradle.kts

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,92 @@
1-
ant.importBuild("build.xml")
1+
import com.vanniktech.maven.publish.SonatypeHost
2+
3+
plugins {
4+
java
5+
alias(libs.plugins.mavenPublish)
6+
}
7+
8+
sourceSets {
9+
main {
10+
java {
11+
srcDirs("src")
12+
}
13+
}
14+
}
15+
16+
repositories {
17+
mavenCentral()
18+
}
19+
20+
dependencies {
21+
compileOnly(project(":core"))
22+
}
23+
24+
tasks.register<Copy>("createLibrary") {
25+
dependsOn("jar")
26+
into(layout.buildDirectory.dir("library"))
27+
28+
from(layout.projectDirectory) {
29+
include("library.properties")
30+
include("examples/**")
31+
}
32+
33+
from(configurations.runtimeClasspath) {
34+
into("library")
35+
}
36+
37+
from(tasks.jar) {
38+
into("library")
39+
rename { "io.jar" }
40+
}
41+
42+
from(layout.projectDirectory.dir("library")) {
43+
include("linux-arm64/**")
44+
include("linux-armv6hf/**")
45+
include("linux32/**")
46+
include("linux64/**")
47+
into("library")
48+
}
49+
}
50+
51+
publishing {
52+
repositories {
53+
maven {
54+
name = "App"
55+
url = uri(project(":app").layout.buildDirectory.dir("resources-bundled/common/repository").get().asFile.absolutePath)
56+
}
57+
}
58+
}
59+
60+
mavenPublishing {
61+
coordinates("$group.core", name, version.toString())
62+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
63+
64+
signAllPublications()
65+
66+
pom {
67+
name.set("Processing IO")
68+
description.set("Processing IO")
69+
url.set("https://processing.org")
70+
licenses {
71+
license {
72+
name.set("LGPL")
73+
url.set("https://www.gnu.org/licenses/lgpl-2.1.html")
74+
}
75+
}
76+
developers {
77+
developer {
78+
id.set("steftervelde")
79+
name.set("Stef Tervelde")
80+
}
81+
developer {
82+
id.set("benfry")
83+
name.set("Ben Fry")
84+
}
85+
}
86+
scm {
87+
url.set("https://github.com/processing/processing4")
88+
connection.set("scm:git:git://github.com/processing/processing4.git")
89+
developerConnection.set("scm:git:ssh://git@github.com/processing/processing4.git")
90+
}
91+
}
92+
}

java/libraries/serial/build.gradle.kts

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import com.vanniktech.maven.publish.SonatypeHost
2+
13
plugins {
24
java
5+
alias(libs.plugins.mavenPublish)
36
}
47

58
sourceSets {
@@ -23,15 +26,61 @@ dependencies {
2326
tasks.register<Copy>("createLibrary") {
2427
dependsOn("jar")
2528
into(layout.buildDirectory.dir("library"))
29+
2630
from(layout.projectDirectory) {
2731
include("library.properties")
2832
include("examples/**")
2933
}
34+
3035
from(configurations.runtimeClasspath) {
3136
into("library")
3237
}
38+
3339
from(tasks.jar) {
3440
into("library")
3541
rename { "serial.jar" }
3642
}
37-
}
43+
}
44+
45+
publishing {
46+
repositories {
47+
maven {
48+
name = "App"
49+
url = uri(project(":app").layout.buildDirectory.dir("resources-bundled/common/repository").get().asFile.absolutePath)
50+
}
51+
}
52+
}
53+
54+
mavenPublishing {
55+
coordinates("$group.core", name, version.toString())
56+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
57+
58+
signAllPublications()
59+
60+
pom {
61+
name.set("Processing Serial")
62+
description.set("Processing Serial")
63+
url.set("https://processing.org")
64+
licenses {
65+
license {
66+
name.set("LGPL")
67+
url.set("https://www.gnu.org/licenses/lgpl-2.1.html")
68+
}
69+
}
70+
developers {
71+
developer {
72+
id.set("steftervelde")
73+
name.set("Stef Tervelde")
74+
}
75+
developer {
76+
id.set("benfry")
77+
name.set("Ben Fry")
78+
}
79+
}
80+
scm {
81+
url.set("https://github.com/processing/processing4")
82+
connection.set("scm:git:git://github.com/processing/processing4.git")
83+
developerConnection.set("scm:git:ssh://git@github.com/processing/processing4.git")
84+
}
85+
}
86+
}

0 commit comments

Comments
 (0)