Skip to content

Commit

Permalink
Copy config.xml within copy-www-build-step.sh instead of in Copy Reso…
Browse files Browse the repository at this point in the history
…ruces step

Related to CB-5397.
This will allow users to delete the "Staging" group within a CLI project
without breaking their builds. They may want to do this so that there
isn't any confusion when between staging vs. non-staging when doing a
Quick-Open (Command-Shift-O).
  • Loading branch information
agrieve committed Dec 30, 2013
1 parent 58cfa47 commit 806651d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 32 deletions.
34 changes: 16 additions & 18 deletions bin/templates/project/__CLI__.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
7E7966E61810823500FA85AD /* icon-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DC1810823500FA85AD /* icon-small.png */; };
7E7966E71810823500FA85AD /* icon-small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DD1810823500FA85AD /* icon-small@2x.png */; };
D4A0D8761607E02300AEF8BB /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */; };
F840E1F1165FE0F500CFE078 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = F840E1F0165FE0F500CFE078 /* config.xml */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -62,7 +61,7 @@
/* Begin PBXFileReference section */
1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "__PROJECT_NAME__.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = __PROJECT_NAME__.app; sourceTree = BUILT_PRODUCTS_DIR; };
1F766FDD13BBADB100FB74C0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = "<group>"; };
1F766FE013BBADB100FB74C0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Localizable.strings; sourceTree = "<group>"; };
288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -100,10 +99,10 @@
7E7966DD1810823500FA85AD /* icon-small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-small@2x.png"; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* __PROJECT_NAME__-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "__PROJECT_NAME__-Info.plist"; path = "../__PROJECT_NAME__-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x~iphone.png"; sourceTree = "<group>"; };
EB87FDF21871DA7A0020F90C /* tests */ = {isa = PBXFileReference; lastKnownFileType = folder; name = merges; path = ../../merges; sourceTree = "<group>"; };
EB87FDF31871DA8E0020F90C /* node_modules */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
EB87FDF21871DA7A0020F90C /* merges */ = {isa = PBXFileReference; lastKnownFileType = folder; name = merges; path = ../../merges; sourceTree = "<group>"; };
EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../www/config.xml; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "__PROJECT_NAME__/config.xml"; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = __PROJECT_NAME__/config.xml; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -132,7 +131,7 @@
1D3623250D0F684500981E51 /* AppDelegate.m */,
);
name = Classes;
path = "__PROJECT_NAME__/Classes";
path = __PROJECT_NAME__/Classes;
sourceTree = SOURCE_ROOT;
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
Expand Down Expand Up @@ -163,8 +162,8 @@
isa = PBXGroup;
children = (
EB87FDF41871DAF40020F90C /* config.xml */,
EB87FDF31871DA8E0020F90C /* node_modules */,
EB87FDF21871DA7A0020F90C /* tests */,
EB87FDF31871DA8E0020F90C /* www */,
EB87FDF21871DA7A0020F90C /* merges */,
EB87FDF11871DA420020F90C /* Staging */,
301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
Expand All @@ -184,7 +183,7 @@
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
path = "__PROJECT_NAME__";
path = __PROJECT_NAME__;
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
Expand All @@ -199,7 +198,7 @@
8D1107310486CEB800E47090 /* __PROJECT_NAME__-Info.plist */,
);
name = Resources;
path = "__PROJECT_NAME__/Resources";
path = __PROJECT_NAME__/Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
Expand All @@ -226,7 +225,7 @@
children = (
);
name = Plugins;
path = "__PROJECT_NAME__/Plugins";
path = __PROJECT_NAME__/Plugins;
sourceTree = SOURCE_ROOT;
};
308D052D1370CCF300D202BF /* icons */ = {
Expand Down Expand Up @@ -306,8 +305,8 @@
dependencies = (
301BF551109A68C00062928A /* PBXTargetDependency */,
);
name = "__PROJECT_NAME__";
productName = "__PROJECT_NAME__";
name = __PROJECT_NAME__;
productName = __PROJECT_NAME__;
productReference = 1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */;
productType = "com.apple.product-type.application";
};
Expand All @@ -319,7 +318,7 @@
attributes = {
LastUpgradeCheck = 0500;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__PROJECT_NAME__" */;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__CLI__" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
Expand Down Expand Up @@ -363,7 +362,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F840E1F1165FE0F500CFE078 /* config.xml in Resources */,
7E7966E41810823500FA85AD /* icon-76.png in Resources */,
7E7966DF1810823500FA85AD /* icon-40@2x.png in Resources */,
308D05371370CCF300D202BF /* icon-72.png in Resources */,
Expand Down Expand Up @@ -495,7 +493,7 @@
"\"$(BUILT_PRODUCTS_DIR)/libCordova.a\"",
"-ObjC",
);
PRODUCT_NAME = "__PROJECT_NAME__";
PRODUCT_NAME = __PROJECT_NAME__;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -526,7 +524,7 @@
"\"$(BUILT_PRODUCTS_DIR)/libCordova.a\"",
"-ObjC",
);
PRODUCT_NAME = "__PROJECT_NAME__";
PRODUCT_NAME = __PROJECT_NAME__;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down Expand Up @@ -634,7 +632,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__PROJECT_NAME__" */ = {
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__CLI__" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
Expand Down
26 changes: 12 additions & 14 deletions bin/templates/project/__NON-CLI__.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
7E7966E61810823500FA85AD /* icon-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DC1810823500FA85AD /* icon-small.png */; };
7E7966E71810823500FA85AD /* icon-small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DD1810823500FA85AD /* icon-small@2x.png */; };
D4A0D8761607E02300AEF8BB /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */; };
F840E1F1165FE0F500CFE078 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = F840E1F0165FE0F500CFE078 /* config.xml */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -62,7 +61,7 @@
/* Begin PBXFileReference section */
1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "__PROJECT_NAME__.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = __PROJECT_NAME__.app; sourceTree = BUILT_PRODUCTS_DIR; };
1F766FDD13BBADB100FB74C0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = "<group>"; };
1F766FE013BBADB100FB74C0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Localizable.strings; sourceTree = "<group>"; };
288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -100,7 +99,7 @@
7E7966DD1810823500FA85AD /* icon-small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-small@2x.png"; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* __PROJECT_NAME__-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "__PROJECT_NAME__-Info.plist"; path = "../__PROJECT_NAME__-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x~iphone.png"; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "__PROJECT_NAME__/config.xml"; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = __PROJECT_NAME__/config.xml; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -129,7 +128,7 @@
1D3623250D0F684500981E51 /* AppDelegate.m */,
);
name = Classes;
path = "__PROJECT_NAME__/Classes";
path = __PROJECT_NAME__/Classes;
sourceTree = SOURCE_ROOT;
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
Expand Down Expand Up @@ -179,7 +178,7 @@
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
path = "__PROJECT_NAME__";
path = __PROJECT_NAME__;
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
Expand All @@ -194,7 +193,7 @@
8D1107310486CEB800E47090 /* __PROJECT_NAME__-Info.plist */,
);
name = Resources;
path = "__PROJECT_NAME__/Resources";
path = __PROJECT_NAME__/Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
Expand All @@ -221,7 +220,7 @@
children = (
);
name = Plugins;
path = "__PROJECT_NAME__/Plugins";
path = __PROJECT_NAME__/Plugins;
sourceTree = SOURCE_ROOT;
};
308D052D1370CCF300D202BF /* icons */ = {
Expand Down Expand Up @@ -292,8 +291,8 @@
dependencies = (
301BF551109A68C00062928A /* PBXTargetDependency */,
);
name = "__PROJECT_NAME__";
productName = "__PROJECT_NAME__";
name = __PROJECT_NAME__;
productName = __PROJECT_NAME__;
productReference = 1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */;
productType = "com.apple.product-type.application";
};
Expand All @@ -305,7 +304,7 @@
attributes = {
LastUpgradeCheck = 0500;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__PROJECT_NAME__" */;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
Expand Down Expand Up @@ -349,7 +348,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F840E1F1165FE0F500CFE078 /* config.xml in Resources */,
7E7966E41810823500FA85AD /* icon-76.png in Resources */,
7E7966DF1810823500FA85AD /* icon-40@2x.png in Resources */,
308D05371370CCF300D202BF /* icon-72.png in Resources */,
Expand Down Expand Up @@ -481,7 +479,7 @@
"\"$(BUILT_PRODUCTS_DIR)/libCordova.a\"",
"-ObjC",
);
PRODUCT_NAME = "__PROJECT_NAME__";
PRODUCT_NAME = __PROJECT_NAME__;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -512,7 +510,7 @@
"\"$(BUILT_PRODUCTS_DIR)/libCordova.a\"",
"-ObjC",
);
PRODUCT_NAME = "__PROJECT_NAME__";
PRODUCT_NAME = __PROJECT_NAME__;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down Expand Up @@ -620,7 +618,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__PROJECT_NAME__" */ = {
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
Expand Down
7 changes: 7 additions & 0 deletions bin/templates/scripts/cordova/lib/copy-www-build-step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ COPY_HIDDEN=
ORIG_IFS=$IFS
IFS=$(echo -en "\n\b")

if [[ -z "$BUILT_PRODUCTS_DIR" ]]; then
echo "The script is meant to be run as an Xcode build step and relies on env variables set by Xcode."
exit 1
fi
if [[ ! -e "$SRC_DIR" ]]; then
echo "Path does not exist: $SRC_DIR"
exit 1
Expand Down Expand Up @@ -74,6 +78,9 @@ for p in $(do_find -type f -print); do
fi
done

# Copy the config.xml file.
cp -f "${PROJECT_FILE_PATH%.xcodeproj}/config.xml" "$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME"

)
IFS=$ORIG_IFS

0 comments on commit 806651d

Please sign in to comment.