Skip to content

Commit 7f2eadc

Browse files
committed
Convert and copy instructions plists on the fly
The conversion script now updates the submodule and copies the plists into the built product bundle. Every available language is copied. Deleted the checked-in instructions plists in favor of a Run Script build phase that runs this script. Also run the script as a preflight command in the podspec for CocoaPods users. Deleted the separate scheme that ran the script, now that everything is automatic.
1 parent 3bef7e3 commit 7f2eadc

File tree

6 files changed

+24
-1384
lines changed

6 files changed

+24
-1384
lines changed

OSRMTextInstructions.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ Pod::Spec.new do |s|
4848

4949
s.dependency "MapboxDirections.swift"
5050

51+
s.prepare_command = "./json2plist.sh"
52+
5153
s.xcconfig = {
5254
"SWIFT_VERSION" => "3.0"
5355
}
5456

5557
end
56-
57-

OSRMTextInstructions.xcodeproj/project.pbxproj

Lines changed: 15 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
358D145A1E5E355600ADE590 /* osrm-text-instructions.h in Headers */ = {isa = PBXBuildFile; fileRef = 358D14571E5E355600ADE590 /* osrm-text-instructions.h */; settings = {ATTRIBUTES = (Public, ); }; };
1818
358D145B1E5E355600ADE590 /* OSRMTextInstructions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 358D14581E5E355600ADE590 /* OSRMTextInstructions.swift */; };
1919
C51B63E91E65FA04002F4634 /* TokenType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51B63E81E65FA04002F4634 /* TokenType.swift */; };
20-
DAEACB551E788D4300E481C6 /* Instructions.plist in Resources */ = {isa = PBXBuildFile; fileRef = DAEACB571E788D4300E481C6 /* Instructions.plist */; };
2120
/* End PBXBuildFile section */
2221

2322
/* Begin PBXContainerItemProxy section */
@@ -43,8 +42,6 @@
4342
35EBDB5D1E5E1572006EB3CD /* OSRMTextInstructions.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OSRMTextInstructions.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4443
C51B63E81E65FA04002F4634 /* TokenType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenType.swift; sourceTree = "<group>"; };
4544
DA2DFB3B1E8373AF00CEEBE9 /* json2plist.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = json2plist.sh; sourceTree = "<group>"; };
46-
DAEACB561E788D4300E481C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = en; path = en.lproj/Instructions.plist; sourceTree = "<group>"; };
47-
DAEACB581E788D5100E481C6 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "zh-Hans"; path = "zh-Hans.lproj/Instructions.plist"; sourceTree = "<group>"; };
4845
/* End PBXFileReference section */
4946

5047
/* Begin PBXFrameworksBuildPhase section */
@@ -124,7 +121,6 @@
124121
DA0584D21E5E561D006F138F /* Resources */ = {
125122
isa = PBXGroup;
126123
children = (
127-
DAEACB571E788D4300E481C6 /* Instructions.plist */,
128124
);
129125
name = Resources;
130126
sourceTree = "<group>";
@@ -150,23 +146,6 @@
150146
};
151147
/* End PBXHeadersBuildPhase section */
152148

153-
/* Begin PBXLegacyTarget section */
154-
DA2DFB3D1E83744600CEEBE9 /* plists */ = {
155-
isa = PBXLegacyTarget;
156-
buildArgumentsString = "$(ACTION)";
157-
buildConfigurationList = DA2DFB3E1E83744600CEEBE9 /* Build configuration list for PBXLegacyTarget "plists" */;
158-
buildPhases = (
159-
);
160-
buildToolPath = ./json2plist.sh;
161-
buildWorkingDirectory = "$(SRCROOT)";
162-
dependencies = (
163-
);
164-
name = plists;
165-
passBuildSettingsInEnvironment = 1;
166-
productName = plists;
167-
};
168-
/* End PBXLegacyTarget section */
169-
170149
/* Begin PBXNativeTarget section */
171150
352BBC281E5E4D4200703DF1 /* OSRMTextInstructionsTests */ = {
172151
isa = PBXNativeTarget;
@@ -195,6 +174,7 @@
195174
35EBDB591E5E1572006EB3CD /* Frameworks */,
196175
35EBDB5A1E5E1572006EB3CD /* Headers */,
197176
35EBDB5B1E5E1572006EB3CD /* Resources */,
177+
DA2DFB411E84521100CEEBE9 /* Copy Instructions Property Lists */,
198178
);
199179
buildRules = (
200180
);
@@ -225,20 +205,13 @@
225205
LastSwiftMigration = 0820;
226206
ProvisioningStyle = Automatic;
227207
};
228-
DA2DFB3D1E83744600CEEBE9 = {
229-
CreatedOnToolsVersion = 8.2.1;
230-
DevelopmentTeam = GJZR2MEM28;
231-
ProvisioningStyle = Automatic;
232-
};
233208
};
234209
};
235210
buildConfigurationList = 35EBDB571E5E1572006EB3CD /* Build configuration list for PBXProject "OSRMTextInstructions" */;
236211
compatibilityVersion = "Xcode 3.2";
237212
developmentRegion = English;
238213
hasScannedForEncodings = 0;
239214
knownRegions = (
240-
en,
241-
"zh-Hans",
242215
);
243216
mainGroup = 35EBDB531E5E1572006EB3CD;
244217
productRefGroup = 35EBDB5E1E5E1572006EB3CD /* Products */;
@@ -247,7 +220,6 @@
247220
targets = (
248221
35EBDB5C1E5E1572006EB3CD /* OSRMTextInstructions */,
249222
352BBC281E5E4D4200703DF1 /* OSRMTextInstructionsTests */,
250-
DA2DFB3D1E83744600CEEBE9 /* plists */,
251223
);
252224
};
253225
/* End PBXProject section */
@@ -265,7 +237,6 @@
265237
isa = PBXResourcesBuildPhase;
266238
buildActionMask = 2147483647;
267239
files = (
268-
DAEACB551E788D4300E481C6 /* Instructions.plist in Resources */,
269240
);
270241
runOnlyForDeploymentPostprocessing = 0;
271242
};
@@ -287,6 +258,20 @@
287258
shellPath = /bin/sh;
288259
shellScript = "/usr/local/bin/carthage copy-frameworks";
289260
};
261+
DA2DFB411E84521100CEEBE9 /* Copy Instructions Property Lists */ = {
262+
isa = PBXShellScriptBuildPhase;
263+
buildActionMask = 2147483647;
264+
files = (
265+
);
266+
inputPaths = (
267+
);
268+
name = "Copy Instructions Property Lists";
269+
outputPaths = (
270+
);
271+
runOnlyForDeploymentPostprocessing = 0;
272+
shellPath = /bin/sh;
273+
shellScript = ./json2plist.sh;
274+
};
290275
/* End PBXShellScriptBuildPhase section */
291276

292277
/* Begin PBXSourcesBuildPhase section */
@@ -317,18 +302,6 @@
317302
};
318303
/* End PBXTargetDependency section */
319304

320-
/* Begin PBXVariantGroup section */
321-
DAEACB571E788D4300E481C6 /* Instructions.plist */ = {
322-
isa = PBXVariantGroup;
323-
children = (
324-
DAEACB561E788D4300E481C6 /* en */,
325-
DAEACB581E788D5100E481C6 /* zh-Hans */,
326-
);
327-
name = Instructions.plist;
328-
sourceTree = "<group>";
329-
};
330-
/* End PBXVariantGroup section */
331-
332305
/* Begin XCBuildConfiguration section */
333306
352BBC311E5E4D4200703DF1 /* Debug */ = {
334307
isa = XCBuildConfiguration;
@@ -512,31 +485,6 @@
512485
};
513486
name = Release;
514487
};
515-
DA2DFB3F1E83744600CEEBE9 /* Debug */ = {
516-
isa = XCBuildConfiguration;
517-
buildSettings = {
518-
DEBUGGING_SYMBOLS = YES;
519-
DEBUG_INFORMATION_FORMAT = dwarf;
520-
DEVELOPMENT_TEAM = GJZR2MEM28;
521-
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
522-
GCC_OPTIMIZATION_LEVEL = 0;
523-
OTHER_CFLAGS = "";
524-
OTHER_LDFLAGS = "";
525-
PRODUCT_NAME = "$(TARGET_NAME)";
526-
};
527-
name = Debug;
528-
};
529-
DA2DFB401E83744600CEEBE9 /* Release */ = {
530-
isa = XCBuildConfiguration;
531-
buildSettings = {
532-
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
533-
DEVELOPMENT_TEAM = GJZR2MEM28;
534-
OTHER_CFLAGS = "";
535-
OTHER_LDFLAGS = "";
536-
PRODUCT_NAME = "$(TARGET_NAME)";
537-
};
538-
name = Release;
539-
};
540488
/* End XCBuildConfiguration section */
541489

542490
/* Begin XCConfigurationList section */
@@ -567,14 +515,6 @@
567515
defaultConfigurationIsVisible = 0;
568516
defaultConfigurationName = Release;
569517
};
570-
DA2DFB3E1E83744600CEEBE9 /* Build configuration list for PBXLegacyTarget "plists" */ = {
571-
isa = XCConfigurationList;
572-
buildConfigurations = (
573-
DA2DFB3F1E83744600CEEBE9 /* Debug */,
574-
DA2DFB401E83744600CEEBE9 /* Release */,
575-
);
576-
defaultConfigurationIsVisible = 0;
577-
};
578518
/* End XCConfigurationList section */
579519
};
580520
rootObject = 35EBDB541E5E1572006EB3CD /* Project object */;

OSRMTextInstructions.xcodeproj/xcshareddata/xcschemes/Instructions Plists.xcscheme

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)