Skip to content

Commit

Permalink
[tools] Move tools/expotools one folder up (expo#11410)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsapeta authored Dec 21, 2020
1 parent 832e2e0 commit eeffdb1
Show file tree
Hide file tree
Showing 172 changed files with 15,657 additions and 20,408 deletions.
9 changes: 4 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ jobs:
- setup
- skip_unless_changed:
workflow_name: client
paths: tools/expotools secrets ios fastlane Gemfile .ruby-version
paths: tools secrets ios fastlane Gemfile .ruby-version
- update_submodules
- git_lfs_pull
- decrypt_secrets_if_possible
Expand Down Expand Up @@ -339,7 +339,7 @@ jobs:
- git_lfs_pull
- decrypt_secrets_if_possible
- yarn_restore_and_install:
working_directory: ~/project/tools/expotools
working_directory: ~/project/tools
- attach_workspace:
at: ios/simulator-build
- run: expotools client-build --platform ios --release
Expand Down Expand Up @@ -425,7 +425,7 @@ jobs:
- run: echo 'export S3_URI=s3://exp-artifacts/android-shell-builder-$CIRCLE_SHA1.tar.gz' >> $BASH_ENV
- install_yarn
- yarn_restore_and_install:
working_directory: ~/project/tools/expotools
working_directory: ~/project/tools
- run:
name: Check that Android packages are up-to-date
command: expotools check-android-packages
Expand Down Expand Up @@ -504,7 +504,7 @@ jobs:
- update_submodules
- decrypt_secrets_if_possible
- yarn_restore_and_install:
working_directory: ~/expo/tools/expotools
working_directory: ~/expo/tools
- attach_workspace:
at: android/app/build/outputs/apk
- run: expotools client-build --platform android --release
Expand All @@ -523,7 +523,6 @@ jobs:
name: Upload APK to Google Play and release to production
working_directory: ~/project
command: fastlane android prod_release

# Disabled until further notice
# See https://exponent-internal.slack.com/archives/C1QNF5L3C/p1576852692010900
# test_suite_publish:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/android-instrumentation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
- .github/workflows/android-instrumentation-tests.yml
- 'fastlane/**'
- 'packages/**/android/**'
- 'tools/expotools/**'
- 'tools/**'
- yarn.lock
pull_request:
branches: [master]
paths:
- .github/workflows/android-instrumentation-tests.yml
- 'fastlane/**'
- 'packages/**/android/**'
- 'tools/expotools/**'
- 'tools/**'
- yarn.lock

jobs:
Expand Down Expand Up @@ -47,4 +47,4 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./bin/expotools android-native-unit-tests --type instrumented
script: ./bin/expotools android-native-unit-tests --type instrumented
4 changes: 2 additions & 2 deletions .github/workflows/android-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
- .github/workflows/android-unit-tests.yml
- 'android/**'
- 'fastlane/**'
- 'tools/expotools/**'
- 'tools/**'
- yarn.lock
pull_request:
branches: [master]
paths:
- .github/workflows/android-unit-tests.yml
- 'android/**'
- 'fastlane/**'
- 'tools/expotools/**'
- 'tools/**'
- yarn.lock

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/client-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
paths:
- .github/workflows/client-ios.yml
- ios/**
- tools/expotools/**
- tools/**
- secrets/**
- fastlane/**
- Gemfile.lock
Expand All @@ -21,7 +21,7 @@ on:
paths:
- .github/workflows/client-ios.yml
- ios/**
- tools/expotools/**
- tools/**
- secrets/**
- fastlane/**
- Gemfile.lock
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/expotools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
branches: [master, 'sdk-*']
paths:
- .github/workflows/expotools.yml
- tools/expotools/**
- tools/**
pull_request:
branches: [master]
paths:
- .github/workflows/expotools.yml
- tools/expotools/**
- tools/**

jobs:
build:
Expand All @@ -24,10 +24,10 @@ jobs:
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('tools/expotools/yarn.lock') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('tools/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --ignore-scripts --frozen-lockfile
working-directory: tools/expotools
working-directory: tools
- run: yarn tsc
working-directory: tools/expotools
working-directory: tools
4 changes: 2 additions & 2 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ on:
branches: [master, 'sdk-*']
paths:
- .github/workflows/sdk.yml
- tools/expotools/**
- tools/**
- packages/**
- yarn.lock
pull_request:
branches: [master]
paths:
- .github/workflows/sdk.yml
- tools/expotools/**
- tools/**
- packages/**
- yarn.lock
schedule:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Expo is an open-source platform for making universal native apps that run on And
- [`home`](/home) contains the JavaScript source code of the app.
- [`ios`](/ios) contains the iOS project.
- [`ios/Exponent.xcworkspace`](/ios) is the Xcode workspace. Always open this instead of `Exponent.xcodeproj` because the workspace also loads the CocoaPods dependencies.
- [`tools/expotools`](/tools/expotools) contains build and configuration tools.
- [`tools`](/tools) contains build and configuration tools.
- [`template-files`](/template-files) contains templates for files that require private keys. They are populated using the keys in `template-files/keys.json`.
- [`template-files/ios/dependencies.json`](/template-files/ios/dependencies.json) specifies the CocoaPods dependencies of the app.

Expand Down
2 changes: 1 addition & 1 deletion android/expoview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class GenerateDynamicMacrosPlugin implements Plugin<Project> {
it.toLowerCase().contains("release")
} ? "release" : "debug"

workingDir '../../tools/expotools/bin'
workingDir '../../tools/bin'

if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd.exe', '/c', "expotools.js android-generate-dynamic-macros --configuration ${configuration}"
Expand Down
2 changes: 1 addition & 1 deletion apps/bare-expo/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class GenerateDynamicMacrosPlugin implements Plugin<Project> {
it.toLowerCase().contains("release")
} ? "release" : "debug"

workingDir '../../../../tools/expotools/bin'
workingDir '../../../../tools/bin'

if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd.exe', '/c', "expotools.js android-generate-dynamic-macros --configuration ${configuration}"
Expand Down
2 changes: 1 addition & 1 deletion bin/expotools
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -euo pipefail

script_dir=$(dirname "$0")
repository_root="${script_dir}/.."
expotools_dir="`cd ${repository_root}/tools/expotools;pwd;`"
expotools_dir="`cd ${repository_root}/tools;pwd;`"

exec "${expotools_dir}/bin/expotools.js" "$@"
42 changes: 21 additions & 21 deletions guides/releasing/Release Workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ In the managed workflow, we use our forked `react-native` repository because we

## 0.9. Publish `sdk-XX` project templates

| Prerequisites |
| ------------------------------------------------------------------------------------------- |
| Prerequisites |
| --------------------------------------------------------------------------- |
| [0.7. Publish `next` packages](#07-publish-any-missing-or-changed-packages) |

**Why:** We also need to prepare project templates that are used when people run `expo init` command and publish them to NPM registry to test in QA.
Expand Down Expand Up @@ -233,16 +233,16 @@ In the managed workflow, we use our forked `react-native` repository because we
- Run `et add-sdk --platform ios` to copy unversioned code into the new ABI and prefix (or suffix) its files and corresponding code references with `ABIXX_0_0`. If this script errors partway, you can always delete the new directory it created under `ios/versioned-react-native` and revert any other changes it made to `EXSDKVersions.plist` and `sdkVersions.json` (or just run `et remove-sdk --platform --sdkVersion XX.0.0`). Then it's safe to run this script again.
- Let the `add-sdk` script to regenerate Podfile and reinstall pods, then try to build the project in Xcode. This script does most of the work, but usually breaks in various ways, partly because some assumptions change every SDK cycle. If you found anything broken, please keep versioning script up to date.
- **Android**:
- Run `et add-sdk --platform android` to create the new versioned AAR and expoview code. This script will attempt to rename some native libraries and will ask you to manually verify that it has renamed them all properly. If you notice some that are missing, add them to the list in `tools/expotools/src/versioning/android/libraries.ts` and rerun the script. Commit the changes.
- Run `et add-sdk --platform android` to create the new versioned AAR and expoview code. This script will attempt to rename some native libraries and will ask you to manually verify that it has renamed them all properly. If you notice some that are missing, add them to the list in `tools/src/versioning/android/libraries.ts` and rerun the script. Commit the changes.
- You may need to make a change like [this one](https://github.com/expo/expo/commit/8581608ab748ed3092b71befc3a0b8a48f0f20a0#diff-c31b32364ce19ca8fcd150a417ecce58) in order to get the project to build, as the manifest merger script we're currently using doesn't handle this properly.
- Commit the changes to the `sdk-XX` branch and push. Take a look at the GitHub stats of added/deleted lines in your commit and be proud of your most productive day this month 😎.

# Stage 2 - Quality Assurance

## 2.1. Versioned Quality Assurance - Expo Go for iOS/Android

| Prerequisites |
| --------------------------------------------------------------------------- |
| Prerequisites |
| --------------------------------------------------------------------- |
| [1.3. Version code for the new SDK](#13-version-code-for-the-new-sdk) |

**Why:** We really care about the quality of the code that we release for the users. Quality Assurance is the most important task during the release process, so please don't ignore any steps and also focus on things that have been changed/reworked/refactored in this cycle.
Expand Down Expand Up @@ -333,8 +333,8 @@ Web is comparatively well-tested in CI, so a few manual smoke tests suffice for

## 3.1. Publish home

| Prerequisites |
| --- |
| Prerequisites |
| ----------------------------------------------------------------------- |
| [1.3. Unversioned Quality Assurance](#13-unversioned-quality-assurance) |

**Why:** We need to publish a new version of home in order to embed it in the Expo Go apps before building them.
Expand Down Expand Up @@ -375,8 +375,8 @@ Web is comparatively well-tested in CI, so a few manual smoke tests suffice for

## 3.3. Make a simulator/emulator build

| Prerequisites |
| --------------------------------------------------------- |
| Prerequisites |
| --------------------------------------------- |
| [3.2. Build and submit](#32-build-and-submit) |

**Why:** To allow developers to install Expo Go on the simulator (which doesn't have an App Store) we need to make a build for it, upload it to S3 servers and save its url and version on the versions endpoint. These builds are then downloaded and installed by the users using `expo client:install:ios`.
Expand All @@ -402,8 +402,8 @@ Web is comparatively well-tested in CI, so a few manual smoke tests suffice for

## 4.2. Make shell app build

| Prerequisites |
| ------------------------------------------------------------------------------------------------------------ |
| Prerequisites |
| ----------------------------------------------------------------------------------------------- |
| [4.1. Update JS dependencies required for build](#41-update-js-dependencies-required-for-build) |

**Why:** Shell app is a simple app on which Expo's Turtle work on to generate a standalone app. On iOS, shell app is compiled before it is uploaded to Turtle, so the process of building a standalone app is reduced to the minimum. We need to prepare such app for the new SDK, compile it, then put it into a tarball and put its url to Turtle's shellTarballs configs.
Expand All @@ -429,8 +429,8 @@ Web is comparatively well-tested in CI, so a few manual smoke tests suffice for

# Stage 5 - Beta release

| Prerequisites |
| --------------------------------------------- |
| Prerequisites |
| ------------------------------------------------------------------------ |
| **All previous steps** and App Store approval for TestFlight public beta |

Once everything above is completed and Apple has approved Expo Go (iOS) for the TestFlight public beta, the beta release is ready to go. Complete the following steps **in order**, ideally in fairly quick succession (not spread over multiple days).
Expand Down Expand Up @@ -470,7 +470,6 @@ Once everything above is completed and Apple has approved Expo Go (iOS) for the
- `react-native-unimodules`
- One way to get the right version numbers is to run `yarn why <package-name>` to see which version is used by apps in the expo/expo repo. Generally the version numbers should have a carat (`^`) except for `react-native-unimodules`, which should have a tilde (`~`).


## 5.4. Re-publish project templates

**Why:** Ensure that the templates include the latest version of packages, so when we release the beta
Expand All @@ -479,8 +478,8 @@ Once everything above is completed and Apple has approved Expo Go (iOS) for the

## 5.5. Promote versions to production with new SDK version flagged as beta

| Prerequisites |
| --------------------------------------------- |
| Prerequisites |
| ---------------------- |
| **All previous steps** |

**Why:** It's time for everything that uses the production versions endpoint to know about this new SDK version!
Expand All @@ -493,10 +492,10 @@ Once everything above is completed and Apple has approved Expo Go (iOS) for the

## 5.6. Add SDK support to Snack

| Prerequisites |
| ------------------------------------------------------------- |
| Prerequisites |
| ------------------------------------------------------------------------------------------- |
| [2.6. Publish any missing or changed packages](#26-publish-any-missing-or-changed-packages) |
| [4.2. Making a simulator/emulator build](#42-making-a-simulatoremulator-build) |
| [4.2. Making a simulator/emulator build](#42-making-a-simulatoremulator-build) |

**How:** Reach out to Hein (@ijzerenhein)

Expand All @@ -507,6 +506,7 @@ Once everything above is completed and Apple has approved Expo Go (iOS) for the
**How:**

Publish a blog post that includes the following information:

- Link to a GitHub umbrella issue for beta release issues
- Link to CHANGELOG
- Provide instructions for how to opt-in
Expand Down Expand Up @@ -622,8 +622,8 @@ Publish a blog post that includes the following information:

## 6.8. Press release

| Prerequisites |
| --------------------------------------------- |
| Prerequisites |
| ---------------------- |
| **All previous steps** |

This should be ready to publish immediately after the previous step is finished!
Expand Down
File renamed without changes.
File renamed without changes.
32 changes: 20 additions & 12 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Expo Tools

## Versioning Android

1. Run `gulp android-add-rn-version --abi=XX.X.X` in `tools`.
2. Add the new `expoview-abiXX_X_X` project as a dependency of `android/app/build.gradle`.
3. Open `android/versioned-abis/expoview-abiXX_X_X/build.gradle` and add missing `expo-payments-stripe` and `expo-constants` dependencies.
4. Remove `abiXX_X_X/expo/modules/print/PrintDocumentAdapter*Callback.java`.
5. Fix `abiXX_X_X.….R` (compilation will error) references and change them to `abiXX_X_X.host.exp.exponent.R`.
6. Open `VersionedUtils.java` and change two last arguments of `ExponentPackage` constructor to `null`s.
7. Open `PayFlow.java` in `abiXX_X_X` and fix `BuildConfig` reference (import `abiXX_X_X.host.exp.….BuildConfig`).
8. Open `ExponentPackage.java` in `abiXX_X_X` and remove offending line with `ExponentKernelModuleProvider` in `createNativeModules`.
# Expotools
A set of commands and libraries for working within the Expo repository.

Expotools is a CLI and library that contains internal Expo tooling. It is used as a library in CI and as a CLI to:
- Test and develop CI locally
- Run tests locally
- Assist with the release process

## Prerequisites
Run `bundle install` in the root to install all required Ruby gems.

## Usage
Run `expotools` or `et` from the Expo repository to run the latest version of expotools. This automatically rebuilds the code according to the latest sources.

For example, running `et --help` will display all the available commands.

## Development
Build the code once using `yarn build`.

`yarn watch` will watch for code changes and rebuild the code each time you save. The standard workflow for developing expotools is to leave `yarn watch` open in one tab and run `./bin/expotools COMMAND` in the other. Running `./bin/expotools` avoids the update check that happens when calling `expotools` or `et`.
3 changes: 0 additions & 3 deletions tools/android-versioning/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions tools/android-versioning/README.md

This file was deleted.

Loading

0 comments on commit eeffdb1

Please sign in to comment.