-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
amplify-xcode: Import models command (#1055)
* amplify-xcode: importModels command * feat(feat/amplify-cli-ios): renamed to AmplifyXcode * feat(amplify-cli): Improve error messages * amplify-xcode: CLI exit code * amplify-xcode: re-enable swiftformat + swiftlint * amplify-xcode: refactor CLICommands into separate files * amplify-xcode: reword error messages, address PR comments * amplify-xcode: onFailure default no-op implementation * amplify-xcode: address PR comments * amplify-xcode: reword error messages, address PR comments * amplify-xcode: collect coverage * amplify-xcode: use ArgumentParser ExitCode.failure * amplify-xcode: re-gen pbxproj file * amplify-xcode: handle AmplifyCommandError with no underlying errors * amplify-xcode: remove inline comment
- Loading branch information
Showing
16 changed files
with
6,416 additions
and
8,243 deletions.
There are no files selected for viewing
14,003 changes: 5,920 additions & 8,083 deletions
14,003
AmplifyTools/AmplifyXcode/AmplifyXcode.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
138 changes: 90 additions & 48 deletions
138
.../AmplifyXcode/AmplifyXcode.xcodeproj/xcshareddata/xcschemes/AmplifyXcode-Package.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,92 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme LastUpgradeVersion = "9999" version = "1.3"> | ||
<BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BuildableName = "'lib$(TARGET_NAME)'" | ||
BlueprintName = "AmplifyXcodeCore" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
<BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BuildableName = "'$(TARGET_NAME)'" | ||
BlueprintName = "AmplifyXcode" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
codeCoverageEnabled = "NO"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BuildableName = "'$(TARGET_NAME)'" | ||
BlueprintName = "AmplifyXcodeCoreTests" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BuildableName = "'$(TARGET_NAME)'" | ||
BlueprintName = "AmplifyXcodeTests" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<Scheme | ||
LastUpgradeVersion = "9999" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcode" | ||
BuildableName = "AmplifyXcode" | ||
BlueprintName = "AmplifyXcode" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcodeCore" | ||
BuildableName = "AmplifyXcodeCore.framework" | ||
BlueprintName = "AmplifyXcodeCore" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcodeCoreTests" | ||
BuildableName = "AmplifyXcodeCoreTests.xctest" | ||
BlueprintName = "AmplifyXcodeCoreTests" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcodeTests" | ||
BuildableName = "AmplifyXcodeTests.xctest" | ||
BlueprintName = "AmplifyXcodeTests" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
158 changes: 100 additions & 58 deletions
158
...ifyTools/AmplifyXcode/AmplifyXcode.xcodeproj/xcshareddata/xcschemes/AmplifyXcode.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,106 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme LastUpgradeVersion = "9999" version = "1.3"> | ||
<BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BuildableName = "'$(TARGET_NAME)'" | ||
BlueprintName = "AmplifyXcode" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
codeCoverageEnabled = "NO"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
<Scheme | ||
LastUpgradeVersion = "9999" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcode" | ||
BuildableName = "AmplifyXcode" | ||
BlueprintName = "AmplifyXcode" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
codeCoverageEnabled = "YES" | ||
onlyGenerateCoverageForSpecifiedTargets = "YES"> | ||
<CodeCoverageTargets> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BuildableName = "'$(TARGET_NAME)'" | ||
BlueprintName = "AmplifyXcodeCoreTests" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcodeCore" | ||
BuildableName = "AmplifyXcodeCore.framework" | ||
BlueprintName = "AmplifyXcodeCore" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
</BuildableReference> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BuildableName = "'$(TARGET_NAME)'" | ||
BlueprintName = "AmplifyXcodeTests" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcode" | ||
BuildableName = "AmplifyXcode" | ||
BlueprintName = "AmplifyXcode" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BuildableName = "'$(TARGET_NAME)'" | ||
BlueprintName = "AmplifyXcode" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
</BuildableReference> | ||
</CodeCoverageTargets> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcodeTests" | ||
BuildableName = "AmplifyXcodeTests.xctest" | ||
BlueprintName = "AmplifyXcodeTests" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcodeCoreTests" | ||
BuildableName = "AmplifyXcodeCoreTests.xctest" | ||
BlueprintName = "AmplifyXcodeCoreTests" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "AmplifyXcode::AmplifyXcode" | ||
BuildableName = "AmplifyXcode" | ||
BlueprintName = "AmplifyXcode" | ||
ReferencedContainer = "container:AmplifyXcode.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
AmplifyTools/AmplifyXcode/Sources/AmplifyXcode/CLICommandImportConfig.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
import ArgumentParser | ||
import AmplifyXcodeCore | ||
|
||
/// CLI command invoking `CommandImportConfig`. | ||
struct CLICommandImportConfig: ParsableCommand, CommandExecutable, CLICommandReportable { | ||
static let configuration = CommandConfiguration( | ||
commandName: "import-config", | ||
abstract: CommandImportConfig.description | ||
) | ||
|
||
@Option(name: .shortAndLong, help: "Project base path") | ||
private var path: String = Process().currentDirectoryPath | ||
|
||
var environment: AmplifyCommandEnvironment { | ||
CommandEnvironment(basePath: path, fileManager: FileManager.default) | ||
} | ||
|
||
func run() throws { | ||
let output = exec(command: CommandImportConfig()) | ||
report(result: output) | ||
if case .failure = output { | ||
throw ExitCode.failure | ||
} | ||
} | ||
} |
Oops, something went wrong.