You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2017/04/07 19:40:50 UTC

[01/13] cordova-test-platform git commit: basic scaffolding

Repository: cordova-test-platform
Updated Branches:
  refs/heads/master [created] f447269bf


basic scaffolding


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/7a80c317
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/7a80c317
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/7a80c317

Branch: refs/heads/master
Commit: 7a80c3179cd59e2c8354543b426a744ece96bed7
Parents: 
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 28 17:06:33 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 28 17:06:33 2017 -0700

----------------------------------------------------------------------
 .github/PULL_REQUEST_TEMPLATE.md |  22 ++++
 .gitignore                       |  16 +++
 CONTRIBUTING.md                  |  38 +++++++
 LICENSE                          | 204 ++++++++++++++++++++++++++++++++++
 NOTICE                           |   6 +
 README.md                        |   0
 package.json                     |  42 +++++++
 7 files changed, 328 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/7a80c317/.github/PULL_REQUEST_TEMPLATE.md
----------------------------------------------------------------------
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..91582f4
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,22 @@
+<!--
+Please make sure the checklist boxes are all checked before submitting the PR. The checklist
+is intended as a quick reference, for complete details please see our Contributor Guidelines:
+
+http://cordova.apache.org/contribute/contribute_guidelines.html
+
+Thanks!
+-->
+
+### Platforms affected
+
+
+### What does this PR do?
+
+
+### What testing has been done on this change?
+
+
+### Checklist
+- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
+- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
+- [ ] Added automated test coverage as appropriate for this change.

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/7a80c317/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c38b55d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+
+*.user
+.DS_Store
+bld
+*.opensdf
+*.suo
+*.sdf
+Debug
+obj
+Thumbs.db
+/.idea/
+npm-debug.log
+
+
+# Skip node_modules
+node_modules/

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/7a80c317/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..07f5651
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,38 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+-->
+
+# Contributing to Apache Cordova
+
+Anyone can contribute to Cordova. And we need your contributions.
+
+There are multiple ways to contribute: report bugs, improve the docs, and
+contribute code.
+  
+For instructions on this, start with the
+[contribution overview](http://cordova.apache.org/contribute/).
+
+The details are explained there, but the important items are:
+ - Sign and submit an Apache ICLA (Contributor License Agreement).
+ - Have a Jira issue open that corresponds to your contribution.
+ - Run the tests so your patch doesn't break existing functionality.
+
+We look forward to your contributions!
+

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/7a80c317/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..6741fa5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,204 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright 2015 Apache Cordova
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ ADDITIONAL LICENSES:

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/7a80c317/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..2c4b8e1
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,6 @@
+Apache Cordova
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org)
+

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/7a80c317/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/7a80c317/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..4dc5dd0
--- /dev/null
+++ b/package.json
@@ -0,0 +1,42 @@
+{
+  "name": "cordova-platform-test",
+  "version": "1.0.0",
+  "description": "Platform that simply stubs the platformAPI for testing and education",
+  "create": "src/create",
+  "main": "src/Api.js",
+  "scripts": {
+    "cover": "istanbul cover --root bin/templates/cordova --print detail jasmine",
+    "jshint": "jshint src && jshint spec",
+    "test": "npm run jshint && jasmine"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/cordova/cordova-platform-test.git"
+  },
+  "keywords": [
+    "apache",
+    "cordova",
+    "cordova-platform"
+  ],
+  "author": "Apache Software Foundation",
+  "license": "Apache-2.0",
+  "bugs": {
+    "url": "https://github.com/cordova/cordova-platform-test/issues"
+  },
+  "homepage": "https://github.com/cordova/cordova-platform-test#readme",
+  "maintainers": [
+    {
+      "name": "stevegill",
+      "email": "stevengill97@gmail.com"
+    },
+    {
+      "name": "Jesse MacFadyen",
+      "email": "purplecabbage@apache.org"
+    }
+  ],
+  "dependencies": {},
+  "devDependencies": {
+    "jasmine": "^2.5.3",
+    "jshint": "^2.9.4"
+  }
+}


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


[04/13] cordova-test-platform git commit: ignore vscode bs

Posted by pu...@apache.org.
ignore vscode bs


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/6c973c1d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/6c973c1d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/6c973c1d

Branch: refs/heads/master
Commit: 6c973c1d612a987e0ead30495dd2c56ea3d6640d
Parents: a8bcff0
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Apr 3 11:36:58 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon Apr 3 11:36:58 2017 -0700

----------------------------------------------------------------------
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/6c973c1d/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index c38b55d..df89f08 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ obj
 Thumbs.db
 /.idea/
 npm-debug.log
+.vscode
 
 
 # Skip node_modules


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


[07/13] cordova-test-platform git commit: cleaned up console.log, running all create tests

Posted by pu...@apache.org.
cleaned up console.log, running all create tests


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/f850fe18
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/f850fe18
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/f850fe18

Branch: refs/heads/master
Commit: f850fe186a0b40cc1a79412c767f7a3a95e6706c
Parents: 8303894
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Apr 4 18:03:26 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Apr 4 18:03:26 2017 -0700

----------------------------------------------------------------------
 spec/create.spec.js | 54 ++++++++++++++++++++++++------------------------
 src/cordova/Api.js  |  1 -
 2 files changed, 27 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/f850fe18/spec/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/create.spec.js b/spec/create.spec.js
index f4eb1c3..323d724 100644
--- a/spec/create.spec.js
+++ b/spec/create.spec.js
@@ -37,7 +37,7 @@ function createAndBuild(projectname, projectid) {
 
     // create the project
     command = util.format('"%s" "%s/%s" "%s" "%s"', createScriptPath, tmpDir, projectname, projectid, projectname);
-    shell.echo(command);
+    //shell.echo(command);
     return_code = shell.exec(command).code;
     expect(return_code).toBe(0);
 
@@ -55,7 +55,7 @@ function createAndBuild(projectname, projectid) {
 
     // // build the project
     command = util.format('"%s/cordova/build"', path.join(tmpDir, projectname));
-    shell.echo(command);
+    //shell.echo(command);
     return_code = shell.exec(command, { silent: true }).code;
     expect(return_code).toBe(0);
 
@@ -79,40 +79,40 @@ describe('create', function() {
         createAndBuild(projectname, projectid);
     });
 
-    // it('create project with ascii name, and spaces', function() {
-    //     var projectname = 'test create';
-    //     var projectid = 'com.test.app2';
+    it('create project with ascii name, and spaces', function() {
+        var projectname = 'test create';
+        var projectid = 'com.test.app2';
 
-    //     createAndBuild(projectname, projectid);
-    // });
+        createAndBuild(projectname, projectid);
+    });
 
-    // it('create project with unicode name, no spaces', function() {
-    //     var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc\u7528\u7528\u7528\u7528';
-    //     var projectid = 'com.test.app3';
+    it('create project with unicode name, no spaces', function() {
+        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc\u7528\u7528\u7528\u7528';
+        var projectid = 'com.test.app3';
 
-    //     createAndBuild(projectname, projectid);
-    // });
+        createAndBuild(projectname, projectid);
+    });
 
-    // it('create project with unicode name, and spaces', function() {
-    //     var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc \u7528\u7528\u7528\u7528';
-    //     var projectid = 'com.test.app4';
+    it('create project with unicode name, and spaces', function() {
+        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc \u7528\u7528\u7528\u7528';
+        var projectid = 'com.test.app4';
 
-    //     createAndBuild(projectname, projectid);
-    // });
+        createAndBuild(projectname, projectid);
+    });
 
-    // it('create project with ascii+unicode name, no spaces', function() {
-    //     var projectname = '\u5fdc\u5fdc\u5fdc\u5fdchello\u7528\u7528\u7528\u7528';
-    //     var projectid = 'com.test.app5';
+    it('create project with ascii+unicode name, no spaces', function() {
+        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdchello\u7528\u7528\u7528\u7528';
+        var projectid = 'com.test.app5';
 
-    //     createAndBuild(projectname, projectid);
-    // });
+        createAndBuild(projectname, projectid);
+    });
 
-    // it('create project with ascii+unicode name, and spaces', function() {
-    //     var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc hello \u7528\u7528\u7528\u7528';
-    //     var projectid = 'com.test.app6';
+    it('create project with ascii+unicode name, and spaces', function() {
+        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc hello \u7528\u7528\u7528\u7528';
+        var projectid = 'com.test.app6';
 
-    //     createAndBuild(projectname, projectid);
-    // });
+        createAndBuild(projectname, projectid);
+    });
 
 });
 

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/f850fe18/src/cordova/Api.js
----------------------------------------------------------------------
diff --git a/src/cordova/Api.js b/src/cordova/Api.js
index a49193f..5a8f341 100644
--- a/src/cordova/Api.js
+++ b/src/cordova/Api.js
@@ -52,7 +52,6 @@ Api.createPlatform = function (destination, config, options, events) {
     shell.mkdir(path.join(destination,'cordova'));
 
     var apiPath = path.join(__dirname, '**'); // default value
-    console.log("apiPath = " + apiPath);
     // does options contain the info we desire?
     if(options && options.platformDetails) {
         apiPath = path.join(options.platformDetails.libDir, '**');


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


[06/13] cordova-test-platform git commit: added platform level scripts

Posted by pu...@apache.org.
added platform level scripts


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/8303894d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/8303894d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/8303894d

Branch: refs/heads/master
Commit: 8303894d470483e9a23a166a4be8d3e595fe947b
Parents: c28cfc1
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Apr 4 18:00:53 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Apr 4 18:00:53 2017 -0700

----------------------------------------------------------------------
 spec/create.spec.js     |  98 ++++++++++++++++++---------------
 spec/projectApi.spec.js |   2 +-
 src/Api.js              | 123 ------------------------------------------
 src/bin/create          |   2 +-
 src/cordova/Api.js      | 125 +++++++++++++++++++++++++++++++++++++++++++
 src/cordova/build       |  20 +++++++
 src/cordova/clean       |  20 +++++++
 src/cordova/log         |  20 +++++++
 src/cordova/run         |  20 +++++++
 src/cordova/version     |  26 +++++++++
 10 files changed, 289 insertions(+), 167 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/spec/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/create.spec.js b/spec/create.spec.js
index b59b8c6..f4eb1c3 100644
--- a/spec/create.spec.js
+++ b/spec/create.spec.js
@@ -17,12 +17,12 @@
  under the License.
  */
 
-var shell = require('shelljs'),
-    spec = __dirname,
-    path = require('path'),
-    util = require('util');
+var shell = require('shelljs');
+var fs = require('fs');
+var path = require('path');
+var util = require('util');
 
-var cordova_bin = path.join(spec, '../src/bin');
+var cordova_bin = path.join(__dirname, '../src/bin');// is this the same on all platforms?
 var tmpDir = path.join(__dirname, '../temp');
 
 function createAndBuild(projectname, projectid) {
@@ -30,34 +30,48 @@ function createAndBuild(projectname, projectid) {
     var command;
 
     // remove existing folder
-    //command =  path.join(tmpDir, projectname);
     shell.rm('-rf', tmpDir);
     shell.mkdir(tmpDir);
 
+    var createScriptPath = path.join(cordova_bin,'create');
 
     // create the project
-    command = util.format('"%s/create" "%s/%s" "%s" "%s"', cordova_bin, tmpDir, projectname, projectid, projectname);
-
-    //console.log("command = " + command);
-
-    // shell.echo(command);
+    command = util.format('"%s" "%s/%s" "%s" "%s"', createScriptPath, tmpDir, projectname, projectid, projectname);
+    shell.echo(command);
     return_code = shell.exec(command).code;
     expect(return_code).toBe(0);
 
+
+    var tempCordovaScriptsPath = path.join(tmpDir,projectname,"cordova");
+
+    // created project has scripts in the cordova folder
+    // build, clean, log, run, version
+    expect(fs.existsSync(path.join(tempCordovaScriptsPath,'build'))).toBe(true);
+    expect(fs.existsSync(path.join(tempCordovaScriptsPath,'clean'))).toBe(true);
+    expect(fs.existsSync(path.join(tempCordovaScriptsPath,'log'))).toBe(true);
+    expect(fs.existsSync(path.join(tempCordovaScriptsPath,'run'))).toBe(true);
+    expect(fs.existsSync(path.join(tempCordovaScriptsPath,'version'))).toBe(true);
+
+
     // // build the project
-    // command = util.format('"%s/cordova/build"', path.join(tmpDir, projectname));
-    // //shell.echo(command);
-    // return_code = shell.exec(command, { silent: true }).code;
-    // expect(return_code).toBe(0);
+    command = util.format('"%s/cordova/build"', path.join(tmpDir, projectname));
+    shell.echo(command);
+    return_code = shell.exec(command, { silent: true }).code;
+    expect(return_code).toBe(0);
 
     // clean-up
-    command =  path.join(tmpDir, projectname);
-    shell.rm('-rf', command);
+    shell.rm('-rf', tmpDir);
 }
 
 
 describe('create', function() {
 
+    it('has a create script in bin/cordova',function(){
+        var createScriptPath = path.join(cordova_bin,'create');
+        expect(fs.existsSync(createScriptPath)).toBe(true);
+    });
+
+
     it('create project with ascii name, no spaces', function() {
         var projectname = 'testcreate';
         var projectid = 'com.test.app1';
@@ -65,40 +79,40 @@ describe('create', function() {
         createAndBuild(projectname, projectid);
     });
 
-    it('create project with ascii name, and spaces', function() {
-        var projectname = 'test create';
-        var projectid = 'com.test.app2';
+    // it('create project with ascii name, and spaces', function() {
+    //     var projectname = 'test create';
+    //     var projectid = 'com.test.app2';
 
-        createAndBuild(projectname, projectid);
-    });
+    //     createAndBuild(projectname, projectid);
+    // });
 
-    it('create project with unicode name, no spaces', function() {
-        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc\u7528\u7528\u7528\u7528';
-        var projectid = 'com.test.app3';
+    // it('create project with unicode name, no spaces', function() {
+    //     var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc\u7528\u7528\u7528\u7528';
+    //     var projectid = 'com.test.app3';
 
-        createAndBuild(projectname, projectid);
-    });
+    //     createAndBuild(projectname, projectid);
+    // });
 
-    it('create project with unicode name, and spaces', function() {
-        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc \u7528\u7528\u7528\u7528';
-        var projectid = 'com.test.app4';
+    // it('create project with unicode name, and spaces', function() {
+    //     var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc \u7528\u7528\u7528\u7528';
+    //     var projectid = 'com.test.app4';
 
-        createAndBuild(projectname, projectid);
-    });
+    //     createAndBuild(projectname, projectid);
+    // });
 
-    it('create project with ascii+unicode name, no spaces', function() {
-        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdchello\u7528\u7528\u7528\u7528';
-        var projectid = 'com.test.app5';
+    // it('create project with ascii+unicode name, no spaces', function() {
+    //     var projectname = '\u5fdc\u5fdc\u5fdc\u5fdchello\u7528\u7528\u7528\u7528';
+    //     var projectid = 'com.test.app5';
 
-        createAndBuild(projectname, projectid);
-    });
+    //     createAndBuild(projectname, projectid);
+    // });
 
-    it('create project with ascii+unicode name, and spaces', function() {
-        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc hello \u7528\u7528\u7528\u7528';
-        var projectid = 'com.test.app6';
+    // it('create project with ascii+unicode name, and spaces', function() {
+    //     var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc hello \u7528\u7528\u7528\u7528';
+    //     var projectid = 'com.test.app6';
 
-        createAndBuild(projectname, projectid);
-    });
+    //     createAndBuild(projectname, projectid);
+    // });
 
 });
 

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/spec/projectApi.spec.js
----------------------------------------------------------------------
diff --git a/spec/projectApi.spec.js b/spec/projectApi.spec.js
index f05475e..1f19eeb 100644
--- a/spec/projectApi.spec.js
+++ b/spec/projectApi.spec.js
@@ -30,7 +30,7 @@ describe('can get the Api', function() {
         expect(typeof Api.createPlatform).toBe('function');
 
 // TODO: make this do something real
-        var promise = Api.createPlatform("../tmp");
+        var promise = Api.createPlatform("../fixtures/tmp");
         expect(promise).toBeDefined();
         expect(promise.then).toBeDefined();
         promise.then(function(res) {

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/src/Api.js
----------------------------------------------------------------------
diff --git a/src/Api.js b/src/Api.js
deleted file mode 100644
index bbafde7..0000000
--- a/src/Api.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-    this file is found by cordova-lib when you attempt to
-    'cordova platform add PATH' where path is this repo.
-*/
-
-/*jslint node: true */
-
-var shell = require('shelljs');
-var path = require('path');
-
-var PLATFORM_NAME = 'testplatform';
-
-function setupEvents(externalEventEmitter) {
-    if (externalEventEmitter) {
-        // This will make the platform internal events visible outside
-        selfEvents.forwardEventsTo(externalEventEmitter);
-        return externalEventEmitter;
-    }
-
-    // There is no logger if external emitter is not present,
-    // so attach a console logger
-    CordovaLogger.get().subscribe(selfEvents);
-    return selfEvents;
-}
-
-function Api(platform, platformRootDir, events) {
-
-    this.platform = platform || PLATFORM_NAME;
-    this.root = path.resolve(__dirname, '..');
-
-    this.locations = {
-        platformRootDir: platformRootDir,
-        root: this.root,
-        www: path.join(this.root, 'assets/www'),
-        res: path.join(this.root, 'res'),
-        platformWww: path.join(this.root, 'platform_www'),
-        configXml: path.join(this.root, 'res/xml/config.xml'),
-        defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'),
-        build: path.join(this.root, 'build'),
-        // NOTE: Due to platformApi spec we need to return relative paths here
-        cordovaJs: 'bin/templates/project/assets/www/cordova.js',
-        cordovaJsSrc: 'cordova-js-src'
-    };
-
-}
-
-Api.createPlatform = function (destination, config, options, events) {
-
-    // create the destination and the standard place for our api to live
-    // platforms/platformName/cordova/Api.js
-    shell.mkdir(destination);
-    shell.mkdir(path.join(destination,'cordova'));
-
-    var apiPath = path.join(__dirname, 'Api.js'); // default value
-    // does options contain the info we desire?
-    if(options && options.platformDetails) {
-        apiPath = path.join(options.platformDetails.libDir, 'src/Api.js');
-    }
-    // move a copy of our api to the new project
-    shell.cp(apiPath, path.join(destination, 'cordova/Api.js'));
-
-    var result = Promise.resolve();
-    result.then(function(){
-       return new Api(PLATFORM_NAME,destination,events);
-    });
-    return result;
-};
-
-
-Api.updatePlatform = function (destination, options, events) {
-    // console.log("test-platform:Api:updatePlatform");
-    // todo?: create projectInstance and fulfill promise with it.
-    return Promise.resolve();
-};
-
-Api.prototype.getPlatformInfo = function () {
-    console.log("test-platform:Api:getPlatformInfo");
-    // return PlatformInfo object
-
-    return {
-        "locations":this.locations,
-        "root": this.root,
-        "name": this.platform,
-        "version": { "version" : "1.0.0" },
-        "projectConfig": this._config
-    };
-};
-
-Api.prototype.prepare = function (cordovaProject) {
-    console.log("test-platform:Api:prepare");
-    return Promise.resolve();
-};
-
-Api.prototype.addPlugin = function (plugin, installOptions) {
-    console.log("test-platform:Api:addPlugin");
-    return Promise.resolve();
-};
-
-Api.prototype.removePlugin = function (plugin, uninstallOptions) {
-    console.log("test-platform:Api:removePlugin");
-    return Promise.resolve();
-};
-
-Api.prototype.build = function (buildOptions) {
-    console.log("test-platform:Api:build");
-    return Promise.resolve();
-};
-
-Api.prototype.run = function(runOptions) {
-    console.log("test-platform:Api:run");
-};
-
-Api.prototype.clean = function(cleanOptions) {
-    console.log("test-platform:Api:clean");
-    return Promise.resolve();
-};
-
-Api.prototype.requirements = function() {
-    console.log("test-platform:Api:requirements");
-    return true;
-};
-
-module.exports = Api;

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/src/bin/create
----------------------------------------------------------------------
diff --git a/src/bin/create b/src/bin/create
index 77bc7e2..ad18549 100755
--- a/src/bin/create
+++ b/src/bin/create
@@ -31,7 +31,7 @@
 
 var path = require('path');
 var ConfigParser = require('cordova-common').ConfigParser;
-var Api = require('../Api');
+var Api = require('../cordova/Api');
 
 var argv = require('nopt')({
     'help' : Boolean,

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/src/cordova/Api.js
----------------------------------------------------------------------
diff --git a/src/cordova/Api.js b/src/cordova/Api.js
new file mode 100644
index 0000000..a49193f
--- /dev/null
+++ b/src/cordova/Api.js
@@ -0,0 +1,125 @@
+/*
+    this file is found by cordova-lib when you attempt to
+    'cordova platform add PATH' where path is this repo.
+*/
+
+/*jslint node: true */
+
+var shell = require('shelljs');
+var path = require('path');
+
+var PLATFORM_NAME = 'testplatform';
+
+function setupEvents(externalEventEmitter) {
+    if (externalEventEmitter) {
+        // This will make the platform internal events visible outside
+        selfEvents.forwardEventsTo(externalEventEmitter);
+        return externalEventEmitter;
+    }
+
+    // There is no logger if external emitter is not present,
+    // so attach a console logger
+    CordovaLogger.get().subscribe(selfEvents);
+    return selfEvents;
+}
+
+function Api(platform, platformRootDir, events) {
+
+    this.platform = platform || PLATFORM_NAME;
+    this.root = path.resolve(__dirname, '..');
+
+    this.locations = {
+        platformRootDir: platformRootDir,
+        root: this.root,
+        www: path.join(this.root, 'assets/www'),
+        res: path.join(this.root, 'res'),
+        platformWww: path.join(this.root, 'platform_www'),
+        configXml: path.join(this.root, 'res/xml/config.xml'),
+        defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'),
+        build: path.join(this.root, 'build'),
+        // NOTE: Due to platformApi spec we need to return relative paths here
+        cordovaJs: 'bin/templates/project/assets/www/cordova.js',
+        cordovaJsSrc: 'cordova-js-src'
+    };
+
+}
+
+Api.createPlatform = function (destination, config, options, events) {
+
+    // create the destination and the standard place for our api to live
+    // platforms/platformName/cordova/Api.js
+    shell.mkdir(destination);
+    shell.mkdir(path.join(destination,'cordova'));
+
+    var apiPath = path.join(__dirname, '**'); // default value
+    console.log("apiPath = " + apiPath);
+    // does options contain the info we desire?
+    if(options && options.platformDetails) {
+        apiPath = path.join(options.platformDetails.libDir, '**');
+    }
+
+    // move a copy of our api to the new project
+    shell.cp(apiPath, path.join(destination, 'cordova'));
+
+    var result = Promise.resolve();
+    result.then(function(){
+       return new Api(PLATFORM_NAME,destination,events);
+    });
+    return result;
+};
+
+
+Api.updatePlatform = function (destination, options, events) {
+    // console.log("test-platform:Api:updatePlatform");
+    // todo?: create projectInstance and fulfill promise with it.
+    return Promise.resolve();
+};
+
+Api.prototype.getPlatformInfo = function () {
+    console.log("test-platform:Api:getPlatformInfo");
+    // return PlatformInfo object
+
+    return {
+        "locations":this.locations,
+        "root": this.root,
+        "name": this.platform,
+        "version": { "version" : "1.0.0" },
+        "projectConfig": this._config
+    };
+};
+
+Api.prototype.prepare = function (cordovaProject) {
+    console.log("test-platform:Api:prepare");
+    return Promise.resolve();
+};
+
+Api.prototype.addPlugin = function (plugin, installOptions) {
+    console.log("test-platform:Api:addPlugin");
+    return Promise.resolve();
+};
+
+Api.prototype.removePlugin = function (plugin, uninstallOptions) {
+    console.log("test-platform:Api:removePlugin");
+    return Promise.resolve();
+};
+
+Api.prototype.build = function (buildOptions) {
+    console.log("test-platform:Api:build");
+    return Promise.resolve();
+};
+
+Api.prototype.run = function(runOptions) {
+    console.log("test-platform:Api:run");
+};
+
+Api.prototype.clean = function(cleanOptions) {
+    console.log("test-platform:Api:clean");
+    return Promise.resolve();
+};
+
+Api.prototype.requirements = function() {
+    console.log("test-platform:Api:requirements");
+    return true;
+};
+
+module.exports = Api;

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/src/cordova/build
----------------------------------------------------------------------
diff --git a/src/cordova/build b/src/cordova/build
new file mode 100755
index 0000000..86aa8c1
--- /dev/null
+++ b/src/cordova/build
@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+         http://www.apache.org/licenses/LICENSE-2.0
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+console.log("cordova/build");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/src/cordova/clean
----------------------------------------------------------------------
diff --git a/src/cordova/clean b/src/cordova/clean
new file mode 100755
index 0000000..1c51169
--- /dev/null
+++ b/src/cordova/clean
@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+         http://www.apache.org/licenses/LICENSE-2.0
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+console.log("cordova/clean");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/src/cordova/log
----------------------------------------------------------------------
diff --git a/src/cordova/log b/src/cordova/log
new file mode 100755
index 0000000..bb6fb8c
--- /dev/null
+++ b/src/cordova/log
@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+         http://www.apache.org/licenses/LICENSE-2.0
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+console.log("cordova/log");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/src/cordova/run
----------------------------------------------------------------------
diff --git a/src/cordova/run b/src/cordova/run
new file mode 100755
index 0000000..3d37345
--- /dev/null
+++ b/src/cordova/run
@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+         http://www.apache.org/licenses/LICENSE-2.0
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+console.log("cordova/run");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/8303894d/src/cordova/version
----------------------------------------------------------------------
diff --git a/src/cordova/version b/src/cordova/version
new file mode 100755
index 0000000..c68eec1
--- /dev/null
+++ b/src/cordova/version
@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+         http://www.apache.org/licenses/LICENSE-2.0
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+var VERSION = "1.0.1-dev";
+
+module.exports.version = VERSION;
+
+if (!module.parent) {
+    console.log(VERSION);
+}


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


[08/13] cordova-test-platform git commit: pushed version back to a reasonable pre 1.0 number

Posted by pu...@apache.org.
pushed version back to a reasonable pre 1.0 number


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/28040f02
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/28040f02
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/28040f02

Branch: refs/heads/master
Commit: 28040f025bed80705463e3cb1737891ec2add16a
Parents: f850fe1
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Apr 4 19:36:40 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Apr 4 19:36:40 2017 -0700

----------------------------------------------------------------------
 package.json        | 2 +-
 src/cordova/version | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/28040f02/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 5424ac6..19ec7e7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-platform-test",
-  "version": "1.0.1",
+  "version": "0.0.2",
   "description": "Platform that simply stubs the platformAPI for testing and education",
   "create": "src/create",
   "main": "src/Api.js",

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/28040f02/src/cordova/version
----------------------------------------------------------------------
diff --git a/src/cordova/version b/src/cordova/version
index c68eec1..ffa9b34 100755
--- a/src/cordova/version
+++ b/src/cordova/version
@@ -17,7 +17,7 @@
        under the License.
 */
 
-var VERSION = "1.0.1-dev";
+var VERSION = "0.0.2";
 
 module.exports.version = VERSION;
 


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


[02/13] cordova-test-platform git commit: filled in some readme

Posted by pu...@apache.org.
filled in some readme


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/b7bdc910
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/b7bdc910
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/b7bdc910

Branch: refs/heads/master
Commit: b7bdc910bbaa39e8555d8bc16f102a59607a899d
Parents: 7a80c31
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 28 17:14:11 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 28 17:18:59 2017 -0700

----------------------------------------------------------------------
 README.md | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/b7bdc910/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index e69de29..aa87c2f 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,34 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+-->
+
+# cordova-platform-test
+
+This repo contains the code for an [Apache Cordova](http://cordova.apache.org) platform that allows you to build applications that target NOTHING. This platform is purely for testing, although it is also a good resource to see the minimum requirements to implement a new platform.
+
+
+[Apache Cordova](http://cordova.apache.org) is a project of [The Apache Software Foundation (ASF)](http://apache.org)
+
+
+# Report Issues
+Report them at the [Apache Cordova Issue Tracker](https://issues.apache.org/jira/browse/CB).
+
+# Further Reading
+- [Apache Cordova Documentation](http://docs.cordova.io)
\ No newline at end of file


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


[13/13] cordova-test-platform git commit: updating name + repo links, new name cordova-test-platform

Posted by pu...@apache.org.
updating name + repo links, new name cordova-test-platform


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/f447269b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/f447269b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/f447269b

Branch: refs/heads/master
Commit: f447269bf02524ef88db7708356c429bd82cf452
Parents: f4feeed
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Apr 7 12:40:14 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Apr 7 12:40:14 2017 -0700

----------------------------------------------------------------------
 README.md    |  2 +-
 package.json | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/f447269b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index aa87c2f..afaf50d 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
 #
 -->
 
-# cordova-platform-test
+# cordova-test-platform
 
 This repo contains the code for an [Apache Cordova](http://cordova.apache.org) platform that allows you to build applications that target NOTHING. This platform is purely for testing, although it is also a good resource to see the minimum requirements to implement a new platform.
 

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/f447269b/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index e0b3f92..78dba05 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
-  "name": "cordova-platform-test",
-  "version": "0.0.4",
+  "name": "cordova-test-platform",
+  "version": "0.0.5",
   "description": "Platform that simply stubs the platformAPI for testing and education",
   "create": "src/bin/create",
   "main": "src/cordova/Api.js",
@@ -12,7 +12,7 @@
   },
   "repository": {
     "type": "git",
-    "url": "git+https://github.com/cordova/cordova-platform-test.git"
+    "url": "git+https://github.com/apache/cordova-test-platform.git"
   },
   "keywords": [
     "apache",
@@ -22,9 +22,9 @@
   "author": "Apache Software Foundation",
   "license": "Apache-2.0",
   "bugs": {
-    "url": "https://github.com/cordova/cordova-platform-test/issues"
+    "url": "https://issues.apache.org/jira/browse/CB"
   },
-  "homepage": "https://github.com/cordova/cordova-platform-test#readme",
+  "homepage": "https://github.com/cordova/cordova-test-platform#readme",
   "maintainers": [
     {
       "name": "stevegill",


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


[03/13] cordova-test-platform git commit: added basic api and tests

Posted by pu...@apache.org.
added basic api and tests


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/a8bcff08
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/a8bcff08
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/a8bcff08

Branch: refs/heads/master
Commit: a8bcff08aecd3b4fb5a6275f9eb2691ea8338128
Parents: b7bdc91
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 31 23:13:02 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 31 23:13:02 2017 -0700

----------------------------------------------------------------------
 package.json              |   9 ++-
 spec/create.spec.js       | 104 +++++++++++++++++++++++++++++++
 spec/projectApi.spec.js   | 136 +++++++++++++++++++++++++++++++++++++++++
 spec/support/jasmine.json |  10 +++
 src/Api.js                | 123 +++++++++++++++++++++++++++++++++++++
 src/bin/create            |  74 ++++++++++++++++++++++
 6 files changed, 454 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/a8bcff08/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 4dc5dd0..7a5028d 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,8 @@
   "scripts": {
     "cover": "istanbul cover --root bin/templates/cordova --print detail jasmine",
     "jshint": "jshint src && jshint spec",
-    "test": "npm run jshint && jasmine"
+    "jasmine": "jasmine --captureExceptions --color",
+    "test": "npm run jshint && npm run jasmine"
   },
   "repository": {
     "type": "git",
@@ -34,7 +35,11 @@
       "email": "purplecabbage@apache.org"
     }
   ],
-  "dependencies": {},
+  "dependencies": {
+    "cordova-common": "^2.0.1",
+    "nopt": "^4.0.1",
+    "shelljs": "^0.3.0"
+  },
   "devDependencies": {
     "jasmine": "^2.5.3",
     "jshint": "^2.9.4"

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/a8bcff08/spec/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/create.spec.js b/spec/create.spec.js
new file mode 100644
index 0000000..b59b8c6
--- /dev/null
+++ b/spec/create.spec.js
@@ -0,0 +1,104 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var shell = require('shelljs'),
+    spec = __dirname,
+    path = require('path'),
+    util = require('util');
+
+var cordova_bin = path.join(spec, '../src/bin');
+var tmpDir = path.join(__dirname, '../temp');
+
+function createAndBuild(projectname, projectid) {
+    var return_code = 0;
+    var command;
+
+    // remove existing folder
+    //command =  path.join(tmpDir, projectname);
+    shell.rm('-rf', tmpDir);
+    shell.mkdir(tmpDir);
+
+
+    // create the project
+    command = util.format('"%s/create" "%s/%s" "%s" "%s"', cordova_bin, tmpDir, projectname, projectid, projectname);
+
+    //console.log("command = " + command);
+
+    // shell.echo(command);
+    return_code = shell.exec(command).code;
+    expect(return_code).toBe(0);
+
+    // // build the project
+    // command = util.format('"%s/cordova/build"', path.join(tmpDir, projectname));
+    // //shell.echo(command);
+    // return_code = shell.exec(command, { silent: true }).code;
+    // expect(return_code).toBe(0);
+
+    // clean-up
+    command =  path.join(tmpDir, projectname);
+    shell.rm('-rf', command);
+}
+
+
+describe('create', function() {
+
+    it('create project with ascii name, no spaces', function() {
+        var projectname = 'testcreate';
+        var projectid = 'com.test.app1';
+
+        createAndBuild(projectname, projectid);
+    });
+
+    it('create project with ascii name, and spaces', function() {
+        var projectname = 'test create';
+        var projectid = 'com.test.app2';
+
+        createAndBuild(projectname, projectid);
+    });
+
+    it('create project with unicode name, no spaces', function() {
+        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc\u7528\u7528\u7528\u7528';
+        var projectid = 'com.test.app3';
+
+        createAndBuild(projectname, projectid);
+    });
+
+    it('create project with unicode name, and spaces', function() {
+        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc \u7528\u7528\u7528\u7528';
+        var projectid = 'com.test.app4';
+
+        createAndBuild(projectname, projectid);
+    });
+
+    it('create project with ascii+unicode name, no spaces', function() {
+        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdchello\u7528\u7528\u7528\u7528';
+        var projectid = 'com.test.app5';
+
+        createAndBuild(projectname, projectid);
+    });
+
+    it('create project with ascii+unicode name, and spaces', function() {
+        var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc hello \u7528\u7528\u7528\u7528';
+        var projectid = 'com.test.app6';
+
+        createAndBuild(projectname, projectid);
+    });
+
+});
+

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/a8bcff08/spec/projectApi.spec.js
----------------------------------------------------------------------
diff --git a/spec/projectApi.spec.js b/spec/projectApi.spec.js
new file mode 100644
index 0000000..f05475e
--- /dev/null
+++ b/spec/projectApi.spec.js
@@ -0,0 +1,136 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var Api = require("../src/Api");
+
+describe('can get the Api', function() {
+
+    it('should be defined', function() {
+        expect(Api).toBeDefined();
+    });
+
+    it('should export static createPlatform function', function(done) {
+        expect(Api.createPlatform).toBeDefined();
+        expect(typeof Api.createPlatform).toBe('function');
+
+// TODO: make this do something real
+        var promise = Api.createPlatform("../tmp");
+        expect(promise).toBeDefined();
+        expect(promise.then).toBeDefined();
+        promise.then(function(res) {
+            console.log('result = ' + res);
+            console.log("spec-success");
+            done();
+        },
+        function(err) {
+            console.log("spec-error " + err);
+            done();
+        });
+    });
+
+    it('should export static updatePlatform function', function() {
+        expect(Api.updatePlatform).toBeDefined();
+        expect(typeof Api.updatePlatform).toBe('function');
+    });
+
+});
+
+describe('project level Api',function() {
+
+    var testApi = new Api();
+
+    it('can be created', function() {
+        expect(testApi).toBeDefined();
+    });
+
+    it('has a requirements method', function() {
+        expect(testApi.requirements).toBeDefined();
+        expect(typeof testApi.requirements).toBe('function');
+    });
+
+    it('has a clean method', function() {
+        expect(testApi.clean).toBeDefined();
+        expect(typeof testApi.clean).toBe('function');
+    });
+
+    it('has a run method', function() {
+        expect(testApi.run).toBeDefined();
+        expect(typeof testApi.run).toBe('function');
+    });
+
+    it('has a build method', function() {
+        expect(testApi.build).toBeDefined();
+        expect(typeof testApi.build).toBe('function');
+    });
+
+    it('has a removePlugin method', function() {
+        expect(testApi.removePlugin).toBeDefined();
+        expect(typeof testApi.removePlugin).toBe('function');
+    });
+
+    it('has a addPlugin method', function() {
+        expect(testApi.addPlugin).toBeDefined();
+        expect(typeof testApi.addPlugin).toBe('function');
+    });
+
+    it('has a prepare method', function() {
+        expect(testApi.prepare).toBeDefined();
+        expect(typeof testApi.prepare).toBe('function');
+    });
+
+    it('has a getPlatformInfo method', function() {
+        expect(testApi.getPlatformInfo).toBeDefined();
+        expect(typeof testApi.getPlatformInfo).toBe('function');
+    });
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+});
+
+// Static methods
+// Static method: createPlatform
+    // returns promise fulfilled with Api
+    // emits error using provided emmitter on error
+
+// Static method: updatePlatform
+    // returns a promise fulfilled with an Api
+    // emits error using provided emmitter on error
+    //
+
+// Instance methods
+    // requirements, clean, run, build, removePlugin, addPlugin, prepare, getPlatformInfo
+

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/a8bcff08/spec/support/jasmine.json
----------------------------------------------------------------------
diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json
new file mode 100644
index 0000000..7122dfd
--- /dev/null
+++ b/spec/support/jasmine.json
@@ -0,0 +1,10 @@
+{
+    "spec_dir": "spec",
+    "spec_files": [
+    	"*[sS]pec.js"
+    ],
+    "helpers": [
+    ],
+    "stopSpecOnExpectationFailure": false,
+    "random": false
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/a8bcff08/src/Api.js
----------------------------------------------------------------------
diff --git a/src/Api.js b/src/Api.js
new file mode 100644
index 0000000..bbafde7
--- /dev/null
+++ b/src/Api.js
@@ -0,0 +1,123 @@
+/*
+    this file is found by cordova-lib when you attempt to
+    'cordova platform add PATH' where path is this repo.
+*/
+
+/*jslint node: true */
+
+var shell = require('shelljs');
+var path = require('path');
+
+var PLATFORM_NAME = 'testplatform';
+
+function setupEvents(externalEventEmitter) {
+    if (externalEventEmitter) {
+        // This will make the platform internal events visible outside
+        selfEvents.forwardEventsTo(externalEventEmitter);
+        return externalEventEmitter;
+    }
+
+    // There is no logger if external emitter is not present,
+    // so attach a console logger
+    CordovaLogger.get().subscribe(selfEvents);
+    return selfEvents;
+}
+
+function Api(platform, platformRootDir, events) {
+
+    this.platform = platform || PLATFORM_NAME;
+    this.root = path.resolve(__dirname, '..');
+
+    this.locations = {
+        platformRootDir: platformRootDir,
+        root: this.root,
+        www: path.join(this.root, 'assets/www'),
+        res: path.join(this.root, 'res'),
+        platformWww: path.join(this.root, 'platform_www'),
+        configXml: path.join(this.root, 'res/xml/config.xml'),
+        defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'),
+        build: path.join(this.root, 'build'),
+        // NOTE: Due to platformApi spec we need to return relative paths here
+        cordovaJs: 'bin/templates/project/assets/www/cordova.js',
+        cordovaJsSrc: 'cordova-js-src'
+    };
+
+}
+
+Api.createPlatform = function (destination, config, options, events) {
+
+    // create the destination and the standard place for our api to live
+    // platforms/platformName/cordova/Api.js
+    shell.mkdir(destination);
+    shell.mkdir(path.join(destination,'cordova'));
+
+    var apiPath = path.join(__dirname, 'Api.js'); // default value
+    // does options contain the info we desire?
+    if(options && options.platformDetails) {
+        apiPath = path.join(options.platformDetails.libDir, 'src/Api.js');
+    }
+    // move a copy of our api to the new project
+    shell.cp(apiPath, path.join(destination, 'cordova/Api.js'));
+
+    var result = Promise.resolve();
+    result.then(function(){
+       return new Api(PLATFORM_NAME,destination,events);
+    });
+    return result;
+};
+
+
+Api.updatePlatform = function (destination, options, events) {
+    // console.log("test-platform:Api:updatePlatform");
+    // todo?: create projectInstance and fulfill promise with it.
+    return Promise.resolve();
+};
+
+Api.prototype.getPlatformInfo = function () {
+    console.log("test-platform:Api:getPlatformInfo");
+    // return PlatformInfo object
+
+    return {
+        "locations":this.locations,
+        "root": this.root,
+        "name": this.platform,
+        "version": { "version" : "1.0.0" },
+        "projectConfig": this._config
+    };
+};
+
+Api.prototype.prepare = function (cordovaProject) {
+    console.log("test-platform:Api:prepare");
+    return Promise.resolve();
+};
+
+Api.prototype.addPlugin = function (plugin, installOptions) {
+    console.log("test-platform:Api:addPlugin");
+    return Promise.resolve();
+};
+
+Api.prototype.removePlugin = function (plugin, uninstallOptions) {
+    console.log("test-platform:Api:removePlugin");
+    return Promise.resolve();
+};
+
+Api.prototype.build = function (buildOptions) {
+    console.log("test-platform:Api:build");
+    return Promise.resolve();
+};
+
+Api.prototype.run = function(runOptions) {
+    console.log("test-platform:Api:run");
+};
+
+Api.prototype.clean = function(cleanOptions) {
+    console.log("test-platform:Api:clean");
+    return Promise.resolve();
+};
+
+Api.prototype.requirements = function() {
+    console.log("test-platform:Api:requirements");
+    return true;
+};
+
+module.exports = Api;

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/a8bcff08/src/bin/create
----------------------------------------------------------------------
diff --git a/src/bin/create b/src/bin/create
new file mode 100755
index 0000000..77bc7e2
--- /dev/null
+++ b/src/bin/create
@@ -0,0 +1,74 @@
+#!/usr/bin/env node
+
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+
+/*
+ * create a Cordova project
+ *
+ * USAGE
+ *   ./create <path_to_new_project> <package_name> <project_name>
+ *
+ * EXAMPLE
+ *  ./create ~/Desktop/radness org.apache.cordova.radness Radness
+ */
+
+var path = require('path');
+var ConfigParser = require('cordova-common').ConfigParser;
+var Api = require('../Api');
+
+var argv = require('nopt')({
+    'help' : Boolean,
+    'cli' : Boolean,
+    'shared' : Boolean, // alias for --link
+    'link' : Boolean
+}, { 'd' : '--verbose' });
+
+var projectPath = argv.argv.remain[0];
+
+if (argv.help || !projectPath) {
+    console.log('Usage: $0 [--link] [--cli] <path_to_new_project> <package_name> <project_name> [<project_template_dir>]');
+    console.log('   --link (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it.');
+    console.log('   --cli (optional): Use the CLI-project template.');
+    console.log('   <path_to_new_project>: Path to your new Cordova iOS project');
+    console.log('   <package_name>: Package name, following reverse-domain style convention');
+    console.log('   <project_name>: Project name');
+    console.log('   <project_template_dir>: Path to project template (override).');
+    process.exit(0);
+}
+else {
+    var config = {};
+
+    // apply overrides (package and project names
+    // if (argv.argv.remain[1]) {
+    //     config.setPackageName(argv.argv.remain[1]);
+    // }
+    // if (argv.argv.remain[2]) {
+    //     config.setName(argv.argv.remain[2]);
+    // }
+
+    var options = {
+        cli: argv.cli,
+        link: argv.link || argv.shared,
+        customTemplate: argv.argv.remain[3],
+    };
+
+    Api.createPlatform(projectPath, config, options);
+}
+


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


[10/13] cordova-test-platform git commit: tests passing

Posted by pu...@apache.org.
tests passing


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/4437f549
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/4437f549
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/4437f549

Branch: refs/heads/master
Commit: 4437f549323c09a8fa4c983d7779ddea6d33064b
Parents: 0ffe8a5
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Apr 5 17:26:16 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Apr 5 17:26:16 2017 -0700

----------------------------------------------------------------------
 spec/create.spec.js     | 1 +
 spec/projectApi.spec.js | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/4437f549/spec/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/create.spec.js b/spec/create.spec.js
index 323d724..c6c3974 100644
--- a/spec/create.spec.js
+++ b/spec/create.spec.js
@@ -26,6 +26,7 @@ var cordova_bin = path.join(__dirname, '../src/bin');// is this the same on all
 var tmpDir = path.join(__dirname, '../temp');
 
 function createAndBuild(projectname, projectid) {
+
     var return_code = 0;
     var command;
 

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/4437f549/spec/projectApi.spec.js
----------------------------------------------------------------------
diff --git a/spec/projectApi.spec.js b/spec/projectApi.spec.js
index 1f19eeb..5f5b090 100644
--- a/spec/projectApi.spec.js
+++ b/spec/projectApi.spec.js
@@ -17,7 +17,7 @@
  under the License.
  */
 
-var Api = require("../src/Api");
+var Api = require("../src/cordova/Api");
 
 describe('can get the Api', function() {
 
@@ -30,7 +30,7 @@ describe('can get the Api', function() {
         expect(typeof Api.createPlatform).toBe('function');
 
 // TODO: make this do something real
-        var promise = Api.createPlatform("../fixtures/tmp");
+        var promise = Api.createPlatform("../tmp");
         expect(promise).toBeDefined();
         expect(promise.then).toBeDefined();
         promise.then(function(res) {


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


[05/13] cordova-test-platform git commit: bump version to 1.0.1

Posted by pu...@apache.org.
bump version to 1.0.1


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/c28cfc14
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/c28cfc14
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/c28cfc14

Branch: refs/heads/master
Commit: c28cfc14b1bbc7daae302b9c514452c9c51a9ec8
Parents: 6c973c1
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Apr 3 11:37:46 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon Apr 3 11:37:46 2017 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/c28cfc14/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 7a5028d..5424ac6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-platform-test",
-  "version": "1.0.0",
+  "version": "1.0.1",
   "description": "Platform that simply stubs the platformAPI for testing and education",
   "create": "src/create",
   "main": "src/Api.js",


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


[11/13] cordova-test-platform git commit: bump to 0.0.3 and publish to see if the whole system fails ...

Posted by pu...@apache.org.
bump to 0.0.3 and publish to see if the whole system fails ...


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/b2408766
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/b2408766
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/b2408766

Branch: refs/heads/master
Commit: b2408766c32056cad8c30cd726f056a49ade02ac
Parents: 4437f54
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Apr 5 17:28:05 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Apr 5 17:28:05 2017 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/b2408766/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 75ba7dc..2b1567c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-platform-test",
-  "version": "0.0.2",
+  "version": "0.0.3",
   "description": "Platform that simply stubs the platformAPI for testing and education",
   "create": "src/bin/create",
   "main": "src/cordova/Api.js",


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


[12/13] cordova-test-platform git commit: added version.bat file for windows, bumped to 0.0.4

Posted by pu...@apache.org.
added version.bat file for windows, bumped to 0.0.4


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/f4feeed4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/f4feeed4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/f4feeed4

Branch: refs/heads/master
Commit: f4feeed44eb71c8619e1680718d29e7eab6ffe1b
Parents: b240876
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Apr 5 20:14:43 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Apr 5 20:14:43 2017 -0700

----------------------------------------------------------------------
 package.json            |  2 +-
 src/config.xml          |  7 ++++---
 src/cordova/version.bat | 26 ++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/f4feeed4/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2b1567c..e0b3f92 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-platform-test",
-  "version": "0.0.3",
+  "version": "0.0.4",
   "description": "Platform that simply stubs the platformAPI for testing and education",
   "create": "src/bin/create",
   "main": "src/cordova/Api.js",

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/f4feeed4/src/config.xml
----------------------------------------------------------------------
diff --git a/src/config.xml b/src/config.xml
index 57946d3..d9bfc45 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -17,11 +17,12 @@
 -->
 <widget xmlns     = "http://www.w3.org/ns/widgets"
         id        = "io.cordova.helloCordova"
-        version   = "2.0.0">
-    <name>Hello Cordova</name>
+        version   = "0.0.4">
+    <name>Test Cordova Platform</name>
 
     <description>
-        A sample Apache Cordova application that responds to the deviceready event.
+        This is a basic implementation of the platform API and demonstrates the minimum
+        that any new platform must implement.
     </description>
 
     <author href="http://cordova.io" email="dev@cordova.apache.org">

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/f4feeed4/src/cordova/version.bat
----------------------------------------------------------------------
diff --git a/src/cordova/version.bat b/src/cordova/version.bat
new file mode 100755
index 0000000..3610c17
--- /dev/null
+++ b/src/cordova/version.bat
@@ -0,0 +1,26 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0version"
+IF EXIST %script_path% (
+        node %script_path% %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
+    EXIT /B 1
+)


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


[09/13] cordova-test-platform git commit: updated paths, added config handling, cordova-lib tests passing, uses events to log

Posted by pu...@apache.org.
updated paths, added config handling, cordova-lib tests passing, uses events to log


Project: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/commit/0ffe8a53
Tree: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/tree/0ffe8a53
Diff: http://git-wip-us.apache.org/repos/asf/cordova-test-platform/diff/0ffe8a53

Branch: refs/heads/master
Commit: 0ffe8a53439196f8f938340f875765e7c11bde25
Parents: 28040f0
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Apr 5 17:24:47 2017 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Apr 5 17:25:37 2017 -0700

----------------------------------------------------------------------
 package.json       |  4 ++--
 src/bin/create     | 16 +++++++++-------
 src/config.xml     | 34 ++++++++++++++++++++++++++++++++++
 src/cordova/Api.js | 34 ++++++++++++++++++++++------------
 4 files changed, 67 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/0ffe8a53/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 19ec7e7..75ba7dc 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,8 @@
   "name": "cordova-platform-test",
   "version": "0.0.2",
   "description": "Platform that simply stubs the platformAPI for testing and education",
-  "create": "src/create",
-  "main": "src/Api.js",
+  "create": "src/bin/create",
+  "main": "src/cordova/Api.js",
   "scripts": {
     "cover": "istanbul cover --root bin/templates/cordova --print detail jasmine",
     "jshint": "jshint src && jshint spec",

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/0ffe8a53/src/bin/create
----------------------------------------------------------------------
diff --git a/src/bin/create b/src/bin/create
index ad18549..299398b 100755
--- a/src/bin/create
+++ b/src/bin/create
@@ -33,6 +33,7 @@ var path = require('path');
 var ConfigParser = require('cordova-common').ConfigParser;
 var Api = require('../cordova/Api');
 
+
 var argv = require('nopt')({
     'help' : Boolean,
     'cli' : Boolean,
@@ -40,6 +41,7 @@ var argv = require('nopt')({
     'link' : Boolean
 }, { 'd' : '--verbose' });
 
+
 var projectPath = argv.argv.remain[0];
 
 if (argv.help || !projectPath) {
@@ -53,15 +55,15 @@ if (argv.help || !projectPath) {
     process.exit(0);
 }
 else {
-    var config = {};
+    var config = new ConfigParser(path.resolve(__dirname, '../config.xml'));
 
     // apply overrides (package and project names
-    // if (argv.argv.remain[1]) {
-    //     config.setPackageName(argv.argv.remain[1]);
-    // }
-    // if (argv.argv.remain[2]) {
-    //     config.setName(argv.argv.remain[2]);
-    // }
+    if (argv.argv.remain[1]) {
+        config.setPackageName(argv.argv.remain[1]);
+    }
+    if (argv.argv.remain[2]) {
+        config.setName(argv.argv.remain[2]);
+    }
 
     var options = {
         cli: argv.cli,

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/0ffe8a53/src/config.xml
----------------------------------------------------------------------
diff --git a/src/config.xml b/src/config.xml
new file mode 100644
index 0000000..57946d3
--- /dev/null
+++ b/src/config.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<widget xmlns     = "http://www.w3.org/ns/widgets"
+        id        = "io.cordova.helloCordova"
+        version   = "2.0.0">
+    <name>Hello Cordova</name>
+
+    <description>
+        A sample Apache Cordova application that responds to the deviceready event.
+    </description>
+
+    <author href="http://cordova.io" email="dev@cordova.apache.org">
+        Apache Cordova Team
+    </author>
+
+    <!-- <content src="http://mysite.com/myapp.html" /> for external pages -->
+    <content src="index.html" />
+
+</widget>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-test-platform/blob/0ffe8a53/src/cordova/Api.js
----------------------------------------------------------------------
diff --git a/src/cordova/Api.js b/src/cordova/Api.js
index 5a8f341..b89dea6 100644
--- a/src/cordova/Api.js
+++ b/src/cordova/Api.js
@@ -8,6 +8,9 @@
 var shell = require('shelljs');
 var path = require('path');
 
+var CordovaLogger = require('cordova-common').CordovaLogger;
+var selfEvents = require('cordova-common').events;
+
 var PLATFORM_NAME = 'testplatform';
 
 function setupEvents(externalEventEmitter) {
@@ -46,25 +49,32 @@ function Api(platform, platformRootDir, events) {
 
 Api.createPlatform = function (destination, config, options, events) {
 
+    events = setupEvents(events);
+
     // create the destination and the standard place for our api to live
     // platforms/platformName/cordova/Api.js
-    shell.mkdir(destination);
-    shell.mkdir(path.join(destination,'cordova'));
 
-    var apiPath = path.join(__dirname, '**'); // default value
+    var apiSrcPath = __dirname; // default value
     // does options contain the info we desire?
-    if(options && options.platformDetails) {
-        apiPath = path.join(options.platformDetails.libDir, '**');
-    }
+
+    var projectName = config ? config.name() : "HelloCordova";
+
+    events.emit('log', 'Creating Cordova project for cordova-platform-test:');
+    events.emit('log', '\tPath: ' + destination);
+    events.emit('log', '\tName: ' + projectName);
+
+    shell.mkdir(destination);
 
     // move a copy of our api to the new project
-    shell.cp(apiPath, path.join(destination, 'cordova'));
+    shell.cp('-r',apiSrcPath, destination);
+
+    // move our node_modules
+    var srcModulePath = path.join(__dirname,'../../node_modules');
+    shell.cp('-r',srcModulePath,destination);
+
+    // I promise I will return
+    return Promise.resolve(new Api(PLATFORM_NAME,destination,events));
 
-    var result = Promise.resolve();
-    result.then(function(){
-       return new Api(PLATFORM_NAME,destination,events);
-    });
-    return result;
 };
 
 


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