-
Notifications
You must be signed in to change notification settings - Fork 36
feat: add run:ios command
#41
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
7602310
feat: add run:ios command
thymikee 57e21c6
refactor output for more feedback with spinners
thymikee e2facb6
adjust error handling
thymikee e0664e9
slightly better handling of ios-deploy
thymikee 593f1a6
remove --list-devices flag
thymikee 18addb5
move error to normalizer
thymikee 32d293f
drastically simplify createRun data flow
thymikee b5f745a
cleanup
thymikee 13289b6
add warnings and handle devices case
thymikee 940240a
use spawn
thymikee 966c436
create runOnMac helper
thymikee 5b5a257
move single-use utils closer to callsites
thymikee 464f577
handle prompt cancellation
thymikee 6120d9b
move code under src/lib to match repo convention
thymikee bdbc946
add success message
thymikee b75619f
add missing dot
thymikee d483139
remove copyright
thymikee e45f312
support preferred device; ts was right
thymikee 395bb58
extract selectDevice
thymikee 8e176e1
move warnings to helper
thymikee dd0d362
cache per platform, remove unused legacyPath
thymikee e2112b5
fix test
thymikee d1cf059
remove fallback sim logic; prompt for devices when none open or cached
thymikee 4142e56
allow for --simulator without specified name
thymikee c8a19fb
remove unixifyPaths
thymikee 3800e9d
remove preferred device logic
thymikee 1376ab6
perf: use devicectl instead of xcdevice; refactor Device
thymikee 5907dbe
base catalyst support with --catalyst flag
thymikee ec12ff0
get rid of chdir
thymikee f3261dc
feat: recent devices sort
thymikee 5bbd4a7
filter devices by platform
thymikee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
31 changes: 0 additions & 31 deletions
31
packages/plugin-platform-apple/src/commands/build/index.ts
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/plugin-platform-apple/src/lib/__tests__/dummy.test.ts
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
80 changes: 80 additions & 0 deletions
80
packages/plugin-platform-apple/src/lib/commands/build/createBuild.ts
This file contains hidden or 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,80 @@ | ||
| import { BuildFlags } from './buildOptions.js'; | ||
| import { buildProject } from './buildProject.js'; | ||
| import { | ||
| BuilderCommand, | ||
| ProjectConfig, | ||
| XcodeProjectInfo, | ||
| } from '../../types/index.js'; | ||
| import { logger } from '@callstack/rnef-tools'; | ||
| import { outro, cancel } from '@clack/prompts'; | ||
| import path from 'path'; | ||
| import { selectFromInteractiveMode } from '../../utils/selectFromInteractiveMode.js'; | ||
| import { getConfiguration } from './getConfiguration.js'; | ||
| import isInteractive from 'is-interactive'; | ||
|
|
||
| export const createBuild = async ( | ||
| platformName: BuilderCommand['platformName'], | ||
| projectConfig: ProjectConfig, | ||
| args: BuildFlags | ||
| ) => { | ||
| // TODO: add logic for installing Cocoapods based on @expo/fingerprint & pod-install package. | ||
|
|
||
| const { xcodeProject, sourceDir } = projectConfig; | ||
|
|
||
| if (!xcodeProject) { | ||
| logger.error( | ||
| `Could not find Xcode project files in "${sourceDir}" folder. Please make sure that you have installed Cocoapods and "${sourceDir}" is a valid path` | ||
| ); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| normalizeArgs(args, xcodeProject); | ||
|
|
||
| const { scheme, mode } = args.interactive | ||
| ? await selectFromInteractiveMode( | ||
| xcodeProject, | ||
| sourceDir, | ||
| args.scheme, | ||
| args.mode | ||
| ) | ||
| : await getConfiguration( | ||
| xcodeProject, | ||
| sourceDir, | ||
| args.scheme, | ||
| args.mode, | ||
| platformName | ||
| ); | ||
|
|
||
| try { | ||
| await buildProject( | ||
| xcodeProject, | ||
| sourceDir, | ||
| platformName, | ||
| undefined, | ||
| scheme, | ||
| mode, | ||
| args | ||
| ); | ||
| outro('Success 🎉.'); | ||
| } catch { | ||
| cancel('Command failed.'); | ||
| } | ||
| }; | ||
|
|
||
| function normalizeArgs(args: BuildFlags, xcodeProject: XcodeProjectInfo) { | ||
| if (!args.mode) { | ||
| args.mode = 'Debug'; | ||
| } | ||
| if (!args.scheme) { | ||
| args.scheme = path.basename( | ||
| xcodeProject.name, | ||
| path.extname(xcodeProject.name) | ||
| ); | ||
| } | ||
| if (args.interactive && !isInteractive()) { | ||
| logger.warn( | ||
| 'Interactive mode is not supported in non-interactive environments.' | ||
| ); | ||
| args.interactive = false; | ||
| } | ||
| } | ||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.