Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/SimulateLocation Fix #973

Merged
merged 32 commits into from
Feb 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6ab8a2b
Preemptively fix compilation for latest XcodeProj
jcolicchio Oct 9, 2020
199e0d3
Add StoreKitConfiguration to scheme and generator
jcolicchio Oct 9, 2020
10417ee
Add scheme generator test
jcolicchio Oct 9, 2020
d3c837e
Fix and add tests
jcolicchio Oct 9, 2020
7623ccd
Support StoreKitConfiguration in TargetScheme
jcolicchio Oct 9, 2020
b1acd63
Set default type of `storekit` to `.none`
jcolicchio Oct 10, 2020
2dde67f
Upgrade XcodeProj to 7.15.0
jcolicchio Oct 16, 2020
b908f7c
Create struct for StoreKitConfiguration
jcolicchio Oct 16, 2020
f445f10
Update tests
jcolicchio Oct 16, 2020
01bc9df
Add storekit configuration to test project
jcolicchio Oct 16, 2020
9d8bfc3
Update changelog
jcolicchio Oct 16, 2020
d372457
Merge remote-tracking branch 'origin/master' into feature/StoreKitCon…
jcolicchio Oct 16, 2020
b344a68
Update project spec
jcolicchio Oct 16, 2020
f6faee5
Fix xcodeprojs
jcolicchio Oct 16, 2020
fa36fe1
Fix projects
jcolicchio Oct 16, 2020
76cb652
Capitalize String
jcolicchio Oct 16, 2020
c156d62
Update CHANGELOG.md
jcolicchio Oct 17, 2020
e8370af
Refactor StoreKitConfiguration init from json
jcolicchio Oct 17, 2020
4f706cb
Merge branch 'feature/StoreKitConfiguration' of github.com:jcolicchio…
jcolicchio Oct 18, 2020
c102ab0
Change `forWorkspace` to `pathPrefix` and add tests
jcolicchio Oct 21, 2020
7722365
Merge branch 'master' into feature/StoreKitConfiguration
jcolicchio Dec 2, 2020
cdbd7dc
Merge remote-tracking branch 'origin' into feature/StoreKitConfiguration
jcolicchio Jan 11, 2021
1bd3135
Merge branch 'master' into feature/StoreKitConfiguration
jcolicchio Jan 12, 2021
90650ce
Merge branch 'master' into feature/StoreKitConfiguration
jcolicchio Feb 14, 2021
ffd6f1f
Replace StoreKitConfiguration struct with string + option
jcolicchio Feb 14, 2021
27be1cc
Fix tests
jcolicchio Feb 14, 2021
d001286
Update project spec
jcolicchio Feb 14, 2021
4244dc2
Fixup changelog
jcolicchio Feb 14, 2021
5da55f2
Add `See Options` to `storeKitConfiguration` in project spec
jcolicchio Feb 14, 2021
fb72d87
Make `simulateLocation` respect `schemePathPrefix`
jcolicchio Feb 14, 2021
75f8e37
Merge branch 'master' into bugfix/SimulateLocationFix
jcolicchio Feb 15, 2021
3133c8e
Update docs
jcolicchio Feb 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make simulateLocation respect schemePathPrefix
  • Loading branch information
jcolicchio committed Feb 14, 2021
commit fb72d873f8aff0b71baf964c5380ffa6ab6c683f
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#### Changed
- **Breaking**: Info.plists with custom prefixes are no longer added to the Copy Bundle Resources build phase [#945](https://github.com/yonaskolb/XcodeGen/pull/945) @anivaros
- **Breaking**: `workingDirectory` of included legacy targets is now made relative to including project [#981](https://github.com/yonaskolb/XcodeGen/pull/981) @jcolicchio
- **Breaking**: Make `simulateLocation` respect `schemePathPrefix` option. [#973](https://github.com/yonaskolb/XcodeGen/pull/973) @jcolicchio

#### Fixed
- Fixed error message output for `minimumXcodeGenVersion`. [#967](https://github.com/yonaskolb/XcodeGen/pull/967) @joshwalker
Expand Down
2 changes: 1 addition & 1 deletion Docs/ProjectSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ The different actions share some properties:
- [ ] **language**: **String** - `run` and `test` actions can define a language that is used for Application Language
- [ ] **region**: **String** - `run` and `test` actions can define a language that is used for Application Region
- [ ] **debugEnabled**: **Bool** - `run` and `test` actions can define a whether debugger should be used. This defaults to true.
- [ ] **simulateLocation**: **[Simulate Location](#simulate-location)** - `run` action can define a simulated location
- [ ] **simulateLocation**: **[Simulate Location](#simulate-location)** - `run` action can define a simulated location. See [Options](#options).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a note down in Simulate Location that it will use schemePathPrefix. Also not sure what this See Options refers to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thinking! I meant to refer to schemePathPrefix within Options, but putting it in the Simulate Location section makes more sense

- [ ] **askForAppToLaunch**: **Bool** - `run` action can define the executable set to ask to launch. This defaults to false.
- [ ] **launchAutomaticallySubstyle**: **String** - `run` action can define the launch automatically substyle ('2' for extensions).
- [ ] **storeKitConfiguration**: **String** - `run` action can specify a storekit configuration. See [Options](#options).
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGenKit/SchemeGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public class SchemeGenerator {
var locationScenarioReference: XCScheme.LocationScenarioReference?
if let simulateLocation = scheme.run?.simulateLocation, var identifier = simulateLocation.defaultLocation, let referenceType = simulateLocation.referenceType {
if referenceType == .gpx {
var path = Path("../\(identifier)")
var path = Path(components: [project.options.schemePathPrefix, identifier])
path = path.simplifyingParentDirectoryReferences()
identifier = path.string
}
Expand Down
8 changes: 6 additions & 2 deletions Tests/XcodeGenKitTests/SchemeGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class SchemeGeneratorTests: XCTestCase {
let scheme = Scheme(
name: "EnvironmentVariablesScheme",
build: Scheme.Build(targets: [buildTarget]),
run: Scheme.Run(config: "Debug", environmentVariables: runVariables, storeKitConfiguration: "Configuration.storekit"),
run: Scheme.Run(config: "Debug", environmentVariables: runVariables, simulateLocation: .init(allow: true, defaultLocation: "File.gpx"), storeKitConfiguration: "Configuration.storekit"),
test: Scheme.Test(config: "Debug"),
profile: Scheme.Profile(config: "Debug")
)
Expand All @@ -184,6 +184,8 @@ class SchemeGeneratorTests: XCTestCase {
).beTrue()
try expect(xcscheme.launchAction?.environmentVariables) == runVariables
try expect(xcscheme.launchAction?.storeKitConfigurationFileReference?.identifier) == "../Configuration.storekit"
try expect(xcscheme.launchAction?.locationScenarioReference?.referenceType) == Scheme.SimulateLocation.ReferenceType.gpx.rawValue
try expect(xcscheme.launchAction?.locationScenarioReference?.identifier) == "../File.gpx"
try expect(xcscheme.testAction?.environmentVariables).to.beNil()
try expect(xcscheme.profileAction?.environmentVariables).to.beNil()
}
Expand Down Expand Up @@ -238,7 +240,7 @@ class SchemeGeneratorTests: XCTestCase {
let scheme = Scheme(
name: "TestScheme",
build: Scheme.Build(targets: [buildTarget]),
run: Scheme.Run(config: "Debug", debugEnabled: false, storeKitConfiguration: "Configuration.storekit")
run: Scheme.Run(config: "Debug", debugEnabled: false, simulateLocation: .init(allow: true, defaultLocation: "File.gpx"), storeKitConfiguration: "Configuration.storekit")
)
let project = Project(
name: "test",
Expand All @@ -252,6 +254,8 @@ class SchemeGeneratorTests: XCTestCase {
try expect(xcscheme.launchAction?.selectedDebuggerIdentifier) == ""
try expect(xcscheme.launchAction?.selectedLauncherIdentifier) == "Xcode.IDEFoundation.Launcher.PosixSpawn"
try expect(xcscheme.launchAction?.storeKitConfigurationFileReference?.identifier) == "../../Configuration.storekit"
try expect(xcscheme.launchAction?.locationScenarioReference?.referenceType) == Scheme.SimulateLocation.ReferenceType.gpx.rawValue
try expect(xcscheme.launchAction?.locationScenarioReference?.identifier) == "../../File.gpx"
}

$0.it("generate scheme without debugger - test") {
Expand Down