You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sg...@apache.org on 2014/11/24 07:47:51 UTC

cordova-medic git commit: CB-8033 Replaced "coho repo-clone" step by downloading repos from custom urls from repos.json

Repository: cordova-medic
Updated Branches:
  refs/heads/master f64c7dd84 -> 4767f52d4


CB-8033 Replaced "coho repo-clone" step by downloading repos
 from custom urls from repos.json

github: close #19


Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/4767f52d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/4767f52d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/4767f52d

Branch: refs/heads/master
Commit: 4767f52d4f29f9ea42846331a256defe0835401b
Parents: f64c7dd
Author: maria.bukharina <ma...@akvelon.com>
Authored: Tue Nov 18 18:03:44 2014 +0300
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Nov 24 09:46:32 2014 +0300

----------------------------------------------------------------------
 checkout.js | 46 ++++++++++++----------------------------------
 master.cfg  | 13 +++++--------
 repos.json  | 31 +++++++++++++++++++++----------
 3 files changed, 38 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/4767f52d/checkout.js
----------------------------------------------------------------------
diff --git a/checkout.js b/checkout.js
index 7aee228..bbe4653 100644
--- a/checkout.js
+++ b/checkout.js
@@ -13,47 +13,25 @@ function getDir(reponame) {
    return path.basename(reponame,'.git');
 }
 
-function hasRemote (remote) {
-    get_remote = shell.exec('git remote -v');
-    if (get_remote.code > 0) {
-        return false;
-    }
-    var remotes = get_remote.output.split('\n');
-    for (var i in remotes){
-        if (remotes[i].indexOf(remote) > -1){
-            return true;
-        }
-    }
-    return false;
-}
-
-if(argv.cat) CAT=argv.cat;
-if(argv.release) isRelease=true;
-if(argv.path) jsonpath=argv.path;
-if(argv.releasebranch) branch_release= argv.releasebranch;
+if(argv.cat) CAT = argv.cat;
+if(argv.release) isRelease = true;
+if(argv.path) jsonpath = argv.path;
+if(argv.releasebranch) branch_release = argv.releasebranch;
 
 var repos = JSON.parse(fs.readFileSync(jsonpath, 'utf8'));
 
 repos.repos.forEach( function(repo) {
-    // console.log('checking '+JSON.stringify(repo));
-    if(repo.category == CAT) {
+    if(repo.category == CAT.toUpperCase()) {
         var branch = isRelease ? repo.release : repo.current;
-        branch = branch =="RELEASE" ? branch_release : branch;
+        branch = branch == "RELEASE" ? branch_release : branch;
         var dir = getDir(repo.repo);
         var remotename = path.basename(path.dirname(repo.repo));
-        if(fs.existsSync(dir) && fs.statSync(dir).isDirectory() ) {
-            shell.pushd(dir);
-            if(fs.existsSync('.git')) {
-                // Check if remote from repos.json already added to local repo
-                if (!hasRemote(repo.repo)){
-                    // If not, then add it, and checkout branch from there
-                    console.log('Adding remote: ' + remotename + ' ' + repo.repo);
-                    var remote_add = shell.exec('git remote add -f ' + remotename + ' ' + repo.repo + ' -t ' + branch);
-                }
-                console.log('Checking branch ' + branch);
-                var checkout = shell.exec('git checkout ' + branch);
-            }
-            shell.popd();
+
+        if(fs.existsSync(dir + '/.git')) {
+            console.log('Repo ' + repo.repo + ' has already cloned!');
+            process.exit(1);
+        } else {
+            shell.exec('git clone ' + repo.repo + ' --branch=' + branch + ' --depth ' + '1');
         }
     }
 });

http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/4767f52d/master.cfg
----------------------------------------------------------------------
diff --git a/master.cfg b/master.cfg
index 47f6cc8..47b35c6 100644
--- a/master.cfg
+++ b/master.cfg
@@ -195,7 +195,7 @@ class PlatformTestBase(object):
     def init_workspace_steps(self):
         return [
             ShellCommand(command=["rm", "-rf", "~/.cordova/" + self.platform], workdir='build', haltOnFailure=False, description='Remove cache'),
-            ShellCommand(command=["rm", "-rf", "medic", "mobilespec", "cordova-mobile-spec", "cordova-coho", "cordova-cli", "cordova-lib"], workdir='build', haltOnFailure=False, description='Clean workdir'),
+            ShellCommand(command=["rm", "-rf", "*"], workdir='build', haltOnFailure=False, description='Clean workdir'),
             ShellCommand(command=["git", "clone", "-b", branches['TESTMASTER'], repos['TESTMASTER'], "medic"], workdir='build', haltOnFailure=True, description='Get Medic'),
             # --production switch is used to speed up installation + fruitstrap dev dependency is not supported on Windows
             ShellCommand(command=["npm", "install", "--production"], workdir='build/medic', haltOnFailure=True, description='Install Medic'),
@@ -210,14 +210,11 @@ class PlatformTestBase(object):
         # required by coho tools to correctly resolve repo location
         if platform == "blackberry10":
             platform = "blackberry"
-        if platform == "wp8":
-            platform = "windowsphone"
         return [
-            ShellCommand(command=["./cordova-coho/coho", "repo-clone", "-r", "plugins", "-r", "mobile-spec", "-r", platform, "-r", "js"], workdir='build', haltOnFailure=True, description='COHO Clone'),
-            ShellCommand(command=["./cordova-coho/coho", "repo-update", "-r", "plugins", "-r", "mobile-spec", "-r", platform, "-r", "js"], workdir='build', haltOnFailure=True, description='COHO Update'),
-            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=PLUGIN", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=False, description='Checkout Plugins'),
-            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=PLATFORM", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=False, description='Checkout Platform'),
-            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=JS", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=False, description='Checkout JS')
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=MSPEC", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=True, description='Clone Mobilespec'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=PLUGIN", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=True, description='Clone Plugins'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=" + platform, "--releasebranch=" + branch_release], workdir='build', haltOnFailure=True, description='Clone Platform'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=JS", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=True, description='Clone JS')
         ]
 
     def create_app_steps(self):

http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/4767f52d/repos.json
----------------------------------------------------------------------
diff --git a/repos.json b/repos.json
index ca7cf0e..174cf14 100644
--- a/repos.json
+++ b/repos.json
@@ -98,10 +98,10 @@
 },
 {
     "title" : "TESTMASTER",
-    "repo" : "http://github.com/msopentech/cordova-medic",
+    "repo" : "https://git-wip-us.apache.org/repos/asf/cordova-medic.git",
     "category" : "TESTMASTER",
-    "release" : "windows-fixes",
-    "current" : "windows-fixes"
+    "release" : "master",
+    "current" : "master"
 },{
     "title" : "COHO",
     "repo" : "https://git-wip-us.apache.org/repos/asf/cordova-coho.git",
@@ -137,31 +137,31 @@
 },{
     "title" : "ANDROID",
     "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-android.git",
-    "category" : "PLATFORM",
+    "category" : "ANDROID",
     "release" : "RELEASE",
     "current" :"master"
 },{
     "title" : "IOS",
     "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-ios.git",
-    "category" : "PLATFORM",
+    "category" : "IOS",
     "release" : "RELEASE",
     "current" :"master"
 },{
     "title" : "WP8",
     "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-wp8.git",
-    "category" : "PLATFORM",
+    "category" : "WP8",
     "release" : "master",
     "current" :"master"
 },{
     "title" : "WINDOWS",
     "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-windows.git",
-    "category" : "PLATFORM",
+    "category" : "WINDOWS",
     "release" : "master",
     "current" :"master"
 },{
     "title" : "BLACKBERRY",
     "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-blackberry.git",
-    "category" : "PLATFORM",
+    "category" : "BLACKBERRY",
     "release" : "RELEASE",
     "current" :"master"
 },{
@@ -170,8 +170,13 @@
     "category" : "MSPEC",
     "release" : "master",
     "current" :"master"
-},
-{
+},{
+    "title" : "TESTFRAMEWORK",
+    "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework.git",
+    "category" : "PLUGIN",
+    "release" : "master",
+    "current" :"master"
+},{
     "title" : "BATTERY",
     "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-plugin-battery-status.git",
     "category" : "PLUGIN",
@@ -274,6 +279,12 @@
     "release" : "master",
     "current" :"master"
 },{
+    "title" : "STATUSBAR",
+    "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar.git",
+    "category" : "PLUGIN",
+    "release" : "master",
+    "current" :"master"
+},{
     "title" : "VIBRATION",
     "repo"  : "https://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration.git",
     "category" : "PLUGIN",


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org