Comparing version 0.5.3 to 0.5.4
@@ -557,8 +557,15 @@ var util = require('util'), | ||
function searchPathForFile(file, proj) { | ||
var pluginsPath = proj.pbxGroupByName('Plugins').path; | ||
var pluginsPath = proj.pbxGroupByName('Plugins').path, | ||
fileDir = path.dirname(file.path); | ||
if (fileDir == '.') { | ||
fileDir = ''; | ||
} else { | ||
fileDir = '/' + fileDir; | ||
} | ||
if (file.plugin && pluginsPath) { | ||
return '"\\"$(SRCROOT)/' + unquote(pluginsPath) + '\\""'; | ||
} else { | ||
return '"\\"$(SRCROOT)/' + proj.productName + '\\""'; | ||
return '"\\"$(SRCROOT)/' + proj.productName + fileDir + '\\""'; | ||
} | ||
@@ -565,0 +572,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "parser for xcodeproj/project.pbxproj files", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"main":"index.js", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -185,20 +185,40 @@ var fullProject = require('./fixtures/full-project') | ||
}, | ||
'should add the right LIBRARY_SEARCH_PATHS entry for plugins': function (test) { | ||
plugins = proj.pbxGroupByName('Plugins'); | ||
plugins.path = '"Test200/Plugins"'; | ||
'should add the right LIBRARY_SEARCH_PATHS entry for plugins': { | ||
'with group set': function (test) { | ||
plugins = proj.pbxGroupByName('Plugins'); | ||
plugins.path = '"Test200/Plugins"'; | ||
var newFile = proj.addStaticLibrary('libGoogleAnalytics.a', | ||
{ plugin: true }), | ||
libraryPaths = librarySearchPaths(proj), | ||
expectedPath = '"\\"$(SRCROOT)/Test200/Plugins\\""', | ||
i, current; | ||
var newFile = proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', | ||
{ plugin: true }), | ||
libraryPaths = librarySearchPaths(proj), | ||
expectedPath = '"\\"$(SRCROOT)/Test200/Plugins\\""', | ||
i, current; | ||
for (i = 0; i < libraryPaths.length; i++) { | ||
current = libraryPaths[i]; | ||
test.ok(current.indexOf(expectedPath) >= 0, | ||
expectedPath + ' not found in ' + current); | ||
for (i = 0; i < libraryPaths.length; i++) { | ||
current = libraryPaths[i]; | ||
test.ok(current.indexOf(expectedPath) >= 0, | ||
expectedPath + ' not found in ' + current); | ||
} | ||
test.done(); | ||
}, | ||
'without group set': function (test) { | ||
plugins = proj.pbxGroupByName('Plugins'); | ||
delete plugins.path; | ||
var newFile = proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', | ||
{ plugin: true }), | ||
libraryPaths = librarySearchPaths(proj), | ||
expectedPath = '"\\"$(SRCROOT)/KitchenSinktablet/Plugins\\""', | ||
i, current; | ||
for (i = 0; i < libraryPaths.length; i++) { | ||
current = libraryPaths[i]; | ||
test.ok(current.indexOf(expectedPath) >= 0, | ||
expectedPath + ' not found in ' + current); | ||
} | ||
test.done(); | ||
} | ||
test.done(); | ||
} | ||
} |
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
255477
4788