incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [3/4] git commit: Adding conditional to determine what should be built
Date Fri, 13 Apr 2012 17:27:39 GMT
Adding conditional to determine what should be built


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/commit/b23b194a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/tree/b23b194a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/diff/b23b194a

Branch: refs/heads/master
Commit: b23b194aa59b95ed6690b2fe217d266cd4a164e9
Parents: 0c304ee
Author: macdonst <simon.macdonald@gmail.com>
Authored: Fri Apr 13 12:56:07 2012 -0400
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Fri Apr 13 12:59:06 2012 -0400

----------------------------------------------------------------------
 coho |   88 ++++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 56 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/b23b194a/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index e1095bf..830c822 100755
--- a/coho
+++ b/coho
@@ -1,5 +1,9 @@
 #!/usr/bin/env node
-VERSION = process.argv[2]
+PLATFORM = process.argv[2]
+if (!PLATFORM) {
+    PLATFORM = "all";
+}
+VERSION = process.argv[3]
 var util           = require('util')
 ,   exec           = require('child_process').exec
 ,   fs			   = require('fs')
@@ -69,7 +73,6 @@ function executeCommands(callback) {
 function checkSoftware() {
     var sw = requiredSoftware.shift();
     if (sw) {
-        console.log(sw);
 		child = exec("which " + sw, function (error, stdout, stderr) {
             if (stdout === "") {
                 console.log(sw + ' not found. Please install ' + sw + ' before continuing.');
@@ -88,48 +91,69 @@ queueCommand("rm -rf temp && mkdir temp && cd temp &&
mkdir repositories && mkdi
 queueCommand("cd temp/release && mkdir bin && mkdir src && cd bin
&& mkdir ios && mkdir android && mkdir blackberry && mkdir
windows && mkdir webos && mkdir symbian && mkdir bada");
 
 //ios
-queueCommand("cd " + tempRepoDir + " && git clone "+ios+" && cd "+iosdir+"
&& git fetch --tags && git checkout "+VERSION);
-queueCommand("cd " + tempRepoDir + " && cp -r " + iosdir + " " + releaseSrcDir);
-queueCommand("cd " + tempRepoDir + "/"+iosdir+" && make");
-queueCommand("cd " + tempRepoDir + "/"+iosdir+"/dist && cp -r Cordova-"+VERSION+".dmg
" + iosReleaseBinDir + " && cp -r Cordova-"+VERSION+".dmg.SHA1 " + iosReleaseBinDir);
-queueCommand("cd " + tempRepoDir + "/"+iosdir+" && cp NOTICE ../../release/bin/ios");
+if (PLATFORM === "all" || PLATFORM === "ios") {
+    queueCommand("echo 'Building iOS'");
+    queueCommand("cd " + tempRepoDir + " && git clone "+ios+" && cd "+iosdir+"
&& git fetch --tags && git checkout "+VERSION);
+    queueCommand("cd " + tempRepoDir + " && cp -r " + iosdir + " " + releaseSrcDir);
+    queueCommand("cd " + tempRepoDir + "/"+iosdir+" && make");
+    queueCommand("cd " + tempRepoDir + "/"+iosdir+"/dist && cp -r Cordova-"+VERSION+".dmg
" + iosReleaseBinDir + " && cp -r Cordova-"+VERSION+".dmg.SHA1 " + iosReleaseBinDir);
+    queueCommand("cd " + tempRepoDir + "/"+iosdir+" && cp NOTICE ../../release/bin/ios");
+}
 
 //blackberry
-queueCommand("cd " + tempRepoDir + " && git clone "+blackberry+" && cd "+blackberrydir+"
&& git fetch --tags && git checkout "+VERSION);
-queueCommand("cd " + tempRepoDir + " && cp -r " + blackberrydir + " " + releaseSrcDir);
-queueCommand("cd " + tempRepoDir + "/"+blackberrydir+" && ant dist");
-queueCommand("cd " + tempRepoDir + "/"+blackberrydir+"/dist && cp -r ./* " + blackberryReleaseBinDir);
-queueCommand("cd " + tempRepoDir + "/"+blackberrydir+" && cp NOTICE ../../release/bin/blackberry");
+if (PLATFORM === "all" || PLATFORM === "blackberry") {
+    queueCommand("echo 'Building BlackBerry'");
+    queueCommand("cd " + tempRepoDir + " && git clone "+blackberry+" && cd
"+blackberrydir+" && git fetch --tags && git checkout "+VERSION);
+    queueCommand("cd " + tempRepoDir + " && cp -r " + blackberrydir + " " + releaseSrcDir);
+    queueCommand("cd " + tempRepoDir + "/"+blackberrydir+" && ant dist");
+    queueCommand("cd " + tempRepoDir + "/"+blackberrydir+"/dist && cp -r ./* " +
blackberryReleaseBinDir);
+    queueCommand("cd " + tempRepoDir + "/"+blackberrydir+" && cp NOTICE ../../release/bin/blackberry");
+}
 
 //android
-queueCommand("cd " + tempRepoDir + " && git clone "+android+" && cd "+androiddir+"
&& git fetch --tags && git checkout "+VERSION);
-queueCommand("cd " + tempRepoDir + " && cp -r " + androiddir + " " + releaseSrcDir);
-queueCommand("cd " + tempRepoDir + "/"+androiddir+" && cp LICENSE " + androidReleaseLicense
+ " && cp VERSION " + androidReleaseVersion + " && cp README.md " + androidReleaseBinDir
+ " && cp NOTICE " + androidReleaseBinDir);
-queueCommand("cd " + tempRepoDir + "/"+androiddir+" && ant clean");
-queueCommand("cd " + tempRepoDir + "/"+androiddir+" && ./bin/create");
-queueCommand("cd " + tempRepoDir + "/"+androiddir+" && cp -rp example " + androidReleaseBinDir
+ "/example");
-queueCommand("cd " + tempRepoDir + "/"+androiddir+"/example && cp libs/cordova-"+VERSION+".jar
../" + androidReleaseBinDir);
-queueCommand("cd " + tempRepoDir + "/"+androiddir+"/example && cp assets/www/cordova-"+VERSION+".js
../" + androidReleaseBinDir);
-queueCommand("cd " + tempRepoDir + "/"+androiddir+"/example && cp -r res/xml ../"
+ androidReleaseBinDir);
+if (PLATFORM === "all" || PLATFORM === "android") {
+    queueCommand("echo 'Building Android'");
+    queueCommand("cd " + tempRepoDir + " && git clone "+android+" && cd "+androiddir+"
&& git fetch --tags && git checkout "+VERSION);
+    queueCommand("cd " + tempRepoDir + " && cp -r " + androiddir + " " + releaseSrcDir);
+    queueCommand("cd " + tempRepoDir + "/"+androiddir+" && cp LICENSE " + androidReleaseLicense
+ " && cp VERSION " + androidReleaseVersion + " && cp README.md " + androidReleaseBinDir
+ " && cp NOTICE " + androidReleaseBinDir);
+    queueCommand("cd " + tempRepoDir + "/"+androiddir+" && ant clean");
+    queueCommand("cd " + tempRepoDir + "/"+androiddir+" && ./bin/create");
+    queueCommand("cd " + tempRepoDir + "/"+androiddir+" && cp -rp example " + androidReleaseBinDir
+ "/example");
+    queueCommand("cd " + tempRepoDir + "/"+androiddir+"/example && cp libs/cordova-"+VERSION+".jar
../" + androidReleaseBinDir);
+    queueCommand("cd " + tempRepoDir + "/"+androiddir+"/example && cp assets/www/cordova-"+VERSION+".js
../" + androidReleaseBinDir);
+    queueCommand("cd " + tempRepoDir + "/"+androiddir+"/example && cp -r res/xml
../" + androidReleaseBinDir);
+}
 
 //windows phone
-queueCommand("cd " + tempRepoDir + " && git clone "+windows+" && cd "+windowsdir+"
&& git fetch --tags && git checkout "+VERSION);
-queueCommand("cd " + tempRepoDir + " && cp -r " + windowsdir + " " + releaseSrcDir);
-queueCommand("cd " + tempRepoDir + "/"+windowsdir+" && cp -r ./* " + windowsReleaseBinDir);
+if (PLATFORM === "all" || PLATFORM === "wp") {
+    queueCommand("echo 'Building Windows Phone'");
+    queueCommand("cd " + tempRepoDir + " && git clone "+windows+" && cd "+windowsdir+"
&& git fetch --tags && git checkout "+VERSION);
+    queueCommand("cd " + tempRepoDir + " && cp -r " + windowsdir + " " + releaseSrcDir);
+    queueCommand("cd " + tempRepoDir + "/"+windowsdir+" && cp -r ./* " + windowsReleaseBinDir);
+}
 
 //webos
-queueCommand("cd " + tempRepoDir + " && git clone "+webos+" && cd "+webosdir+"
&& git fetch --tags && git checkout "+VERSION);
-queueCommand("cd " + tempRepoDir + " && cp -r " + webosdir + " " + releaseSrcDir);
-queueCommand("cd " + tempRepoDir + "/"+webosdir+" && cp -r ./* " + webosReleaseBinDir);
+if (PLATFORM === "all" || PLATFORM === "webos") {
+    queueCommand("echo 'Building WebOS'");
+    queueCommand("cd " + tempRepoDir + " && git clone "+webos+" && cd "+webosdir+"
&& git fetch --tags && git checkout "+VERSION);
+    queueCommand("cd " + tempRepoDir + " && cp -r " + webosdir + " " + releaseSrcDir);
+    queueCommand("cd " + tempRepoDir + "/"+webosdir+" && cp -r ./* " + webosReleaseBinDir);
+}
 
 //bada
-queueCommand("cd " + tempRepoDir + " && git clone "+bada+" && cd "+badadir+"
&& git fetch --tags && git checkout "+VERSION);
-queueCommand("cd " + tempRepoDir + " && cp -r " + badadir + " " + releaseSrcDir);
-queueCommand("cd " + tempRepoDir + "/"+badadir+" && cp -r ./* " + badaReleaseBinDir);
+if (PLATFORM === "all" || PLATFORM === "bada") {
+    queueCommand("echo 'Building Bada'");
+    queueCommand("cd " + tempRepoDir + " && git clone "+bada+" && cd "+badadir+"
&& git fetch --tags && git checkout "+VERSION);
+    queueCommand("cd " + tempRepoDir + " && cp -r " + badadir + " " + releaseSrcDir);
+    queueCommand("cd " + tempRepoDir + "/"+badadir+" && cp -r ./* " + badaReleaseBinDir);
+}
 
 //docs
-queueCommand("cd " + tempRepoDir + " && git clone "+docs+" && cd "+docsdir+"
&& git fetch --tags && git checkout "+VERSION);
-queueCommand("cd " + tempRepoDir + "/"+docsdir+" && ./bin/generate && cp
-r public/en/"+VERSION+" " + releaseDocDir);
+if (PLATFORM === "all" || PLATFORM === "docs") {
+    queueCommand("echo 'Building Documentation'");
+    queueCommand("cd " + tempRepoDir + " && git clone "+docs+" && cd "+docsdir+"
&& git fetch --tags && git checkout "+VERSION);
+    queueCommand("cd " + tempRepoDir + "/"+docsdir+" && ./bin/generate &&
cp -r public/en/"+VERSION+" " + releaseDocDir);
+}
 
 //symbian
 fs.writeFile('depreciate.txt', 'PhoneGap-Symbian is being depreciated. You can find the last
available code at https://github.com/callback/callback-symbian.', function (err) {


Mime
View raw message