Skip to content

Commit 7027cfa

Browse files
committed
Gradle - replace leftShift with doLast
1 parent 8fa78e2 commit 7027cfa

File tree

4 files changed

+68
-60
lines changed

4 files changed

+68
-60
lines changed

gradle/docs.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ task groovydoc(type:org.groovy.lang.groovydoc.tasks.GroovydocTask) {
9898
}
9999
}
100100

101-
task fetchGrailsDocsSource << {
102-
ant {
103-
mkdir dir: buildDir
104-
get src:"http://nodeload.github.com/grails/grails-doc/zipball/master", dest:"${buildDir}/grails-docs-src.zip", verbose:"true"
105-
unzip(src: "${buildDir}/grails-docs-src.zip", dest: buildDir) {
106-
mapper type: 'regexp', from:/(grails-grails-doc-[\w]*\/)(.*)/, to:/grails-docs-src\/\2/
101+
task fetchGrailsDocsSource {
102+
doLast {
103+
ant {
104+
mkdir dir: buildDir
105+
get src:"http://nodeload.github.com/grails/grails-doc/zipball/master", dest:"${buildDir}/grails-docs-src.zip", verbose:"true"
106+
unzip(src: "${buildDir}/grails-docs-src.zip", dest: buildDir) {
107+
mapper type: 'regexp', from:/(grails-grails-doc-[\w]*\/)(.*)/, to:/grails-docs-src\/\2/
108+
}
107109
}
108110
}
109111
}

gradle/findbugs.gradle

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
// To use findbugs you must have findbugs installed. Additionally you need a property called findbugsHome. You can define this
22
// in ~/.gradle/gradle.properties
33

4-
task findbugs(dependsOn: install) << {
5-
ant {
6-
taskdef(name: "findbugs", classname: "edu.umd.cs.findbugs.anttask.FindBugsTask", classpath: "$findbugsHome/lib/findbugs-ant.jar")
7-
mkdir dir: "$buildDir/findbugs-report"
8-
findbugs(home: findbugsHome, output: "xml:withMessages", outputFile: "$buildDir/findbugs-report/grails-fb.xml", jvmargs: "-Xmx768M") {
9-
auxClasspath() {
10-
for(sub in subprojects) {
11-
pathElement(path: sub.sourceSets.main.compileClasspath.asPath)
4+
task findbugs(dependsOn: install) {
5+
doLast {
6+
ant {
7+
taskdef(name: "findbugs", classname: "edu.umd.cs.findbugs.anttask.FindBugsTask", classpath: "$findbugsHome/lib/findbugs-ant.jar")
8+
mkdir dir: "$buildDir/findbugs-report"
9+
findbugs(home: findbugsHome, output: "xml:withMessages", outputFile: "$buildDir/findbugs-report/grails-fb.xml", jvmargs: "-Xmx768M") {
10+
auxClasspath() {
11+
for (sub in subprojects) {
12+
pathElement(path: sub.sourceSets.main.compileClasspath.asPath)
13+
}
1214
}
13-
}
14-
sourcePath() {
15-
for (sub in subprojects) {
16-
sub.sourceSets.main.groovy.srcDirs.each { srcDir ->
17-
if (srcDir.exists()) {
18-
pathElement(path: srcDir.absolutePath)
15+
sourcePath() {
16+
for (sub in subprojects) {
17+
sub.sourceSets.main.groovy.srcDirs.each { srcDir ->
18+
if (srcDir.exists()) {
19+
pathElement(path: srcDir.absolutePath)
20+
}
1921
}
2022
}
2123
}
24+
auxAnalyzepath() {
25+
fileset dir: homeDistDir, includes: "grails-*.jar"
26+
}
2227
}
23-
auxAnalyzepath() {
24-
fileset dir: homeDistDir, includes: "grails-*.jar"
25-
}
28+
xslt(in: "$buildDir/findbugs-report/grails-fb.xml", out: "$buildDir/findbugs-report/grails-fb.html", style: "$findbugsHome/src/xsl/fancy.xsl")
2629
}
27-
xslt(in: "$buildDir/findbugs-report/grails-fb.xml", out: "$buildDir/findbugs-report/grails-fb.html", style: "$findbugsHome/src/xsl/fancy.xsl")
2830
}
2931
}

grails-bom/build.gradle

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,26 @@ dependencies {
1010
mavenAntTasks 'org.apache.maven:maven-ant-tasks:2.1.1'
1111
}
1212

13-
task uploadArchives(dependsOn:project.tasks.withType(PublishToMavenLocal)) << {
14-
def antBuilder = services.get(IsolatedAntBuilder)
15-
def rootDir = project.parent.projectDir
16-
antBuilder.withClasspath(configurations.mavenAntTasks).execute {
17-
taskdef(resource: 'org/apache/maven/artifact/ant/antlib.xml')
18-
def isSnapshot = version.endsWith("-SNAPSHOT")
19-
def url = isSnapshot ? "https://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
20-
def repoId = isSnapshot ? "sonatype-nexus-snapshots" : "sonatype-nexus-staging"
21-
mvn {
22-
arg value:"org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file"
23-
arg value:"-Dgpg.homedir=${rootDir.absolutePath}"
24-
arg value:"-Dgpg.keyname=${System.getenv("SIGNING_KEY")}"
25-
arg value:"-Dgpg.passphrase=${System.getenv("SIGNING_PASSWORD")}"
26-
arg value:"-Durl=${url}"
27-
arg value:"-DrepositoryId=${repoId}"
28-
arg value:"-DpomFile=${buildDir}/publications/maven/pom-default.xml"
29-
arg value:"-Dfile=${buildDir}/publications/maven/pom-default.xml"
30-
arg value:"-Pgpg"
13+
task uploadArchives(dependsOn:project.tasks.withType(PublishToMavenLocal)) {
14+
doLast {
15+
def antBuilder = services.get(IsolatedAntBuilder)
16+
def rootDir = project.parent.projectDir
17+
antBuilder.withClasspath(configurations.mavenAntTasks).execute {
18+
taskdef(resource: 'org/apache/maven/artifact/ant/antlib.xml')
19+
def isSnapshot = version.endsWith("-SNAPSHOT")
20+
def url = isSnapshot ? "https://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
21+
def repoId = isSnapshot ? "sonatype-nexus-snapshots" : "sonatype-nexus-staging"
22+
mvn {
23+
arg value: "org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file"
24+
arg value: "-Dgpg.homedir=${rootDir.absolutePath}"
25+
arg value: "-Dgpg.keyname=${System.getenv("SIGNING_KEY")}"
26+
arg value: "-Dgpg.passphrase=${System.getenv("SIGNING_PASSWORD")}"
27+
arg value: "-Durl=${url}"
28+
arg value: "-DrepositoryId=${repoId}"
29+
arg value: "-DpomFile=${buildDir}/publications/maven/pom-default.xml"
30+
arg value: "-Dfile=${buildDir}/publications/maven/pom-default.xml"
31+
arg value: "-Pgpg"
32+
}
3133
}
3234
}
3335
}

grails-dependencies/build.gradle

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,26 @@ dependencies {
1010
mavenAntTasks 'org.apache.maven:maven-ant-tasks:2.1.1'
1111
}
1212

13-
task uploadArchives(dependsOn:project.tasks.withType(PublishToMavenLocal)) << {
14-
def antBuilder = services.get(IsolatedAntBuilder)
15-
def rootDir = project.parent.projectDir
16-
antBuilder.withClasspath(configurations.mavenAntTasks).execute {
17-
taskdef(resource: 'org/apache/maven/artifact/ant/antlib.xml')
18-
def isSnapshot = version.endsWith("-SNAPSHOT")
19-
def url = isSnapshot ? "https://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
20-
def repoId = isSnapshot ? "sonatype-nexus-snapshots" : "sonatype-nexus-staging"
21-
mvn {
22-
arg value:"org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file"
23-
arg value:"-Dgpg.homedir=${rootDir.absolutePath}"
24-
arg value:"-Dgpg.keyname=${System.getenv("SIGNING_KEY")}"
25-
arg value:"-Dgpg.passphrase=${System.getenv("SIGNING_PASSWORD")}"
26-
arg value:"-Durl=${url}"
27-
arg value:"-DrepositoryId=${repoId}"
28-
arg value:"-DpomFile=${buildDir}/publications/maven/pom-default.xml"
29-
arg value:"-Dfile=${buildDir}/publications/maven/pom-default.xml"
30-
arg value:"-Pgpg"
13+
task uploadArchives(dependsOn:project.tasks.withType(PublishToMavenLocal)) {
14+
doLast {
15+
def antBuilder = services.get(IsolatedAntBuilder)
16+
def rootDir = project.parent.projectDir
17+
antBuilder.withClasspath(configurations.mavenAntTasks).execute {
18+
taskdef(resource: 'org/apache/maven/artifact/ant/antlib.xml')
19+
def isSnapshot = version.endsWith("-SNAPSHOT")
20+
def url = isSnapshot ? "https://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
21+
def repoId = isSnapshot ? "sonatype-nexus-snapshots" : "sonatype-nexus-staging"
22+
mvn {
23+
arg value:"org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file"
24+
arg value:"-Dgpg.homedir=${rootDir.absolutePath}"
25+
arg value:"-Dgpg.keyname=${System.getenv("SIGNING_KEY")}"
26+
arg value:"-Dgpg.passphrase=${System.getenv("SIGNING_PASSWORD")}"
27+
arg value:"-Durl=${url}"
28+
arg value:"-DrepositoryId=${repoId}"
29+
arg value:"-DpomFile=${buildDir}/publications/maven/pom-default.xml"
30+
arg value:"-Dfile=${buildDir}/publications/maven/pom-default.xml"
31+
arg value:"-Pgpg"
32+
}
3133
}
3234
}
3335
}

0 commit comments

Comments
 (0)