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/11 21:04:43 UTC

[21/50] [abbrv] cordova-node-xcode git commit: Add support for PBXShellScriptBuildPhase

Add support for PBXShellScriptBuildPhase


Project: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/commit/4687604d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/tree/4687604d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/diff/4687604d

Branch: refs/heads/master
Commit: 4687604d31691be9aea9b8fdefb0c277f72d2dde
Parents: b441568
Author: Ryan Sundberg <ry...@gmail.com>
Authored: Wed Oct 26 13:34:55 2016 -0700
Committer: Ryan Sundberg <ry...@gmail.com>
Committed: Thu Oct 27 23:14:20 2016 -0700

----------------------------------------------------------------------
 lib/pbxProject.js | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/blob/4687604d/lib/pbxProject.js
----------------------------------------------------------------------
diff --git a/lib/pbxProject.js b/lib/pbxProject.js
index 9a2f5ed..23c0408 100644
--- a/lib/pbxProject.js
+++ b/lib/pbxProject.js
@@ -811,7 +811,7 @@ pbxProject.prototype.addTargetDependency = function(target, dependencyTargets) {
     return { uuid: target, target: nativeTargets[target] };
 }
 
-pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, comment, target, folderType, subfolderPath) {
+pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, comment, target, optionsOrFolderType, subfolderPath) {
     var buildPhaseSection,
         fileReferenceSection = this.pbxFileReferenceSection(),
         buildFileSection = this.pbxBuildFileSection(),
@@ -827,7 +827,9 @@ pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, co
         filePathToBuildFile = {};
 
     if (buildPhaseType === 'PBXCopyFilesBuildPhase') {
-        buildPhase = pbxCopyFilesBuildPhaseObj(buildPhase, folderType, subfolderPath, comment);
+        buildPhase = pbxCopyFilesBuildPhaseObj(buildPhase, optionsOrFolderType, subfolderPath, comment);
+    } else if (buildPhaseType === 'PBXShellScriptBuildPhase') {
+        buildPhase = pbxShellScriptBuildPhaseObj(buildPhase, optionsOrFolderType, comment)
     }
 
     if (!this.hash.project.objects[buildPhaseType]) {
@@ -1490,7 +1492,7 @@ function pbxBuildPhaseObj(file) {
     return obj;
 }
 
-function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName){
+function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName) {
 
      // Add additional properties for 'CopyFiles' build phase
     var DESTINATION_BY_TARGETTYPE = {
@@ -1523,6 +1525,18 @@ function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName){
     obj.name = '"' + phaseName + '"';
     obj.dstPath = subfolderPath || '""';
     obj.dstSubfolderSpec = SUBFOLDERSPEC_BY_DESTINATION[DESTINATION_BY_TARGETTYPE[folderType]];
+    console.log("pbxCopyFilesBuildPhase");
+    console.log(obj);
+
+    return obj;
+}
+
+function pbxShellScriptBuildPhaseObj(obj, options, phaseName) {
+    obj.name = '"' + phaseName + '"';
+    obj.inputPaths = options.inputPaths || [];
+    obj.outputPaths = options.outputPaths || [];
+    obj.shellPath = options.shellPath;
+    obj.shellScript = '"' + options.shellScript.replace(/"/g, '\\"') + '"';
 
     return obj;
 }


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