Skip to content

Commit

Permalink
gradle starter project #756
Browse files Browse the repository at this point in the history
  • Loading branch information
jknack committed Oct 9, 2017
1 parent 4484a92 commit 3113ca5
Show file tree
Hide file tree
Showing 8 changed files with 618 additions and 41 deletions.
2 changes: 1 addition & 1 deletion build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ mvn -Dalpn-boot-version=$ALPN_VERSION -pl '!modules/coverage-report' clean deplo

cd modules/jooby-bom

groovy bom.groovy ../../pom.xml > pom.xml
groovy bom.groovy > pom.xml

mvn -Dalpn-boot-version=$ALPN_VERSION clean deploy -P sonatype-oss-release
22 changes: 17 additions & 5 deletions modules/jooby-bom/bom.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
// usage: groovy bom.groovy ../pom.xml > pom.xml
import groovy.xml.*

def xml = new XmlSlurper().parse(new File(args[0]));
def jooby = new XmlSlurper().parse(new File("../../pom.xml"));
def modules = new XmlSlurper().parse(new File("../pom.xml"));
def sw = new StringWriter()
def b = new MarkupBuilder(sw)
def props = new StringWriter()
def deps = new MarkupBuilder(sw)
def bprops = new MarkupBuilder(props)
def template = new java.io.File("pom.template.xml").getText("UTF-8")

b.dependencies {
for (m in xml.modules.module) {
deps.dependencies {
for (m in modules.modules.module) {
if (m.text().endsWith('-bom') || m.text().contains('coverage-report')) continue;
dependency {
groupId('${project.groupId}');
Expand All @@ -18,4 +21,13 @@ b.dependencies {
}
}

println template.replace("@version", xml.version.text()).replace("@dependencies", sw.toString())
bprops.properties {
"jooby.version"(jooby.version.text())
jooby.properties.each {properties ->
properties.children().each {property ->
"${property.name()}"("${property.text()}")
}
}
}

println template.replace("@version", jooby.version.text()).replace("@dependencies", sw.toString()).replace("@properties", props.toString())
15 changes: 1 addition & 14 deletions modules/jooby-bom/pom.template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,7 @@
<name>jooby-bom</name>
<description>Jooby (Bill of Materials)</description>
<url>https://github.com/jooby-project/jooby</url>
<properties>
<jooby.version>@version</jooby.version>

<maven-release-plugin.version>2.5.1</maven-release-plugin.version>
<maven-source-plugin.version>2.4</maven-source-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<maven-javadoc-plugin.version>2.10.1</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
<maven-enforcer-plugin.version>1.3.1</maven-enforcer-plugin.version>
<maven-surefire-plugin.version>2.17</maven-surefire-plugin.version>
<maven-eclipse-plugin.version>2.9</maven-eclipse-plugin.version>
<maven-java-formatter-plugin.version>0.4</maven-java-formatter-plugin.version>
<nexus-staging-maven-plugin.version>1.6.5</nexus-staging-maven-plugin.version>
</properties>
@properties
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
Expand Down
Loading

0 comments on commit 3113ca5

Please sign in to comment.