This document will guide you through the process of creating a new version of expokit
which is used in ejected projects and in Turtle. Instructions for creating a versioned snapshot of Expo SDK solely for Expo client's use, see Creating Versioned Expo SDK for Android
doc.
-
Update AARs in
expokit-npm-package
Why: AARs are prebuilt versions of Android libraries. Prebuilding them on our side allows developers and Turtle to build their projects faster and without extra setup steps that could be required for some libraries to work (eg. if we would decide to distribute
expoview
as a library to compile yourself).Prebuilt AARs for
expoview
and all unimodules are put intoexpokit
NPM package which is then published and depended upon by ejected user projects. Configuration inandroid/app/build.gradle
is set up so that ejected user projects include unimodules code fromnode_modules
(live code) andexpoview
from AAR (prebuilt). This allows developers to modify native code if needed and upgrade quicker. Turtle, on the other hand, uses AARs for bothexpoview
and unimodules.How: Run
expotools android-build-packages --sdkVersion XX.X.X
. The script will delete contents ofexpokit-npm-package
, clear local Maven repository, cleanbuild
folder for every package to prebuild and… prebuild (by running:{library-name}:uploadArchives
Gradle tasks). Archives are uploaded to local Maven repository from where they are then copied toexpokit-npm-package
.If the script fails during the compilation step of any package, it will print out the raw error message from Gradle. You should fix the error in the affected package. You may then either discard all changes made by the script to
expokit-npm-package
(deleted contents in preparation for new archives) and toandroid
(some changes should be committed after the script is done, some are temporary) and rerun the script entirely, or just rerun the script for the affected packages only. (Instructions will be printed from the script itself in this case.) -
Update Expo ejected project template
Why: When a developer runs
expo eject
, a template of an Android project is downloaded. For example it containsandroid/app
folder (so it containsbuild.gradle
, Java files, etc.)How: If the working directory is clean, run (anywhere in the repository)
et android-update-expokit --appVersion {appVersion} --sdkVersion {sdkVersion} --expokitVersion {expokitVersion} --expokitTag rc
{appVersion}
— version of the template, usually one would use the same version that is used inapp/build.gradle
as the version of Expo client{sdkVersion}
— SDK version for which the template is, (XX.X.X
){expokitVersion}
— version under whichexpokit-npm-package
should be published (XX.X.X-rc.0
)rc
— tag under whichexpokit-npm-package
should be published
This command will update the template on staging and publish
expokit
to NPM. -
Test Turtle on staging
Why: Turtle uses projects differently than developers of ejected projects, so we need to test this workflow separately.
How: Given you pushed the changes to
sdk-XX
branch, open (or create if needed) a pull request ofsdk-XX
tomaster
, go to Checks tab, openshell_app
CI workflow results for that branch and approve theshell_app_android_approve_build
job fromshell_app
workflow. Wait for theshell_app_android_build
job to finish, then copy the URL printed at the end and follow Turtle instructions of deploying a new version of SDK to staging. When deployed, runEXPO_STAGING=1 expo build:android
in an upcoming SDK unejected project. -
Test
expokit
package and ejected project templateWhy: Ejected projects are structured differently than Expo client project so we need to test them separately.
How: In an upcoming SDK unejected project (at least
expo init
, upgraded dependencies andapp.json
) runEXPO_STAGING=1 expo eject
. This should download the archived template and install recently publishedexpokit
. -
Publish
expokit
as latest stable versionWhy: Until now
expokit
should be published asrc
. We should publish it aslatest
, final version for clearness.How: Just as in step 2., run
et android-update-expokit
with finalexpokitVersion
andlatest
asexpokitTag
. -
Publish template to production
Why: Until now any changes were being made on staging, we now may want to push the changes to production.
How: This may be a subject to change, but right now go to
universe
repo and use PowerTools to promote versions to production — runpt promote-versions-to-prod
. -
Deploy Turtle to production
Why: So that people can build Android apps with new SDK.
How: Follow Turtle deployment instructions.