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/04/03 08:07:47 UTC

[4/4] git commit: [CB-6392]Addig amazon-fireos platform fails with not so good error reporting Fixes 2 issues while adding amazon-fireos platform after fresh cordova install. 1. create.js updated to create "libs" folder before copying it to the project's

[CB-6392]Addig amazon-fireos platform fails with not so good error reporting
Fixes 2 issues while adding amazon-fireos platform after fresh cordova install.
1. create.js updated to create "libs" folder before copying it to the project's platform folder. Also, checking for awv_interface.jar existance is moved to create_project().
2. check_reqs.js no longer checks for awv_interface.jar.


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/9375b410
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/9375b410
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/9375b410

Branch: refs/heads/master
Commit: 9375b4103c2cfd32f308a8bedfafc04b0eaacdf0
Parents: 736f44b
Author: Archana Naik <na...@lab126.com>
Authored: Wed Apr 2 13:06:51 2014 -0700
Committer: Archana Naik <na...@lab126.com>
Committed: Wed Apr 2 23:04:25 2014 -0700

----------------------------------------------------------------------
 bin/lib/check_reqs.js |  8 +-------
 bin/lib/create.js     | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/9375b410/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 215d1b5..b15a9b6 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -26,7 +26,6 @@ var shell = require('shelljs'),
     fs    = require('fs'),
     ROOT  = path.join(__dirname, '..', '..');
 
-var awv_interface='awv_interface.jar';
 
 // Get valid target from framework/project.properties
 module.exports.get_target = function() {
@@ -80,12 +79,7 @@ module.exports.check_android = function() {
     return d.promise.then(function(output) {
         if (!output.match(valid_target)) {
             return Q.reject(new Error('Please install Android target ' + valid_target.split('-')[1] + ' (the Android newest SDK). Make sure you have the latest Android tools installed as well. Run \"android\" from your command-line to install/update any missing SDKs or tools.'));
-        } else {
-            var awv_interface_expected_path=path.join(ROOT, 'framework','libs');
-            if (!fs.existsSync(path.join(awv_interface_expected_path,awv_interface))) {
-                Q.reject(new Error('awv_interface.jar not found in ' + awv_interface_expected_path +' folder. \nPlease download the AmazonWebView SDK from http://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv and copy the awv_interface.jar file to this folder:' + awv_interface_expected_path + ' and re-run cordova platform add amazon-fireos command.'));
-                }
-        }
+        } 
         return Q();
     }, function(stderr) {
         if (stderr.match(/command\snot\sfound/)) {

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/9375b410/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 676d5aa..1eacdfb 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -133,7 +133,8 @@ function copyScripts(projectPath) {
 
 exports.createProject = function(project_path, package_name, project_name, project_template_dir, use_shared_project, use_cli_template) {
     var VERSION = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
-
+    var awv_interface='awv_interface.jar';
+    
     // Set default values for path, package and name
     project_path = typeof project_path !== 'undefined' ? project_path : "CordovaExample";
     project_path = path.relative(process.cwd(), project_path);
@@ -158,12 +159,21 @@ exports.createProject = function(project_path, package_name, project_name, proje
     if (!/[a-zA-Z0-9_]+\.[a-zA-Z0-9_](.[a-zA-Z0-9_])*/.test(package_name)) {
         return Q.reject('Package name must look like: com.company.Name');
     }
-
+    
+    var awv_interface_expected_path=path.join(ROOT, 'framework','libs');
+    console.log('awv_path : ' + awv_interface_expected_path);
+    if (!fs.existsSync(awv_interface_expected_path)) {
+        shell.mkdir('-p', awv_interface_expected_path);
+    }
+    
+    if (!fs.existsSync(path.join(awv_interface_expected_path,awv_interface))) {
+        return Q.reject(new Error('awv_interface.jar not found in ' + awv_interface_expected_path +' folder. \nPlease download the AmazonWebView SDK from http://developer.amazon.com/sdk/fire/IntegratingAWV.html#installawv and copy the awv_interface.jar file to this folder:' + awv_interface_expected_path + ' and re-run cordova platform add amazon-fireos command.'));
+    }
     // Check that requirements are met and proper targets are installed
     return check_reqs.run()
     .then(function() {
         // Log the given values for the project
-        console.log('Creating Cordova project for the Android platform:');
+        console.log('Creating Cordova project for the amazon-fireos platform:');
         console.log('\tPath: ' + project_path);
         console.log('\tPackage: ' + package_name);
         console.log('\tName: ' + project_name);