Comparing version 0.6.0 to 0.6.1
@@ -86,4 +86,10 @@ var path = require('path'), | ||
this.settings = { ATTRIBUTES: ['Weak'] }; | ||
if (opt.compilerFlags) { | ||
if (!this.settings) | ||
this.settings = {}; | ||
this.settings.COMPILER_FLAGS = opt.compilerFlags; | ||
} | ||
} | ||
module.exports = pbxFile; |
@@ -234,3 +234,3 @@ var util = require('util'), | ||
this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase | ||
this.ensureCorrectSearchPaths(file); // make sure it gets built! | ||
this.addToLibrarySearchPaths(file); // make sure it gets built! | ||
@@ -447,6 +447,8 @@ return file; | ||
pbxProject.prototype.ensureCorrectSearchPaths = function (file) { | ||
pbxProject.prototype.removeFromLibrarySearchPaths = function (file) { | ||
var configurations = nonComments(this.pbxXCBuildConfigurationSection()), | ||
INHERITED = '"$(inherited)"', | ||
SEARCH_PATHS = 'LIBRARY_SEARCH_PATHS', | ||
config, buildSettings, searchPaths; | ||
var new_path = searchPathForFile(file, this); | ||
@@ -459,2 +461,26 @@ for (config in configurations) { | ||
if (buildSettings[SEARCH_PATHS]) { | ||
var matches = buildSettings[SEARCH_PATHS].filter(function(p) { | ||
return p.indexOf(new_path) > -1; | ||
}); | ||
matches.forEach(function(m) { | ||
var idx = buildSettings[SEARCH_PATHS].indexOf(m); | ||
buildSettings[SEARCH_PATHS].splice(idx, 1); | ||
}); | ||
} | ||
} | ||
} | ||
pbxProject.prototype.addToLibrarySearchPaths = function (file) { | ||
var configurations = nonComments(this.pbxXCBuildConfigurationSection()), | ||
INHERITED = '"$(inherited)"', | ||
config, buildSettings, searchPaths; | ||
for (config in configurations) { | ||
buildSettings = configurations[config].buildSettings; | ||
if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) | ||
continue; | ||
if (!buildSettings['LIBRARY_SEARCH_PATHS']) { | ||
@@ -490,3 +516,3 @@ buildSettings['LIBRARY_SEARCH_PATHS'] = [INHERITED]; | ||
if (file.path == filePath) { | ||
if (file.path == filePath || file.path == ('"' + filePath + '"')) { | ||
return true; | ||
@@ -493,0 +519,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "parser for xcodeproj/project.pbxproj files", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"main":"index.js", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -25,4 +25,19 @@ # node-xcode | ||
## Working on the parser | ||
If there's a problem parsing, you will want to edit the grammar under | ||
`lib/parser/pbxproj.pegjs`. You can test it online with the PEGjs online thingy | ||
at http://pegjs.majda.cz/online - I have had some mixed results though. | ||
Tests under the `test/parser` directory will compile the parser from the | ||
grammar. Other tests will use the prebuilt parser (`lib/parser/pbxproj.js`). | ||
To rebuild the parser js file after editing the grammar, run: | ||
./node_modules/.bin/pegjs lib/parser/pbxproj.pegjs | ||
(easier if `./node_modules/.bin` is in your path) | ||
## License | ||
MIT |
@@ -194,3 +194,11 @@ var pbxFile = require('../lib/pbxFile'); | ||
test.done(); | ||
}, | ||
'should be {COMPILER_FLAGS:"blah"} if compiler flags specified': function (test) { | ||
var sourceFile = new pbxFile('Plugins/BarcodeScanner.m', | ||
{ compilerFlags: "-fno-objc-arc" }); | ||
test.deepEqual({COMPILER_FLAGS:"-fno-objc-arc"}, sourceFile.settings); | ||
test.done(); | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267932
50
5064
43
14
2