@@ -214,7 +214,14 @@ pbxProject.prototype.removeHeaderFile = function (path, opt, group) {
214214 }
215215}
216216
217- pbxProject . prototype . addResourceFile = function ( path , opt ) {
217+ /**
218+ *
219+ * @param path {String}
220+ * @param opt {Object} see pbxFile for avail options
221+ * @param group {String} group key
222+ * @returns {Object } file; see pbxFile
223+ */
224+ pbxProject . prototype . addResourceFile = function ( path , opt , group ) {
218225 opt = opt || { } ;
219226
220227 var file ;
@@ -223,7 +230,7 @@ pbxProject.prototype.addResourceFile = function(path, opt) {
223230 file = this . addPluginFile ( path , opt ) ;
224231 if ( ! file ) return false ;
225232 } else {
226- file = new pbxFile ( path , opt ) ;
233+ file = new pbxFile ( path , opt ) ;
227234 if ( this . hasFile ( file . path ) ) return false ;
228235 }
229236
@@ -234,27 +241,45 @@ pbxProject.prototype.addResourceFile = function(path, opt) {
234241 correctForResourcesPath ( file , this ) ;
235242 file . fileRef = this . generateUuid ( ) ;
236243 }
237-
244+
238245 this . addToPbxBuildFileSection ( file ) ; // PBXBuildFile
239246 this . addToPbxResourcesBuildPhase ( file ) ; // PBXResourcesBuildPhase
240-
247+
241248 if ( ! opt . plugin ) {
242249 this . addToPbxFileReferenceSection ( file ) ; // PBXFileReference
243- this . addToResourcesPbxGroup ( file ) ; // PBXGroup
250+ if ( group ) {
251+ this . addToPbxGroup ( file , group ) ; //Group other than Resources (i.e. 'splash')
252+ }
253+ else {
254+ this . addToResourcesPbxGroup ( file ) ; // PBXGroup
255+ }
256+
244257 }
245-
258+
246259 return file ;
247260}
248261
249- pbxProject . prototype . removeResourceFile = function ( path , opt ) {
262+ /**
263+ *
264+ * @param path {String}
265+ * @param opt {Object} see pbxFile for avail options
266+ * @param group {String} group key
267+ * @returns {Object } file; see pbxFile
268+ */
269+ pbxProject . prototype . removeResourceFile = function ( path , opt , group ) {
250270 var file = new pbxFile ( path , opt ) ;
251271 file . target = opt ? opt . target : undefined ;
252272
253273 correctForResourcesPath ( file , this ) ;
254274
255275 this . removeFromPbxBuildFileSection ( file ) ; // PBXBuildFile
256276 this . removeFromPbxFileReferenceSection ( file ) ; // PBXFileReference
257- this . removeFromResourcesPbxGroup ( file ) ; // PBXGroup
277+ if ( group ) {
278+ this . removeFromPbxGroup ( file , group ) ; //Group other than Resources (i.e. 'splash')
279+ }
280+ else {
281+ this . removeFromResourcesPbxGroup ( file ) ; // PBXGroup
282+ }
258283 this . removeFromPbxResourcesBuildPhase ( file ) ; // PBXResourcesBuildPhase
259284
260285 return file ;
0 commit comments