Skip to content

Commit e48041e

Browse files
committed
first publishing support
1 parent ee300a9 commit e48041e

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

gradle/platform/build.gradle.kts

+26-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import groovy.xml.slurpersupport.NodeChild
44

55
plugins {
66
`java-platform`
7+
`maven-publish`
78
}
89

910
tasks {
@@ -12,9 +13,13 @@ tasks {
1213
}
1314
}
1415

16+
operator fun GPathResult.div(child: String) = children().find { (it!! as NodeChild).name() == child } as GPathResult
17+
18+
val effXml = XmlSlurper().parse("platform/eff.xml")
19+
1520
dependencies {
16-
operator fun GPathResult.div(child: String) = children().find { (it!! as NodeChild).name() == child } as GPathResult
17-
val deps = XmlSlurper().parse("platform/eff.xml") / "dependencyManagement" / "dependencies"
21+
22+
val deps = effXml / "dependencyManagement" / "dependencies"
1823
constraints {
1924
deps.children().forEach {
2025
val node = it!! as NodeChild
@@ -25,4 +30,22 @@ dependencies {
2530
// println("$g:$a:$v")
2631
}
2732
}
28-
}
33+
}
34+
35+
36+
37+
publishing {
38+
publications {
39+
repositories {
40+
maven("to fill")
41+
}
42+
create<MavenPublication>("sciJavaPlatform") {
43+
groupId = "org.scijava"
44+
artifactId = "pom-scijava"
45+
version = (effXml / "version").toString()
46+
47+
from(components["javaPlatform"])
48+
}
49+
}
50+
}
51+

0 commit comments

Comments
 (0)