changeset 241:1c91b76fd9a3

USASR-2436: Remove usages of leftShift in favor of doLast
author Christopher Springer <springer@nwoca.org>
date Wed, 21 Dec 2016 13:22:44 +0000
parents 05a1bbd319bc
children f88fe4898ee5
files init20.gradle
diffstat 1 files changed, 60 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/init20.gradle	Tue Oct 25 16:43:00 2016 +0100
+++ b/init20.gradle	Wed Dec 21 13:22:44 2016 +0000
@@ -179,19 +179,21 @@
         }
     }
 
-    task cleanLocal(description: "removes all artifacts from developer's local repository") << {
+    task cleanLocal(description: "removes all artifacts from developer's local repository") {
 
-        def local = project.repositories.find { it.name == 'local' }
-        if (local) {
-            logger.info "removing local repo: $it"
-            new File(System.properties['user.home'] + "/.ssdt/local-repo").deleteDir()
-            def localDir = new File(gradle.ivyUserDir + "/local")
-            localDir.deleteDir()
-            logger.info "verifying removal of local repo"
-            if (localDir.exists()) {
-                throw new org.gradle.api.GradleException("Unable to clean ${localDir}. Files may be locked by another process.")
-            }
-        }
+		doLast {
+			def local = project.repositories.find { it.name == 'local' }
+			if (local) {
+				logger.info "removing local repo: $it"
+				new File(System.properties['user.home'] + "/.ssdt/local-repo").deleteDir()
+				def localDir = new File(gradle.ivyUserDir + "/local")
+				localDir.deleteDir()
+				logger.info "verifying removal of local repo"
+				if (localDir.exists()) {
+					throw new org.gradle.api.GradleException("Unable to clean ${localDir}. Files may be locked by another process.")
+				}
+			}
+		}
     }
 
     cleanLocal.onlyIf {
@@ -292,39 +294,41 @@
 
             task('doReleaseBranch') {
                 ext.requested = matcher[0][1].toLowerCase()
-            } << {
-                def releaseVersion = determineReleaseVersion(requested)
-                def releaseStream = releaseVersion.isHotfix() ? 'hotfix' : 'release'
+				doLast {
+					def releaseVersion = determineReleaseVersion(requested)
+					def releaseStream = releaseVersion.isHotfix() ? 'hotfix' : 'release'
 
-                println "-" * 60
-                println "Preparing to create branch\n"
-                println "\tproject:\t${gradle.rootProject.name}"
-                println "\tcurrent:\t${gradle.branch} ($gradle.branch.version)"
-                println()
-                println "\ttype   :\t${releaseStream.toUpperCase()}"
-                println "\tversion:\t${releaseVersion}"
-                println "\ttarget :\t${releaseStream}/v${releaseVersion}"
-                println()
-                println("-" * 60)
-                println "DRY RUN".center(60)
-                println("-" * 60)
+					println "-" * 60
+					println "Preparing to create branch\n"
+					println "\tproject:\t${gradle.rootProject.name}"
+					println "\tcurrent:\t${gradle.branch} ($gradle.branch.version)"
+					println()
+					println "\ttype   :\t${releaseStream.toUpperCase()}"
+					println "\tversion:\t${releaseVersion}"
+					println "\ttarget :\t${releaseStream}/v${releaseVersion}"
+					println()
+					println("-" * 60)
+					println "DRY RUN".center(60)
+					println("-" * 60)
 
-                println "hg flow ${releaseStream} start v${releaseVersion} --dirty --dry-run".execute().text
+					println "hg flow ${releaseStream} start v${releaseVersion} --dirty --dry-run".execute().text
 
-                println "-" * 60
+					println "-" * 60
 
-                if (!confirmPrompt("Continue?")) {
-                    throw new BuildCancelledException("release branching canceled by user request")
-                }
+					if (!confirmPrompt("Continue?")) {
+						throw new BuildCancelledException("release branching canceled by user request")
+					}
 
-                println "hg flow ${releaseStream} start v${releaseVersion} --dirty".execute().text
-                println "hg update ${releaseStream}/v${releaseVersion}".execute().text
+					println "hg flow ${releaseStream} start v${releaseVersion} --dirty".execute().text
+					println "hg update ${releaseStream}/v${releaseVersion}".execute().text
+				}
+            } 
 
-            }
-
-            task('doCommitLock') << {
-                println 'hg status'.execute().text
-                println 'hg commit release.lock -A -m "lock dynamic dependencies for release"'.execute().text
+            task('doCommitLock') {
+				doLast {
+					println 'hg status'.execute().text
+					println 'hg commit release.lock -A -m "lock dynamic dependencies for release"'.execute().text
+				}
             }
 
             def branchTasks = ['doReleaseBranch', 'deleteGlobalLock', 'generateGlobalLock', 'saveGlobalLock', 'doCommitLock']
@@ -489,20 +493,23 @@
 }
 
 
-task showEnvironments << {
-    println "Defined environments: $gradle.environments"
-    gradle.environments.each { e ->
-        println "\n $e:"
-        gradle.getProperty(e).flatten().sort { it.key }.each { k, v ->
-            println String.format('  %25s = %s', k, k.contains('password') ? "********" : v)
-        }
-    }
-    if (logger.isInfoEnabled()) {
-        println "System properties:"
-        System.properties.each { println "    $it" }
-        println "env variables:"
-        System.getenv().each { println "    $it" }
-    }
+task showEnvironments {
+	
+	doLast {
+		println "Defined environments: $gradle.environments"
+		gradle.environments.each { e ->
+			println "\n $e:"
+			gradle.getProperty(e).flatten().sort { it.key }.each { k, v ->
+				println String.format('  %25s = %s', k, k.contains('password') ? "********" : v)
+			}
+		}
+		if (logger.isInfoEnabled()) {
+			println "System properties:"
+			System.properties.each { println "    $it" }
+			println "env variables:"
+			System.getenv().each { println "    $it" }
+		}
+	}
 }
 
 def loadEnvironments() {