You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by na...@apache.org on 2014/08/28 21:03:45 UTC

[31/50] git commit: CB-3445 Add .gradle template files for "update" as well as "create"

CB-3445 Add .gradle template files for "update" as well as "create"


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/94650c0b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/94650c0b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/94650c0b

Branch: refs/heads/master
Commit: 94650c0bd629deac69f4a558b4cc3a71317794cf
Parents: cef7168
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Aug 18 14:50:27 2014 -0400
Committer: Archana Naik <na...@lab126.com>
Committed: Mon Aug 18 12:41:25 2014 -0700

----------------------------------------------------------------------
 bin/lib/create.js | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/94650c0b/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 297b356..cc36c67 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -90,11 +90,13 @@ function runAndroidUpdate(projectPath, target_api, shared) {
     return exec('android update project --subprojects --path "' + projectPath + '" --target ' + target_api + ' --library "' + path.relative(projectPath, targetFrameworkDir) + '"');
 }
 
-function copyAntRules(projectPath) {
+function copyBuildRules(projectPath) {
     var srcDir = path.join(ROOT, 'bin', 'templates', 'project');
-    if (fs.existsSync(path.join(srcDir, 'custom_rules.xml'))) {
-        shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath);
-    }
+    shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath);
+
+    shell.cp('-f', path.join(srcDir, 'build.gradle'), projectPath);
+    shell.cp('-f', path.join(srcDir, 'libraries.gradle'), projectPath);
+    shell.cp('-f', path.join(srcDir, 'settings.gradle'), projectPath);
 }
 
 function copyScripts(projectPath) {
@@ -292,7 +294,7 @@ exports.createProject = function(project_path, package_name, project_name, proje
             shell.sed('-i', /__PACKAGE__/, package_name, manifest_path);
             shell.sed('-i', /__APILEVEL__/, target_api.split('-')[1], manifest_path);
             copyScripts(project_path);
-            copyAntRules(project_path);
+            copyBuildRules(project_path);
         });
         // Link it to local android install.
         return runAndroidUpdate(project_path, target_api, use_shared_project);
@@ -327,7 +329,7 @@ exports.updateProject = function(projectPath) {
         var target_api = check_reqs.get_target();
         copyJsAndLibrary(projectPath, false, projectName);
         copyScripts(projectPath);
-        copyAntRules(projectPath);
+        copyBuildRules(projectPath);
         removeDebuggableFromManifest(projectPath);
         return runAndroidUpdate(projectPath, target_api, false)
         .then(function() {