Skip to content

Commit

Permalink
XcodeGen refactor (#1989)
Browse files Browse the repository at this point in the history
* Refactor xcodegen

* Collect coverage for all targets

* Improve double-tap gesture test

* Add _settings suffix to setting groups
  • Loading branch information
OdNairy authored Jan 22, 2024
1 parent de9f4ca commit f3a6bc0
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 374 deletions.
291 changes: 67 additions & 224 deletions Apps/Examples/Examples.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand All @@ -27,17 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO"
onlyGenerateCoverageForSpecifiedTargets = "NO">
<TestPlans>
<TestPlanReference
default = "YES"
reference = "container:../../Tests/TestPlans/Examples.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:../../Tests/TestPlans/Examples no unit tests.xctestplan">
</TestPlanReference>
</TestPlans>
shouldUseLaunchSchemeArgsEnv = "NO">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -47,6 +36,37 @@
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "MTL_HUD_ENABLED"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "MTL_HUD_ALIGNMENT"
value = "20"
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>
<TestPlans>
<TestPlanReference
reference = "container:../../Tests/TestPlans/Examples.xctestplan"
default = "YES">
</TestPlanReference>
<TestPlanReference
reference = "container:../../Tests/TestPlans/Examples no unit tests.xctestplan">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -69,25 +89,6 @@
</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 @@ -109,14 +110,17 @@
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "MTL_HUD_ENABLED"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "MTL_HUD_ALIGNMENT"
value = "20"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "MAPBOX_MAPS_SIGNPOSTS_ENABLED"
value = "1"
Expand Down Expand Up @@ -145,14 +149,17 @@
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "MTL_HUD_ENABLED"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "MTL_HUD_ALIGNMENT"
value = "20"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "MAPBOX_MAPS_SIGNPOSTS_ENABLED"
value = "1"
Expand Down
24 changes: 11 additions & 13 deletions Apps/Examples/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@ name: Examples
include:
- ../../xcodegen/Examples.yml
packages:
Fingertips:
url: [email protected]:mapbox/Fingertips.git
from: 0.6.0
MapboxMaps:
path: ../../.
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
MAPBOXMAPS_PATH: ../../
scheme:
testPlans:
- path: ../../Tests/TestPlans/Examples.xctestplan
defaultPlan: true
- path: ../../Tests/TestPlans/Examples no unit tests.xctestplan
defaultPlan: true
defaultPlan: true

targetTemplates:
map-library:REPLACE:
dependencies:
- package: MapboxMaps

maps-dependencies:
dependencies:
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ final class DoubleTapGestureTestCase: GestureTestCase {
func testDefaultQuickZoomInTwoTaps() async throws {
try eventGenerator.fingerTap(numberOfTimes: 2)

XCTAssertFalse(mapView.camera.cameraAnimators.isEmpty)
await mapView.camera.cameraAnimators.waitForAllAnimations()

XCTAssertTrue(mapView.camera.cameraAnimators.isEmpty)
Expand Down
10 changes: 1 addition & 9 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,9 @@ packages:

targets:
Examples:
templates:
- swiftlintScript
- maps-dependencies
settings:
base:
SWIFT_OBJC_BRIDGING_HEADER: Apps/Examples/Examples/Examples-Bridging-Header.h
groups:
- turf_library_evolution_settings
dependencies:
- target: MapboxMaps
- package: Fingertips
scheme:
testTargets:
- MapboxMapsTests
Expand All @@ -53,4 +45,4 @@ targets:
settings:
base:
RUN_DOCUMENTATION_COMPILER: YES
OTHER_DOCC_FLAGS: "--warnings-as-errors"
OTHER_DOCC_FLAGS: "--warnings-as-errors"
15 changes: 9 additions & 6 deletions xcodegen/Examples.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Kila2/XcodeGen/master/Assets/json-schema/project.json

include:
- targets.yml
packages:
Fingertips:
url: [email protected]:mapbox/Fingertips.git
from: 0.6.0
targets:
Examples:
templates:
- application
- installTokenScript
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.mapbox.examples
SWIFT_OBJC_BRIDGING_HEADER: $(MAPBOXMAPS_PATH)/Apps/Examples/Examples/Examples-Bridging-Header.h
sources:
- path: ../Apps/Examples/Examples/
dependencies:
- package: Fingertips
scheme:
testTargets:
- ExamplesTests
- ExamplesUITests
environmentVariables:
- variable: MTL_HUD_ENABLED
value: 1
- variable: MAPBOX_MAPS_SIGNPOSTS_ENABLED
value: 1
isEnabled: false
- variable: MAPBOX_REOPEN_EXAMPLE
value: 1

Expand Down
3 changes: 2 additions & 1 deletion xcodegen/MapboxMaps.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Kila2/XcodeGen/master/Assets/json-schema/project.json

include:
- targets.yml
targets:
Expand All @@ -8,7 +10,6 @@ targets:
- maps-dependencies
settings:
groups:
- base_settings
- turf_library_evolution_settings
base:
INSTALL_PATH: $(LOCAL_LIBRARY_DIR)/Frameworks
Expand Down
5 changes: 3 additions & 2 deletions xcodegen/MapboxMapsTests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Kila2/XcodeGen/master/Assets/json-schema/project.json

include:
- targets.yml
targets:
Expand All @@ -15,8 +17,8 @@ targets:
MapboxTestHost:
templates:
- application
- installTokenScript
- maps-dependencies
- map-library
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: "com.mapbox.MapboxMapsTestHost"
Expand All @@ -30,7 +32,6 @@ targets:
- path: ../Sources/MapboxTestHost
dependencies:
- package: Fingertips
- target: MapboxMaps
scheme:
testTargets:
- MapboxMapsTests
Expand Down
81 changes: 0 additions & 81 deletions xcodegen/settings.yml

This file was deleted.

Loading

0 comments on commit f3a6bc0

Please sign in to comment.