Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

feat(expo-cli): add menu for build type #1479

Merged
merged 5 commits into from
Apr 13, 2020

Conversation

byCedric
Copy link
Member

@byCedric byCedric commented Jan 25, 2020

Fixes #1377

This is a pretty simple setup for the menu Brent described in #1377. The askBuildType accepts both the type (from flag) and available build types with a description (plain object).

What did you change?

  1. Moved the build:ios type check to askBuildType method in build/utils.js
  2. Added menu when build type is not defined
  3. Implemented askBuildType in both build:ios and build:android
  4. Removed the default values (in interactive mode, for non-interactive it uses the first default built type)
  5. Added nonInteractive check for old behavior to avoid breaking changes in people's CI/CD

By adding point 4, this change won't be a breaking change for non-internactive environments. Removing this is possible, but that would probably conflict with CI/CD systems where no type is defined.

Default option value and validation

It might be better to remove the option regex. Right now, it uses this regex and prevents bad input. I noticed that this does not work as expected with default values. I added an example below, but basically this happens:

  • expo build:android --type app-bundle -> { type: app-bundle }
  • expo build:android --type polymer -> { type: apk }
  • expo build:ios -> { type: archive }

Examples

expo build:android Android example
expo build:ios iOS example
Weird result I mentioned iOS example

@brentvatne
Copy link
Member

brentvatne commented Apr 8, 2020

yeah the regex is weird, we should just support only the exact inputs. otherwise this looks great to me! sorry i forgot about this! ping me when you have a chance to rebase and get rid of regex

@byCedric
Copy link
Member Author

No worries! 😄 I'll rebase and update it this weekend!

@codecov-io
Copy link

codecov-io commented Apr 11, 2020

Codecov Report

Merging #1479 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1479   +/-   ##
=======================================
  Coverage   58.52%   58.52%           
=======================================
  Files          89       89           
  Lines        2662     2662           
  Branches      730      730           
=======================================
  Hits         1558     1558           
  Misses       1073     1073           
  Partials       31       31           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da1360e...b85ed56. Read the comment docs.

This will open the build menu when they start a build without specifying types. It will take the first one from allowed types if its in non-interactive mode for non-breaking compatibility with CI/CD systems
@byCedric
Copy link
Member Author

@brentvatne finished it! 😄

@brentvatne brentvatne merged commit 73d22da into expo:master Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Present options when running expo build:[ios/android]
3 participants