Skip to content

Commit

Permalink
Allow to generate Example.xcodeproj with xcodegen (#1935)
Browse files Browse the repository at this point in the history
* Allow to generate Example.xcodeproj with xcodegen

* Fix review comments

* Add installTokenScript to DebugApp

* Fix review comments

* Regenerate Examples.xcodeproj to sync with latest changes
  • Loading branch information
aleksproger authored Jan 16, 2024
1 parent 405e935 commit b7a9f9b
Show file tree
Hide file tree
Showing 25 changed files with 1,438 additions and 1,229 deletions.
2 changes: 2 additions & 0 deletions Apps/Examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*/Package.resolved
**/*/xcshareddata
1,798 changes: 951 additions & 847 deletions Apps/Examples/Examples.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand All @@ -14,7 +15,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077C4EE9252F7E88007636F1"
BlueprintIdentifier = "DF268D7B1F3C2B89CA87979A"
BuildableName = "Examples.app"
BlueprintName = "Examples"
ReferencedContainer = "container:Examples.xcodeproj">
Expand All @@ -26,45 +27,67 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES">
shouldUseLaunchSchemeArgsEnv = "NO"
onlyGenerateCoverageForSpecifiedTargets = "NO">
<TestPlans>
<TestPlanReference
reference = "container:../../Tests/TestPlans/Examples.xctestplan"
default = "YES">
default = "YES"
reference = "container:../../Tests/TestPlans/Examples.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:../../Tests/TestPlans/Examples no unit tests.xctestplan">
</TestPlanReference>
</TestPlans>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF268D7B1F3C2B89CA87979A"
BuildableName = "Examples.app"
BlueprintName = "Examples"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077C4F0A252F7E89007636F1"
BuildableName = "ExamplesUITests.xctest"
BlueprintName = "ExamplesUITests"
BlueprintIdentifier = "542BE47134765F0824559C2F"
BuildableName = "ExamplesTests.xctest"
BlueprintName = "ExamplesTests"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "ExamplesUITests/testEveryExample()">
</Test>
</SkippedTests>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077C4EFF252F7E89007636F1"
BuildableName = "ExamplesTests.xctest"
BlueprintName = "ExamplesTests"
BlueprintIdentifier = "F3570A57FF15EEC3B4529EF0"
BuildableName = "ExamplesUITests.xctest"
BlueprintName = "ExamplesUITests"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "MTL_HUD_ENABLED"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "MAPBOX_MAPS_SIGNPOSTS_ENABLED"
value = "1"
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "MAPBOX_REOPEN_EXAMPLE"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -80,20 +103,22 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077C4EE9252F7E88007636F1"
BlueprintIdentifier = "DF268D7B1F3C2B89CA87979A"
BuildableName = "Examples.app"
BlueprintName = "Examples"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "MAPBOX_MAPS_SIGNPOSTS_ENABLED"
value = "core,platform"
isEnabled = "NO">
key = "MTL_HUD_ENABLED"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "MTL_HUD_ENABLED"
key = "MAPBOX_MAPS_SIGNPOSTS_ENABLED"
value = "1"
isEnabled = "NO">
</EnvironmentVariable>
Expand All @@ -102,29 +127,43 @@
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "DEBUG_FINGERTIP_WINDOW"
value = "1"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldUseLaunchSchemeArgsEnv = "NO"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077C4EE9252F7E88007636F1"
BlueprintIdentifier = "DF268D7B1F3C2B89CA87979A"
BuildableName = "Examples.app"
BlueprintName = "Examples"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "MTL_HUD_ENABLED"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "MAPBOX_MAPS_SIGNPOSTS_ENABLED"
value = "1"
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "MAPBOX_REOPEN_EXAMPLE"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ extension FeatureIdentifier: CustomStringConvertible {
return number.description
case .string(let string):
return string
#if USING_TURF_WITH_LIBRARY_EVOLUTION
@unknown default:
return String(describing: self)
#endif
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ struct ViewportPlayground: View {
geometryType = "multiPolygon"
case .geometryCollection(_):
geometryType = "geometryCollection"
#if USING_TURF_WITH_LIBRARY_EVOLUTION
@unknown default:
geometryType = "unknownType"
#else
#endif
}
return "overview(\(geometryType))"
}
Expand Down
27 changes: 27 additions & 0 deletions Apps/Examples/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Examples
include:
- ../../xcodegen/Examples.yml
packages:
Fingertips:
url: [email protected]:mapbox/Fingertips.git
from: 0.6.0
MapboxMaps:
path: ../../.
targets:
Examples:
templates:
- swiftlintScript
- generateTokenFileScript
settings:
base:
SWIFT_OBJC_BRIDGING_HEADER: Examples/Examples-Bridging-Header.h
MAPBOXMAPS_PATH: ../../.
dependencies:REPLACE:
- package: MapboxMaps
- package: Fingertips
scheme:
testPlans:
- path: ../../Tests/TestPlans/Examples.xctestplan
defaultPlan: true
- path: ../../Tests/TestPlans/Examples no unit tests.xctestplan
defaultPlan: true
3 changes: 0 additions & 3 deletions Configurations/Examples.xcconfig

This file was deleted.

3 changes: 0 additions & 3 deletions Configurations/apps.xcconfig

This file was deleted.

71 changes: 0 additions & 71 deletions Configurations/base.xcconfig

This file was deleted.

7 changes: 0 additions & 7 deletions Configurations/unitTests.xcconfig

This file was deleted.

2 changes: 2 additions & 0 deletions Sources/MapboxMaps/Foundation/Extensions/Turf/Geometry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ extension Geometry {
return multiPolygon.coordinates.flatMap { $0.flatMap { $0 } }
case .geometryCollection(let geometryCollection):
return geometryCollection.geometries.flatMap { $0.coordinates }
#if USING_TURF_WITH_LIBRARY_EVOLUTION
@unknown default:
return []
#endif
}
}
}
2 changes: 2 additions & 0 deletions Sources/MapboxMaps/Style/Types/GeoJSONSourceData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ extension GeoJSONObject {
return .feature(feature)
case .featureCollection(let collection):
return .featureCollection(collection)
#if USING_TURF_WITH_LIBRARY_EVOLUTION
@unknown default:
Log.info(forMessage: "Unexpected \(GeoJSONObject.self) type: \(self)")
return .featureCollection(FeatureCollection(features: []))
#endif
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.747",
"red" : "0.207"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit b7a9f9b

Please sign in to comment.