Comparing version 0.3.3 to 0.3.4
@@ -6,3 +6,4 @@ var path = require('path'), | ||
XIB_EXTENSION = /[.]xib$/, XIB_FILE = 'file.xib', | ||
FRAMEWORK_EXTENSION = /[.]dylib$/, FRAMEWORK = '"compiled.mach-o.dylib"', | ||
DYLIB_EXTENSION = /[.]dylib$/, DYLIB = '"compiled.mach-o.dylib"', | ||
FRAMEWORK_EXTENSION = /[.]framework/, FRAMEWORK = 'wrapper.framework', | ||
DEFAULT_SOURCE_TREE = '"<group>"', | ||
@@ -27,2 +28,5 @@ DEFAULT_FILE_ENCODING = 4; | ||
if (DYLIB_EXTENSION.test(path)) | ||
return DYLIB; | ||
// dunno | ||
@@ -39,3 +43,3 @@ return 'unknown'; | ||
function defaultSourceTree(file) { | ||
if (file.lastType == FRAMEWORK) { | ||
if (file.lastType == DYLIB || file.lastType == FRAMEWORK) { | ||
return 'SDKROOT'; | ||
@@ -49,2 +53,4 @@ } else { | ||
if (file.lastType == FRAMEWORK) { | ||
return 'System/Library/Frameworks/' + filepath; | ||
} else if (file.lastType == DYLIB) { | ||
return 'usr/lib/' + filepath; | ||
@@ -59,3 +65,3 @@ } else { | ||
return 'Sources'; | ||
} else if (file.lastType == FRAMEWORK) { | ||
} else if (file.lastType == DYLIB) { | ||
return 'Frameworks'; | ||
@@ -62,0 +68,0 @@ } else { |
@@ -5,3 +5,3 @@ { | ||
"description": "parser for xcodeproj/project.pbxproj files", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"main":"index.js", | ||
@@ -8,0 +8,0 @@ "repository": { |
# node-xcode | ||
> parser for xcodeproj/project.pbxproj files | ||
> parser/toolkit for xcodeproj project files | ||
Not much to see yet | ||
Allows you to edit xcodeproject files and write them back out. | ||
## Example | ||
// API is a bit wonky right now | ||
var xcode = require('xcode'), | ||
fs = require('fs'), | ||
projectPath = 'myproject.xcodeproj/project.pbxproj', | ||
myProj = xcode.project(projectPath); | ||
// parsing is async, in a different process | ||
myProj.parse(function (err) { | ||
myProj.addHeaderFile('foo.h'); | ||
myProj.addSourceFile('foo.m'); | ||
myProj.addFramework('FooKit.framework'); | ||
fs.writeFileSync(projectPath, myProj.writeSync()); | ||
console.log('new project written'); | ||
}); | ||
## License | ||
MIT |
@@ -39,2 +39,9 @@ var pbxFile = require('../lib/pbxFile'); | ||
'should detect that a .framework path means wrapper.framework': function (test) { | ||
var sourceFile = new pbxFile('MessageUI.framework'); | ||
test.equal('wrapper.framework', sourceFile.lastType); | ||
test.done(); | ||
}, | ||
'should allow lastType to be overridden': function (test) { | ||
@@ -89,3 +96,3 @@ var sourceFile = new pbxFile('Plugins/ChildBrowser.m', | ||
exports['sourceTree'] = { | ||
'should be SDKROOT for frameworks': function (test) { | ||
'should be SDKROOT for dylibs': function (test) { | ||
var sourceFile = new pbxFile('libsqlite3.dylib'); | ||
@@ -97,2 +104,9 @@ | ||
'should be SDKROOT for frameworks': function (test) { | ||
var sourceFile = new pbxFile('MessageUI.framework'); | ||
test.equal('SDKROOT', sourceFile.sourceTree); | ||
test.done(); | ||
}, | ||
'should default to "<group>" otherwise': function (test) { | ||
@@ -115,3 +129,3 @@ var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); | ||
exports['path'] = { | ||
'should be "usr/lib" for frameworks (relative to SDKROOT)': function (test) { | ||
'should be "usr/lib" for dylibs (relative to SDKROOT)': function (test) { | ||
var sourceFile = new pbxFile('libsqlite3.dylib'); | ||
@@ -123,2 +137,10 @@ | ||
'should be "System/Library/Frameworks" for frameworks': function (test) { | ||
var sourceFile = new pbxFile('MessageUI.framework'); | ||
test.equal('System/Library/Frameworks/MessageUI.framework', sourceFile.path); | ||
test.done(); | ||
}, | ||
'should default to the first argument otherwise': function (test) { | ||
@@ -125,0 +147,0 @@ var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); |
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
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
214054
41
3798
28