markusthoemmes commented on a change in pull request #2479: Ensure Proper Order 
of CLI Build Tasks
URL: 
https://github.com/apache/incubator-openwhisk/pull/2479#discussion_r137985522
 
 

 ##########
 File path: tools/cli/build.gradle
 ##########
 @@ -11,39 +11,33 @@ task removeBinary(type: Delete) {
     delete "${projectDir}/../../bin/windows"
 }
 
-task distBinary(dependsOn: [removeBinary, distDocker]) {
+task distBinary() {
     doLast {
+        // Copy all Go binaries from Docker into openwhisk/bin folder
         run(dockerBinary + ["rm", "-f", dockerContainerName], true)
         run(dockerBinary + ["run", "--name", dockerContainerName, 
dockerTaggedImageName])
-
-        // Copy all Go binaries from Docker into openwhisk/bin folder
-        run(dockerBinary + ["cp", dockerContainerName +
-                ":/src/github.com/go-whisk-cli/build/.", 
"${projectDir}/../../bin"])
-
+        run(dockerBinary + ["cp", dockerContainerName + 
":/src/github.com/go-whisk-cli/build/.", "${projectDir}/../../bin"])
         run(dockerBinary + ["rm", "-f", dockerContainerName])
     }
 }
 
-task dumpOSInfo {
+task copyCLIShortcut() {
     doLast {
-        println "os.name = "+getOsName()
-        println "os.arch = "+getOsArch()
-        println "go.name = "+mapOsNameToGoName(getOsName())
-        println "go.arch = "+mapOsArchToGoArch(getOsArch())
+        String go_osname = mapOsNameToGoName(getOsName())
+        String go_osarch = mapOsArchToGoArch(getOsArch())
+        String from_path_wsk = 
"${projectDir}/../../bin/${go_osname}/${go_osarch}/wsk"
+        String to_path_dir = "${projectDir}/../../bin"
+
+        exec {
+            executable "cp"
+            args "${from_path_wsk}", "${to_path_dir}"
+        }
     }
 }
 
-task copyCLIShortcut(type: Copy, dependsOn: [distBinary, dumpOSInfo]) {
-    String go_osname     = mapOsNameToGoName(getOsName())
-    String go_osarch     = mapOsArchToGoArch(getOsArch())
-    String from_path_wsk = 
"${projectDir}/../../bin/${go_osname}/${go_osarch}/wsk"
-    String to_path_dir   = "${projectDir}/../../bin"
-
-    from from_path_wsk
-    into to_path_dir
-}
-
-pushImage.finalizedBy copyCLIShortcut
+distBinary.dependsOn removeBinary
+distBinary.finalizedBy copyCLIShortcut
+pushImage.finalizedBy distBinary
 
 Review comment:
   If you make the changes suggested above, the `pushImage.finalizedBy 
distBinary` is the only connection left. I suggest moving that just below the 
definition of `distBinary` then to keep the context.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to