Compare commits

..
347 Commits
Author SHA1 Message Date
Dominik Sokal 80bc77da57 Update README.md (#421) 2023-04-07 13:02:54 +02:00
Wojciech Kozyra 31d3367d1b Remove automatic example repo update (#417) 2023-01-05 14:26:38 +01:00
Brent Vatne 7b8323948d Update README to indicate that users should migrate to EAS Build 2022-10-25 15:51:46 -07:00
Kudo Chien ace282c1fc Update CHANGELOG 2022-08-22 20:42:24 +08:00
Kudo Chien 4d440c0c2e Release 0.28.1 2022-08-22 20:40:23 +08:00
Kudo Chien b3a6d30ba4 Update Android shell tarball for SDK 46 2022-08-22 18:27:54 +08:00
Brent Vatne f094abe5d1 Update CHANGELOG 2022-08-19 11:26:47 -07:00
Brent Vatne 49c8c77f7c Release 0.28.0 2022-08-19 10:07:51 -07:00
Kudo Chien 1cc7687e66 Add sdk 46 support (#411) 2022-08-19 10:03:55 -07:00
Kudo Chien 2a6eafe236 Update CHANGELOG 2022-07-26 19:54:28 +08:00
Kudo Chien f3fe2e2506 Release 0.27.5 2022-07-26 19:46:39 +08:00
Kudo Chien 98be72a229 Update iOS shell tarballs for SDK 43, 44, 45 2022-07-25 22:57:33 +08:00
Kudo Chien 2ed0456fe5 Update CHANGELOG 2022-06-28 12:31:48 +08:00
Kudo Chien 2ff91c1b2a Release 0.27.4 2022-06-28 12:30:49 +08:00
Kudo Chien b436e86c75 Update Android shell tarball for SDK 45
Fix expo-notifications `useLastNotificationResponse` overwritten issue on Android 12
2022-06-28 08:36:28 +08:00
Kudo Chien c14079626c Update CHANGELOG 2022-06-18 02:24:15 +08:00
Kudo Chien f8f38a1c0d Release 0.27.3 2022-06-18 02:21:20 +08:00
Kudo Chien 45ec180a89 Update Android shell tarball for SDK 45
Fix notification trampoline issues for Android 12+
2022-06-17 19:05:55 +08:00
Brent Vatne a0d9196b7b Update CHANGELOG 2022-06-15 14:09:36 -07:00
Brent Vatne 3acd5cc4b3 Release 0.27.2 2022-06-15 14:08:27 -07:00
Brent Vatne 8a3e12956a Update Android shell tarball for SDK 44, 43 2022-06-15 12:07:58 -07:00
Brent Vatne 7b4c2dccf4 Update CHANGELOG 2022-06-13 14:11:11 -07:00
Brent Vatne 795b4f5137 Release 0.27.1 2022-06-13 14:08:08 -07:00
Brent Vatne 7a627ecd04 Update Android shell tarball for SDK 45 2022-06-13 12:35:03 -07:00
Brent Vatne 2b1a2152bf Update CHANGELOG 2022-05-23 12:59:26 -07:00
Brent Vatne 56c1460858 Release 0.27.0 2022-05-23 12:58:05 -07:00
Kudo Chien 93b88f7b05 Update android sdk 45 tarball to fix build errors (#401) 2022-05-23 22:28:32 +08:00
Wojciech Kozyra 240be8fba3 update to node 14.17.3 (#400) 2022-05-19 12:25:09 +02:00
Brent Vatne 39a1d0f66f Add shell tarballs for SDK 45 2022-05-18 19:07:06 -07:00
dependabot[bot] d93e3d95a9 Bump minimist from 1.2.0 to 1.2.6 (#394)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.0 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.0...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-01 10:51:50 +02:00
Wojciech Kozyra c5e36a6059 Release 0.26.0 2022-03-21 15:42:26 +01:00
Wojciech Kozyra 7cfab9b5fc Update CHANGELOG 2022-03-21 15:30:01 +01:00
dependabot[bot] e69014b19d Bump url-parse from 1.5.7 to 1.5.10 (#390)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 12:58:03 +01:00
dependabot[bot] 6d9824f6c3 Bump plist from 3.0.1 to 3.0.4 (#391)
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.1 to 3.0.4.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 12:53:42 +01:00
Wojciech Kozyra cf9626e998 Switch to JDK 11 (#389)
* switch to jdk 11

* review feedback
2022-03-21 12:46:05 +01:00
Wojciech Kozyra f29ff83ade Update CHANGELOG 2022-03-11 13:40:16 +01:00
Wojciech Kozyra 6f9c9fc95a Release 0.25.0 2022-03-11 13:33:17 +01:00
Wojciech Kozyra 4ea23f6433 Update @expo/xdl (disable bitcode) 2022-03-10 18:49:22 +01:00
dependabot[bot] f6199a276d Bump postcss from 7.0.14 to 7.0.39 (#378)
Bumps [postcss](https://github.com/postcss/postcss) from 7.0.14 to 7.0.39.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/7.0.39/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/7.0.14...7.0.39)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 12:14:37 +01:00
dependabot[bot] b4c9dcbc7b Bump undefsafe from 2.0.2 to 2.0.5 (#382)
Bumps [undefsafe](https://github.com/remy/undefsafe) from 2.0.2 to 2.0.5.
- [Release notes](https://github.com/remy/undefsafe/releases)
- [Commits](https://github.com/remy/undefsafe/compare/v2.0.2...v2.0.5)

---
updated-dependencies:
- dependency-name: undefsafe
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 12:14:28 +01:00
dependabot[bot] f7433bb574 Bump pathval from 1.1.0 to 1.1.1 (#383)
Bumps [pathval](https://github.com/chaijs/pathval) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/chaijs/pathval/releases)
- [Changelog](https://github.com/chaijs/pathval/blob/master/CHANGELOG.md)
- [Commits](https://github.com/chaijs/pathval/compare/v1.1.0...v1.1.1)

---
updated-dependencies:
- dependency-name: pathval
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 12:14:20 +01:00
dependabot[bot] e14387b439 Bump follow-redirects from 1.14.7 to 1.14.8 (#384)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 12:14:07 +01:00
dependabot[bot] be09542233 Bump simple-get from 3.0.3 to 3.1.1 (#387)
Bumps [simple-get](https://github.com/feross/simple-get) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/feross/simple-get/releases)
- [Commits](https://github.com/feross/simple-get/compare/v3.0.3...v3.1.1)

---
updated-dependencies:
- dependency-name: simple-get
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 12:13:59 +01:00
dependabot[bot] acdd0e2328 Bump node-fetch from 2.6.1 to 2.6.7 (#388)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 12:13:46 +01:00
dependabot[bot] f46d852f7f Bump url-parse from 1.5.3 to 1.5.7 (#386)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.7.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.3...1.5.7)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 12:09:06 +01:00
dependabot[bot] afa29341a7 Bump follow-redirects from 1.13.0 to 1.14.7 (#377)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.13.0 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.13.0...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-18 11:47:55 +01:00
Quinlan Jung ca842ebf56 switch cloudfront domain to classic-assets.eascdn.net (#375)
* switch cloudfront domain to classic-assets.eascdn.net

* changelog
2022-01-05 17:12:54 -08:00
Kudo Chien 6f6aec53bb Update CHANGELOG 2021-12-29 22:06:17 +08:00
Kudo Chien c126e9d5cf Release 0.24.3 2021-12-29 22:03:55 +08:00
Kudo Chien fd8e110f38 Update ios sdk 44 shell tarball with orientation lock fix 2021-12-29 20:42:16 +08:00
Kudo Chien 91545a2726 Update CHANGELOG 2021-12-17 00:33:20 +08:00
Kudo Chien 18f58cfc87 Release 0.24.2 2021-12-17 00:29:53 +08:00
Kudo Chien 5db06fa07b Update android sdk 44 shell tarball 2021-12-17 00:25:52 +08:00
Kudo Chien 4faf23de16 Update CHANGELOG 2021-12-16 01:14:35 +08:00
Kudo Chien f432a14d2f Release 0.24.1 2021-12-16 01:12:40 +08:00
Kudo Chien e957ea0b13 Update android and ios shell tarballs for sdk 44 rc (#369)
### Description

update sdk 44 tarballs mainly for react-native-gesture-handler 2.1.0 updates
2021-12-16 01:04:16 +08:00
Brent Vatne 259dc4827c Update CHANGELOG 2021-12-10 09:37:42 -08:00
Brent Vatne aaea6f80c0 Release 0.24.0 2021-12-10 09:32:37 -08:00
Brent Vatne 2ce4f9f923 Resolve modules by either unimodule.json or expo-module.config.json (#368) 2021-12-09 18:08:55 -08:00
Brent Vatne 9cd489a297 Update iOS and Android tarballs for SDK 44 beta 2021-12-09 14:18:33 -08:00
Wojciech Kozyra 06f10977aa redirect google bintray url to localhost (#361) 2021-12-09 15:28:08 +01:00
Kudo Chien 9ba1302bfa Release 0.23.6 2021-12-08 23:41:38 +08:00
Kudo Chien a166a789fa [android] Update android shell tarballs for bintray error fix (#363)
### Motivation and Context

fix android gradle build errors for dl.bintray.com and google.bintray.com return http 502.

### Description

apply https://github.com/expo/expo/pull/15349 to sdk 40-43 shell apps.
2021-12-08 23:35:00 +08:00
Wojciech Kozyra 377a8fbcf9 update aws sdk (#365)
* override region from secrets

* update aws-sdk package
2021-12-06 16:45:15 +01:00
Wojciech Kozyra e3d685e416 Revert "Bump aws-sdk from 2.407.0 to 2.814.0 (#359)"
This reverts commit 32683d082b.
2021-11-30 13:19:00 +01:00
Wojciech Kozyra 2ac41fa82d redirect google bintray url to localhost (#361) 2021-11-30 13:10:15 +01:00
dependabot[bot] 32683d082b Bump aws-sdk from 2.407.0 to 2.814.0 (#359)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.407.0 to 2.814.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.407.0...v2.814.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-25 13:37:11 +01:00
Kudo Chien d629cd439b update changelog 2021-11-12 11:37:03 +08:00
Kudo Chien 293e49fd00 Release 0.23.5 2021-11-12 11:34:28 +08:00
Kudo Chien 5563d16bda [ios] update SDK 43 tarball with expo-updates fix (#358) 2021-11-12 11:27:32 +08:00
Eric Samelson 6c5209e88f update changelog 2021-11-09 16:53:08 -08:00
Eric Samelson 54c73dba8e Release 0.23.4 2021-11-09 16:51:49 -08:00
Eric Samelson 81892b8c22 [android] update sdk 43 tarball (#356) 2021-11-09 16:50:48 -08:00
Eric Samelson cfd704d4b6 update changelog 2021-11-04 21:08:14 -07:00
Eric Samelson dd79348228 Release 0.23.3 2021-11-04 21:07:11 -07:00
Eric Samelson c0eaa0de4f [ios][android] update SDK 43 tarballs with expo-updates fix (#355) 2021-11-04 21:03:01 -07:00
Wojciech Kozyra fa8576a36b increase memory request for android workers 2021-11-04 11:10:08 +01:00
Cedric van Putten ac25927326 Update changelog with Android tarball bump 2021-10-29 01:18:37 +02:00
Cedric van Putten 2a23a4c97f Release 0.23.2 2021-10-29 01:17:04 +02:00
Cedric van Putten 42ed532f00 Update Android SDK 43 shell app with proguard fix (#352) 2021-10-29 01:07:11 +02:00
Wojciech Kozyra 68f9d4c7d1 move iOS builders to mac mini cluster (#350) 2021-10-27 15:02:15 +02:00
Brent Vatne c5e0206d29 Update CHANGELOG 2021-10-20 11:24:41 -07:00
Brent Vatne a8ddba34ac Release 0.23.1 2021-10-20 11:23:06 -07:00
Kudo Chien 65f2f9fc67 Update iOS SDK 43 tarball 2021-10-20 20:01:57 +08:00
Brent Vatne 5138ab57e8 Update iOS and Android SDK 43 tarballs 2021-10-19 13:53:24 -07:00
Wojciech Kozyra 5f066d14ee update node (#347) 2021-10-15 14:30:22 +02:00
dependabot[bot] b307604177 Bump tmpl from 1.0.4 to 1.0.5 (#331)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-15 13:11:01 +02:00
dependabot[bot] 6bdcd744df Bump url-parse from 1.5.1 to 1.5.3 (#339)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.1...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-15 10:38:03 +02:00
Wojciech Kozyra 9447341b84 increase memory limits (#344) 2021-10-08 14:50:30 +02:00
Brent Vatne 817653f01d Release 0.23.0 2021-10-07 11:58:46 -07:00
Brent Vatne eb0f2f5918 Update iOS SDK 43 tarball 2021-10-07 08:49:49 -07:00
Wojciech Kozyra ba4b53b41a Update Android SDK43 shell tarball (#343) 2021-10-07 16:50:48 +02:00
Wojciech Kozyra ba7b4a1968 remove workspaces from shellapp (#342) 2021-10-07 13:35:01 +02:00
Tomasz Sapeta 3cb449f7ff Update Android SDK43 tarball to fix missing expo and react-native-codegen packages 2021-10-06 17:09:28 +02:00
Brent Vatne b6ba977746 Udpate yarn.lock 2021-10-05 18:46:50 -07:00
Brent Vatne 1155e26727 Update xdl to fix Android shell app for SDK 43 2021-10-05 18:44:49 -07:00
Brent Vatne 75ead4d6a1 Add iOS beta tarball for SDK 43 2021-10-05 18:27:00 -07:00
Brent Vatne 7d5b092adc Add Android beta tarball for SDK 43 2021-10-05 17:34:36 -07:00
Wojciech Kozyra b644f15e43 Release 0.22.6 2021-10-01 15:56:13 +02:00
Wojciech Kozyra 18631f6482 Update CHANGELOG 2021-10-01 15:54:36 +02:00
Wojciech Kozyra 85e2408f0c disable ios tests 2021-10-01 15:52:23 +02:00
andy e9897054f3 update xdl to v59.1.5 (#337) 2021-10-01 15:50:00 +02:00
Wojciech Kozyra 6ae5eb1ab2 force rebuild (switch from catalina to big sur) (#334) 2021-09-30 14:21:49 +02:00
Cedric van Putten a32799a584 Update tarball to fix local assets on SDK 42 (#332)
* Update tarball to fix local assets on SDK 42

* Update changelog
2021-09-21 22:15:51 +02:00
Cedric van Putten 6f86b4ac57 Update CHANGELOG.md 2021-09-09 23:35:07 +02:00
Cedric van Putten 9f07dbedb5 Release 0.22.5 2021-09-09 23:21:59 +02:00
Cedric van Putten 3e579ceeba Update changelog with Android tarball bumps 2021-09-09 23:05:59 +02:00
Cedric van Putten a2913c28bf Update tarballs for Android location workaround (#330)
* Update tarball for Android SDK 39

* Update tarball for Android SDK 41

* Update tarball for Android SDK 42

* Update tarball for Android SDK 40
2021-09-09 21:46:44 +02:00
dependabot[bot] a0f9810320 Bump tar from 4.4.15 to 4.4.18 (#329)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.15 to 4.4.18.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.15...v4.4.18)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-09 16:16:05 +02:00
Will Schurman 74a3739b6e [logger] Fix s3 logger stream close crash (#326) 2021-08-31 10:16:33 -07:00
dependabot[bot] 2c36c89ed4 Bump tar from 4.4.8 to 4.4.15 (#321)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.8 to 4.4.15.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.8...v4.4.15)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 16:48:11 +02:00
dependabot[bot] 099afed72c Bump path-parse from 1.0.6 to 1.0.7 (#323)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 14:28:59 +02:00
Wojciech Kozyra 36d1d75544 update to node-forge 0.10.0 (#328) 2021-08-31 12:03:04 +02:00
Juwan Wheatley 70eca74b9c update expo.io links to expo.dev/exp.host (#325) 2021-08-24 14:14:53 -04:00
Brent Vatne 01137526c4 Update CHANGELOG 2021-07-27 17:59:56 -07:00
Brent Vatne 4972744a87 Release 0.22.4 2021-07-27 17:58:47 -07:00
Brent Vatne cbd11f2f4e Update tarballs for SDK 42 2021-07-27 15:20:16 -07:00
Brent Vatne fdd76085c1 Release 0.22.3 2021-07-02 10:44:08 -07:00
Brent Vatne daedefbca8 Update tarball for SDK 42 2021-07-02 10:43:43 -07:00
Brent Vatne e7da1a0193 Update changelog 2021-06-29 19:42:37 -07:00
Brent Vatne 85cc6d1b9f Release 0.22.2 2021-06-29 19:41:48 -07:00
Brent Vatne 07679dfbdc [ios] Update tarball again for SDK 42 2021-06-29 19:41:15 -07:00
Brent Vatne 070485dd09 Update changelog 2021-06-29 14:06:50 -07:00
Brent Vatne bf3e1feac9 Release 0.22.1 2021-06-29 14:05:58 -07:00
Brent Vatne fcba536698 [ios][android] Update tarballs for SDK 42 2021-06-29 14:03:10 -07:00
dependabot[bot] e77f05ea1d Bump set-getter from 0.1.0 to 0.1.1 (#320)
Bumps [set-getter](https://github.com/doowb/set-getter) from 0.1.0 to 0.1.1.
- [Release notes](https://github.com/doowb/set-getter/releases)
- [Commits](https://github.com/doowb/set-getter/commits/0.1.1)

---
updated-dependencies:
- dependency-name: set-getter
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-25 15:10:02 +02:00
Brent Vatne 819be0056c Update changelog 2021-06-22 19:34:11 -07:00
Brent Vatne 0a3faaf975 Release 0.22.0 2021-06-22 19:33:09 -07:00
Brent Vatne c38b1b4089 Update SDK 42 beta tarballs 2021-06-22 17:50:13 -07:00
Brent Vatne 5c5de300a6 Add iOS and Android beta tarballs for SDK 42 2021-06-21 18:37:40 -07:00
Wojciech Kozyra 6efa267a1f Update CHANGELOG 2021-06-15 14:14:41 +02:00
Wojciech Kozyra 81b7d8d911 Release 0.21.9 2021-06-15 14:13:17 +02:00
Wojciech Kozyra 95a48861e0 update sharp and skip NDK install on M1 (#319) 2021-06-15 14:12:02 +02:00
dependabot[bot] 2bb14a67b6 Bump url-parse from 1.4.4 to 1.5.1 (#310)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.4 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.4...1.5.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 17:15:37 +02:00
dependabot[bot] 5a1f48335f Bump lodash from 4.17.19 to 4.17.21 (#311)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 17:15:28 +02:00
dependabot[bot] 2dd89d2c08 Bump hosted-git-info from 2.7.1 to 2.8.9 (#312)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.9)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 17:15:18 +02:00
dependabot[bot] 5f9d98b1dc Bump dns-packet from 1.3.1 to 1.3.4 (#318)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 17:14:53 +02:00
cruzach 02833e211d update changelog 2021-05-25 10:36:38 -04:00
cruzach ba4f2cc05a Release 0.21.8 2021-05-25 10:35:28 -04:00
cruzach 7f9b7a17d4 update android tarball for SDK 41 2021-05-24 16:49:34 -04:00
cruzach 821e648d67 update changelog 2021-05-21 10:32:45 -04:00
cruzach 54a6e1910c Release 0.21.7 2021-05-21 10:31:15 -04:00
cruzach 688f970a1a Update android and ios tarballs for SDK 41 2021-05-20 17:04:38 -04:00
Brent Vatne 9c666d90b4 Update CHANGELOG 2021-04-22 14:24:09 -07:00
Brent Vatne 4f351a047f Release 0.21.6 2021-04-22 14:21:25 -07:00
Brent Vatne 7caa13bdda Update Android SDK41 tarball. 2021-04-22 14:19:41 -07:00
Tomasz Sapeta 1f266f7b72 Update iOS SDK41 shell tarball 2021-04-22 15:25:11 +02:00
Wojciech Kozyra edfa2dbb94 increase android worker memory and cpu limits - (12GB, 3CPU) 2021-04-20 11:24:19 +02:00
Wojciech Kozyra 1d5075d898 increase android worker memory and cpu limits (#307) 2021-04-20 10:56:01 +02:00
dependabot[bot] 64147f0cf7 Bump ssri from 6.0.1 to 6.0.2 (#308)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 10:10:58 +02:00
Brent Vatne 688a961513 Update CHANGELOG 2021-04-15 17:44:15 -07:00
Brent Vatne 19ed88150a Release 0.21.5 2021-04-15 15:27:48 -07:00
Brent Vatne e988fb282e Update iOS client and Android SDK 41 tarballs 2021-04-15 15:26:57 -07:00
Brent Vatne 16103cebf9 Release 0.21.4 2021-04-13 18:47:35 -07:00
Brent Vatne be14dca375 Update iOS client tarball 2021-04-13 18:47:10 -07:00
Brent Vatne bf24c86399 Update CHANGELOG 2021-04-13 15:53:51 -07:00
Brent Vatne 7fb1e57a40 Release 0.21.3 2021-04-13 15:52:59 -07:00
Brent Vatne d6fcc6d881 Update SDK 41 taralls for iOS and Android 2021-04-13 15:51:38 -07:00
cruzach 525ddf6f04 update changelog 2021-04-07 18:20:29 -04:00
cruzach f0416d131d Release 0.21.2 2021-04-07 18:18:31 -04:00
cruzach 2fdeea268c Update Android SDK 41 beta tarball 2021-04-07 17:37:52 -04:00
Brent Vatne a11ed9198c Update CHANGELOG 2021-04-01 15:46:52 -07:00
Brent Vatne 2da016e4ce Release 0.21.1 2021-04-01 15:45:11 -07:00
Brent Vatne 8278520474 Update SDK 41 beta tarball 2021-04-01 14:54:34 -07:00
dependabot[bot] 6ab9d99d7c Bump y18n from 4.0.0 to 4.0.1 (#304)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 15:54:20 +02:00
dependabot[bot] c8ad765d5d Bump react-dev-utils from 11.0.1 to 11.0.4 (#299)
Bumps [react-dev-utils](https://github.com/facebook/create-react-app/tree/HEAD/packages/react-dev-utils) from 11.0.1 to 11.0.4.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG-1.x.md)
- [Commits](https://github.com/facebook/create-react-app/commits/HEAD/packages/react-dev-utils)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 15:52:51 +02:00
Brent Vatne 1834f323ce Update CHANGELOG 2021-03-29 18:05:39 -07:00
Brent Vatne 8e261a8827 Release 0.21.0 2021-03-29 18:04:47 -07:00
Brent Vatne d0033c2df1 Bump xdl 2021-03-29 16:29:56 -07:00
Brent Vatne 63b7879608 Add beta tarballs for SDK 41 2021-03-29 15:32:08 -07:00
Brent Vatne cf57eceb6e Add entry for 0.20.7 to CHANGELOG 2021-03-29 15:31:45 -07:00
dependabot[bot] 5058cbe8e5 Bump elliptic from 6.5.3 to 6.5.4 (#297)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 13:00:01 +02:00
dependabot[bot] 4804a3453c Bump ini from 1.3.5 to 1.3.8 (#293)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 12:59:08 +02:00
Wojciech Kozyra 1d773f35cf Release 0.20.7 2021-01-26 14:49:57 +01:00
Wojciech Kozyra 3daa678540 [android] remove Go suffix from android app name (#292) 2021-01-26 14:20:33 +01:00
Brent Vatne 616331b47b update changelog 2021-01-25 11:39:45 -08:00
Brent Vatne 0b9ab78453 Release 0.20.6 2021-01-25 11:36:30 -08:00
Brent Vatne 3e345ddaf8 [ios][android] Update tarballs for SDK 40 patch release 2021-01-21 20:40:43 -08:00
Cedric van Putten 4866c06a02 update changelog 2020-12-23 18:28:28 +01:00
Cedric van Putten c36723d96c Release 0.20.5 2020-12-23 18:25:36 +01:00
Cedric van Putten 28b0266ba2 [android] Upgrade to client 2.18.5 with background permission fix (#287) 2020-12-23 15:07:09 +01:00
Stanisław Chmiela 84a19ee261 Release 0.20.4 2020-12-17 15:57:42 +01:00
Stanisław Chmiela 8f3be65326 [ios] Fix expo-notifications initial notification not being delivered… (#285)
to expo-notifications

<!-- Thanks for contributing to _turtle_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->

### Checklist
- [x] I've read the [Contribution Guidelines](https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [x] I've updated the [CHANGELOG](https://github.com/expo/turtle/blob/master/CHANGELOG.md) if necessary.
- [x] I've ensured the unit and smoke tests are still passing - either by running `yarn test:unit` and `yarn test:smoke:[ios|android]` or by checking the appropriate CircleCI builds' statuses.
- [x] **I've manually tested whether the changes I made work as expected.**

### Motivation and Context
Adds https://github.com/expo/expo/commit/0e0bbdd7b45b3e8f8725bcd831263f049c0aa16a and https://github.com/expo/expo/commit/c49a0464aef589dc9dd691cea78313d91959d64c fixing long-standing notifications bug.
2020-12-17 15:56:39 +01:00
Wojciech Kozyra 5d539a1bb2 update CHANGELOG 2020-12-10 12:11:09 +01:00
Wojciech Kozyra 833c9c1de5 Release 0.20.3 2020-12-10 12:09:10 +01:00
Eric Gonzalez ce74ab3161 Fixed the iOS build when user does not have elevated permissions (#283)
* Removed unnecessary sudo usage for ios buildsudo does not appear to be necessary to execute 'xcrun simctl list'

* Conditionally sudo-ing xcrun when building online
2020-12-10 10:47:25 +01:00
Brent Vatne 62df247645 [scripts] Verify jq installation before proceeding (#281) 2020-12-09 20:57:57 -08:00
Stanisław Chmiela 9bc4d75e9b Cut 0.20.2 version in changelog 2020-12-09 16:45:33 +01:00
Stanisław Chmiela b4d4b8a6c3 Release 0.20.2 2020-12-09 16:39:20 +01:00
Stanisław Chmiela 88d75c7581 Add changelog entry 2020-12-09 16:38:07 +01:00
Stanisław Chmiela 03be505cd0 [android] Upgrade SDK40 tarball with expo-notifications installation identifier fix 2020-12-09 15:58:41 +01:00
Eric Samelson 05568676ee update CHANGELOG 2020-12-08 18:54:00 -08:00
Eric Samelson 903e44bd29 Release 0.20.1 2020-12-08 18:51:55 -08:00
Brent Vatne 7697542b44 Update iOS client tarball 2020-12-08 18:44:45 -08:00
Eric Samelson 3baf4bcade [android] update SDK 40 shell tarball for release 2020-12-08 17:34:44 -08:00
Brent Vatne c7e98c5858 [ios] Update SDK 40 tarball for release 2020-12-08 13:12:26 -08:00
Dominik Sokal fc48d27e42 fix android smoke tests 2020-12-01 14:12:33 +01:00
Brent Vatne fdc702f273 Update CHANGELOG 2020-11-30 13:37:03 -08:00
Brent Vatne 9fda74dfa4 Release 0.20.0 2020-11-30 13:26:37 -08:00
Brent Vatne 6bab5f71ef [README] Update link to installation docs 2020-11-30 11:02:28 -08:00
Brent Vatne 3f1e9ce910 [android] Update sdk40 tarball 2020-11-30 11:01:37 -08:00
Brent Vatne 8fb54f3f27 Add iOS and Android SDK 40 tarballs 2020-11-27 11:53:29 -08:00
Bartłomiej Bukowski 069ef7e1c9 Update CHANGELOG.md 2020-11-19 21:23:53 +01:00
Bartłomiej Bukowski c0a742fa21 Release 0.19.1 2020-11-19 21:13:23 +01:00
Bartłomiej Bukowski fca72875dc [iOS] Rebuild shell tarballs (#278)
### Motivation and Context

- Accommodate https://github.com/expo/expo/pull/11052 in all shellApps.
- Rebuild iOS shellApps using Xcode 12.1 containing the iOS 14 image fix.
2020-11-19 21:02:25 +01:00
Bartłomiej Bukowski 15ed26d4cd [iOS] Run 'xcrun simctl list' before build to prevent ibtool crash (#279)
* [iOS] Run 'xcrun simctl list' before build to prevent ibtool crash

* Update CHANGELOG
2020-11-18 11:15:42 +01:00
Wojciech Kozyra 4c7af801f1 Revert "[ios][shellApps] Rebuild all supported shellApps with Xcode 12.1 (#273)"
This reverts commit c6946eca25.
2020-11-16 18:16:31 +01:00
Wojciech Kozyra 5012ec669d update CHANGELOG.md 2020-11-13 13:12:27 +01:00
Wojciech Kozyra 8b77a48b82 Release 0.19.0 2020-11-13 13:10:36 +01:00
Bartłomiej BukowskiandWojciech Kozyra c6946eca25 [ios][shellApps] Rebuild all supported shellApps with Xcode 12.1 (#273)
Co-authored-by: Wojciech Kozyra <[email protected]>
2020-11-11 12:08:25 +01:00
Eric Samelson 9627ecb80c Update CHANGELOG for 0.18.9 2020-11-09 16:24:03 -08:00
Eric Samelson 48c78f386a Release 0.18.9 2020-11-09 16:22:05 -08:00
Eric Samelson 0dc251e023 bump xdl to 58.0.20 2020-11-09 16:11:26 -08:00
Stanisław Chmiela d984061134 Update changelog for 0.18.8 2020-10-27 13:00:10 +01:00
Stanisław Chmiela ff6401ba6b Release 0.18.8 2020-10-27 12:59:02 +01:00
Stanisław Chmiela b443760699 Fix Reanimated v2 not being configured in production mode (#270)
<!-- Thanks for contributing to _turtle_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->

### Checklist
- [x] I've read the [Contribution Guidelines](https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [x] I've updated the [CHANGELOG](https://github.com/expo/turtle/blob/master/CHANGELOG.md) if necessary.
- [x] I've ensured the unit and smoke tests are still passing - either by running `yarn test:unit` and `yarn test:smoke:[ios|android]` or by checking the appropriate CircleCI builds' statuses.
- [x] **I've manually tested whether the changes I made work as expected.**

### Motivation and Context

Apply https://github.com/expo/expo/pull/10807.

### Description
Fixes app crashing when using Reanimated v2.
2020-10-27 12:57:06 +01:00
Eric Samelson 0f0e86d17f Release 0.18.7 2020-10-23 15:28:41 -07:00
Eric Samelson f6697c0029 update CHANGELOG 2020-10-23 15:28:14 -07:00
Eric Samelson 22f802164d update android sdk 39 tarball 2020-10-23 14:53:13 -07:00
Charlie Cruzan aaa6e61061 Update CHANGELOG.md 2020-10-22 17:17:43 -04:00
cruzach e532e0270c Release 0.18.6 2020-10-22 17:13:42 -04:00
Charlie Cruzan bc0718ca7d [android] update sdk 39 tarball with notifications fixes
the following fixes are added in this update:

- https://github.com/expo/expo/commit/6ffe64f4a75f75edfdae226574842e97fd63d523

- https://github.com/expo/expo/commit/fa659fd3f74c32e989db5920a3e004bee58a931c

- https://github.com/expo/expo/commit/0faa400c630a5f88a029fe87c84cfa9e684e800a
2020-10-22 13:54:30 -04:00
Brent Vatne bf63dcea70 Update CHANGELOG 2020-10-07 12:34:43 -07:00
Brent Vatne 9551c8773d Release 0.18.5 2020-10-07 12:33:14 -07:00
Brent Vatne 470ff609fd [android] Always add expo-notifications for SDK >= 39 projects with android.enableDangerousExperimentalLeanBuilds enabled (#267) 2020-10-07 10:29:50 -07:00
Eric Samelson addba74b9d Release 0.18.4 2020-10-06 18:38:53 -07:00
Eric Samelson b63e9e3f34 update CHANGELOG 2020-10-06 18:37:48 -07:00
Eric Samelson 25aaa849f1 [android] update sdk 39 tarball for android notifications/updates fix 2020-10-06 18:36:22 -07:00
Brent Vatne edc712d820 update CHANGELOG 2020-10-03 22:51:11 -07:00
Brent Vatne 23c3e3509c Release 0.18.3 2020-10-03 22:48:52 -07:00
Brent Vatne 406a3be4f1 Update @expo/xdl to fix regression in SDK <= 39 splash 2020-10-03 22:15:55 -07:00
Eric Samelson dd60721270 update CHANGELOG 2020-10-03 15:19:38 -07:00
Eric Samelson 469ead8df8 Release 0.18.2 2020-10-03 15:18:25 -07:00
Brent Vatne aa0ce81e98 [ios] Update client tarball 2020-10-03 15:15:47 -07:00
Eric Samelson dccccb7716 [android] update SDK 39 tarball with linking fix 2020-10-03 15:10:09 -07:00
Brent Vatne 57f8404b6d [ios] update sdk39 tarball 2020-10-02 22:09:09 -07:00
Brent Vatne ba7309bc4b Update @expo/config and @expo/xdl. Temporarily bring in type definitions for color-string and xcode. 2020-10-02 20:58:39 -07:00
Brent Vatne 4aec3d5ba7 Update CHANGELOG 2020-10-02 18:40:08 -07:00
Brent Vatne d2eb447ebc [android] update sdk39 tarball 2020-10-02 18:16:21 -07:00
Dominik Sokal f177cf4d7f update ios smoke tests recordings (#264) 2020-09-29 15:31:52 +02:00
Dominik Sokal 59a181dee0 update CHANGELOG 2020-09-23 12:16:02 +02:00
Dominik Sokal f4bf860a9a Release 0.18.1 2020-09-23 12:12:59 +02:00
Dominik Sokal 932958ad46 fix building expo sdk 39 with turtle-cli 2020-09-23 12:09:45 +02:00
Eric Samelson 2a54b4578a update CHANGELOG 2020-09-21 15:08:37 -07:00
Eric Samelson 7e234d09a3 Release 0.18.0 2020-09-21 15:07:47 -07:00
Eric Samelson 5b22c351bf update CHANGELOG 2020-09-21 13:20:39 -07:00
Stanisław Chmiela e2020f1ab4 Add SDK39 iOS tarballs (#257) 2020-09-21 13:19:47 -07:00
Eric Samelson c935e53e50 [android][ios] remove SDK 35 tarballs 2020-09-18 15:14:20 -07:00
Eric Samelson 14e681f35f [android] add SDK 39 tarball (#260) 2020-09-18 15:13:32 -07:00
Wojciech Kozyra d3a7ccb582 force image rebuild 2020-09-18 12:34:14 +02:00
Wojciech Kozyra 62478de14a update CHANGELOG.md 2020-09-14 14:22:07 +02:00
Wojciech Kozyra 6594089779 Release 0.17.3 2020-09-14 14:19:59 +02:00
dependabot[bot] 11c5d3ee02 Bump http-proxy from 1.17.0 to 1.18.1 (#256)
Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.17.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/http-party/node-http-proxy/compare/1.17.0...1.18.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-11 12:21:47 +02:00
dependabot[bot] 99b7ac6660 Bump node-fetch from 2.3.0 to 2.6.1 (#259)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.3.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.3.0...v2.6.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-11 12:21:26 +02:00
Stanisław Chmiela 46fe34ed9c Hardcode maximum heap size (#255)
<!-- Thanks for contributing to _turtle_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->

### Checklist
- [x] I've read the [Contribution Guidelines](https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [ ] I've updated the [CHANGELOG](https://github.com/expo/turtle/blob/master/CHANGELOG.md) if necessary.
- [x] I've ensured the unit and smoke tests are still passing - either by running `yarn test:unit` and `yarn test:smoke:[ios|android]` or by checking the appropriate CircleCI builds' statuses.
- [x] **I've manually tested whether the changes I made work as expected.**

### Motivation and Context

Builds started to fail with

```
Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size
Error: ./gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (events.js:418:26)
    at ChildProcess.emit (events.js:311:20)
    at ChildProcess.EventEmitter.emit (domain.js:482:12)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    ...
    at spawnAsync (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at spawnAsyncThrowError (/app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:201:45)
    at buildShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:940:11)
    at async Object.createAndroidShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:386:5)
    at async runShellAppBuilder (/app/turtle/build/builders/android.js:95:9)
    at async Object.buildAndroid [as android] (/app/turtle/build/builders/android.js:43:28)
    at async build (/app/turtle/build/jobManager.js:181:33)
    at async processJob (/app/turtle/build/jobManager.js:118:32)
    at async Object.doJob (/app/turtle/build/jobManager.js:49:5)
    at async main (/app/turtle/build/server.js:66:13)
```

### Description

Consulted and helped with by @wkozyra95 — removed experimental options that made maximum heap size being set to a low value. Hardcoded proper value.
2020-09-07 14:05:02 +02:00
Stanisław Chmiela 423fc8bbf5 Upgrade XDL so it processes root build.gradle too (#254)
<!-- Thanks for contributing to _turtle_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->

### Checklist
- [x] I've read the [Contribution Guidelines](https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [x] I've updated the [CHANGELOG](https://github.com/expo/turtle/blob/master/CHANGELOG.md) if necessary.
- [x] I've ensured the unit and smoke tests are still passing - either by running `yarn test:unit` and `yarn test:smoke:[ios|android]` or by checking the appropriate CircleCI builds' statuses.
- [x] **I've manually tested whether the changes I made work as expected.**

### Motivation and Context

Lands https://github.com/expo/expo-cli/pull/2547 in Turtle. This is a prerequisite for https://github.com/expo/expo/pull/10059 to be able to land (otherwise Turtle would end up with the offending block in root `build.gradle` which would fail the builds since there is no `:ReactAndroid` project in Turtle workspace).

### Description

Upgrades XDL.
2020-09-04 13:02:32 +02:00
Wojciech Kozyra 4c8408a46b [docker-base] add gradle 6.2 and set ANDROID_NDK_HOME (#251)
* [docker-base] add gradle 6.2 and set ANDROID_NDK_HOME

* update CHANGELOG
2020-09-04 11:19:08 +02:00
dependabot[bot] 032d7c8b1f Bump decompress from 4.2.0 to 4.2.1 (#252)
Bumps [decompress](https://github.com/kevva/decompress) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/kevva/decompress/releases)
- [Commits](https://github.com/kevva/decompress/compare/v4.2.0...v4.2.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-04 09:36:01 +02:00
Dominik Sokal b2a0b3ce14 use http endpoints for status updates (#249)
* use http endpoints for status updates

* resend updates if www failed to process them

* make leader responsible for synchronizing build updates

* fix tests
2020-08-24 10:13:43 +02:00
Dominik Sokal 1ee922763e send logs url with finished and errored messages (#248) 2020-08-17 13:43:40 +02:00
Wojciech Kozyra c31cd379c1 update CHANGELOG.md 2020-08-06 18:00:17 +02:00
Wojciech Kozyra 67754eba2a Release 0.17.2 2020-08-06 17:57:15 +02:00
Wojciech Kozyra 351fed00df Updated iOS shell app for SDK 38 with fixed integer tagging in expo-gl for iOS 14. (#245) 2020-08-06 17:51:49 +02:00
Stanisław Chmiela 487032b11d Update version manually as release-it broke 2020-08-05 18:07:03 +02:00
Stanisław Chmiela 042dd2ccab Add CHANGELOG entry 2020-08-05 16:12:55 +02:00
Stanisław Chmiela 99ae0d1cea Update Android shell tarball for SDK38 with targetSdkVersion bumped to 29 (#244)
<!-- Thanks for contributing to _turtle_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->

### Checklist
- [x] I've read the [Contribution Guidelines](https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [x] I've updated the [CHANGELOG](https://github.com/expo/turtle/blob/master/CHANGELOG.md) if necessary.
- [x] I've ensured the unit and smoke tests are still passing - either by running `yarn test:unit` and `yarn test:smoke:[ios|android]` or by checking the appropriate CircleCI builds' statuses.
- [x] **I've manually tested whether the changes I made work as expected.**

### Motivation and Context

See https://github.com/expo/expo/pull/9446 and https://forums.expo.io/t/google-api-level-29/41231.

### Description

Updated Android SDK38 tarball with project with updated `targetSdkVersion`.
2020-08-05 16:06:46 +02:00
dependabot[bot] ad2c87163b Bump elliptic from 6.4.1 to 6.5.3 (#243)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.1 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.4.1...v6.5.3)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-31 12:12:03 +02:00
dependabot[bot] b4b9cf362e Bump lodash from 4.17.11 to 4.17.19 (#242)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.19)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-17 09:08:55 +02:00
Dominik Sokal 7ea4dac986 upgrade jest and ts-jest to fix smoke tests (#241) 2020-07-16 14:44:59 +02:00
Dominik Sokal cd8da71711 update CHANGELOG 2020-07-16 08:54:06 +02:00
Dominik Sokal 2a2a0f39e0 Release 0.17.0 2020-07-16 08:51:04 +02:00
Dominik Sokal fbabcdf521 build:android - allow for passing custom gradle args (#239)
* build:android - allow for passing custom gradle args

* update CHANGELOG

* upgrade @expo/xdl to 57.9.25-alpha.1
2020-07-15 11:50:21 +02:00
Dominik Sokal 0803811226 update @expo/xdl to 57.9.25-alpha.0 to get rid of dots when downloading gradle 2020-07-15 10:21:45 +02:00
dependabot[bot] 0976a642e1 Bump npm-registry-fetch from 8.0.0 to 8.1.1 (#238)
Bumps [npm-registry-fetch](https://github.com/npm/registry-fetch) from 8.0.0 to 8.1.1.
- [Release notes](https://github.com/npm/registry-fetch/releases)
- [Changelog](https://github.com/npm/npm-registry-fetch/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/registry-fetch/compare/v8.0.0...v8.1.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-08 10:00:37 +02:00
Dominik Sokal 16bd4fe7b6 run yarn before release 2020-07-01 09:38:08 +02:00
Dominik Sokal 3ccd705943 Release 0.16.2 2020-07-01 09:35:06 +02:00
Dominik Sokal 11cc4421dd Release 0.16.1 2020-07-01 09:32:42 +02:00
Wojciech Kozyra 32f5a0bb37 use @expo/config to read project config (#237)
* use @expo/config to read info about project

* update CHANGELOG.md
2020-07-01 09:20:36 +02:00
jameswilddev 61a1906e01 Allow override of protocol validation in--public-url (#235)
* Allow override of protocol validation (https://github.com/expo/turtle/issues/210).

* Fix lint.
2020-06-29 10:01:15 +02:00
Eric Samelson 19a17231b3 update CHANGELOG 2020-06-25 09:31:08 -07:00
Eric Samelson 98c03bc8a2 Release 0.16.0 2020-06-25 09:29:20 -07:00
Eric Samelson 83ab2539c1 [ios][android] remove SDK 34 shell apps 2020-06-23 14:07:24 -07:00
Eric Samelson 064619e1ae [android] add SDK 38 shell tarball (#233) 2020-06-23 14:06:37 -07:00
Tomasz Sapeta b7fe01b758 [ios] Add shell tarballs for SDK38 (#231) 2020-06-23 14:08:43 +02:00
Dominik Sokal 6583b1a1db upgrade ioredis to 4.17.3 2020-06-22 15:00:42 +02:00
Dominik Sokal f24081cb91 Release 0.15.1 2020-06-22 13:45:27 +02:00
Dominik Sokal 4e719a200b update CHANGLEOG 2020-06-22 13:44:51 +02:00
Dominik Sokal 0b13494402 configure turtle to use the redis ca certificate (#232)
* add .vscode to gitignore

* configure turtle to use the redis ca certificate
2020-06-22 13:42:07 +02:00
Dominik Sokal 0ca26a40aa fix announcing supported sdk versions 2020-06-22 12:26:06 +02:00
Dominik Sokal f171913bac [circleci] bump yarn cache key 2020-06-18 15:32:41 +02:00
Dominik Sokal b47ee91117 update CHANGELOG.md 2020-06-02 14:06:05 +02:00
Dominik Sokal 77cb28ce66 Release 0.15.0 2020-06-02 14:04:22 +02:00
Dominik Sokal 7a2453cf53 upgrade @expo/xdl to 57.9.13 (to remove *.bak files from .ipa) 2020-06-02 14:01:11 +02:00
Charlie Cruzan 924908905f Update CHANGELOG.md 2020-05-14 10:17:23 -04:00
cruzach 798b4acca6 Release 0.14.12 2020-05-14 10:15:22 -04:00
cruzach 2303b44dd2 [ios] Update iOS custom client shell app 2020-05-13 09:27:17 -04:00
cruzach c204e0bef2 update CHANGELOG 2020-05-04 15:34:30 -04:00
cruzach 0918d8299e Release 0.14.11 2020-05-04 15:28:22 -04:00
cruzach 3543acfb26 [ios] Update sdk-37 shell app for 2.15.5 release 2020-05-04 14:49:41 -04:00
Wojciech Kozyra 42b6ff634c Release 0.14.10 2020-05-01 17:54:45 +02:00
Wojciech Kozyra fcd42b272f Update CHANGELOG 2020-05-01 17:54:09 +02:00
Wojciech Kozyra ecaef3a91d enable lean builds (#217) 2020-05-01 17:51:19 +02:00
Stanisław Chmiela 413e6a564d Cut 0.14.9 in CHANGELOG 2020-04-21 11:13:40 +02:00
Stanisław Chmiela ac27332151 Release 0.14.9 2020-04-21 11:12:24 +02:00
Stanisław Chmiela 72744f58ec [android] Build only the app artifact and not all available libraries (#214)
### Motivation and Context

I have noticed that not only the `app` project is being built on Turtle, but all the projects. (cross-posting from https://github.com/expo/expo-cli/pull/1937)

### Description

I've scoped the Gradle command to only build/assemble the `:app` project. It should be safe to do for all SDKs, since on all SDKs the app project was called `app`.

Published an alpha version of XDL to NPM, upgraded Turtle to it, deployed to staging and ran the build. It was over a minute faster than without this change ([new](https://staging.expo.io/dashboard/sjchmiela/builds/5c386cef-e808-49d3-91d8-9ce42af77c36) vs [old](https://staging.expo.io/dashboard/sjchmiela/builds/3d36340e-6ae1-4476-91cb-07d81f1edd1e)). (cross-posting from https://github.com/expo/expo-cli/pull/1937)
2020-04-21 11:11:52 +02:00
Stanisław Chmiela 96af4f753d Cut 0.14.8 in CHANGELOG 2020-04-20 16:48:54 +02:00
Stanisław Chmiela 4059c6f354 Release 0.14.8 2020-04-20 16:47:22 +02:00
Stanisław Chmiela b48f89054b Update XDL to remove check-dynamic-macros call (#212)
### Motivation and Context

See https://github.com/expo/expo-cli/pull/1933 and https://github.com/expo/expo/pull/7919.

### Description

Updates XDL so it includes change introduced in https://github.com/expo/expo-cli/pull/1933.
2020-04-20 16:46:35 +02:00
Stanisław Chmiela 7361f4af52 [changelog] Update changelog with 0.14.7 2020-04-20 12:40:16 +02:00
Stanisław Chmiela 41b48f0c66 Release 0.14.7 2020-04-20 12:39:17 +02:00
Stanisław Chmiela 56b3011d25 Remove secrets from SDK37 shell app, fix google-services.json handling (#209)
<!-- Thanks for contributing to _turtle_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->

### Checklist
- [x] I've read the [Contribution Guidelines] (https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [x] I've updated the [CHANGELOG](https://github.com/expo/turtle/blob/master/CHANGELOG.md) if necessary.
- [x] I've ensured the unit and smoke tests are still passing - either by running `yarn test:unit` and `yarn test:smoke:[ios|android]` or by checking the appropriate CircleCI builds' statuses.
- [x] **I've manually tested whether the changes I made work as expected.**

### Motivation and Context

- `google-services.json` was being handled unintuitively, fixed with https://github.com/expo/expo-cli/pull/1897
- Expo Client's secrets were leaking in shell apps, fixed with https://github.com/expo/expo/pull/7768
- When deployed, fixes https://github.com/expo/expo/issues/7727.

### Description

XDL was modifying `google-services.json`, removing valid keys if the user doesn't provide the same, removed key in _some other place_ (see https://github.com/expo/expo/issues/7727#issuecomment-611544439). Fixed the change in XDL, upgraded to the fixed version here. Also removed secrets from the shell app.
2020-04-20 12:38:27 +02:00
Stanisław Chmiela ef6f9e3c5d Install only production dependencies in shell apps (#211)
<!-- Thanks for contributing to _turtle_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->

### Checklist
- [x] I've read the [Contribution Guidelines](https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [x] I've updated the [CHANGELOG](https://github.com/expo/turtle/blob/master/CHANGELOG.md) if necessary.
- [x] I've ensured the unit and smoke tests are still passing - either by running `yarn test:unit` and `yarn test:smoke:[ios|android]` or by checking the appropriate CircleCI builds' statuses.
- [x] **I've manually tested whether the changes I made work as expected.**

### Motivation and Context

The build process doesn't use any of the `devDependencies` of shell apps and installing them makes the process slower and using more memory.

### Description

Added the `--production` flag to dependencies installer happening inside shell apps so it installs only the real dependencies of the project. This omits dependencies like:
- `babel-core`, `prettier`, `eslint` — we won't transpile, analyze, prettify JS when building the project,
- `expo-cli` — we could use `expo-cli` when building the project, but we don't (`expotools` are used and they are installed in the shell app)
- `expo-yarn-workspaces` — the `--ignore-scripts` removes the need for `expo-yarn-workspaces`

### Test plan

I have tested these changes as part of https://github.com/expo/turtle/pull/209. I have built two apps on SDK37 and both were built successfully.
2020-04-20 10:33:49 +02:00
Stanisław Chmiela 0302a5f71b Revert "Install only production dependencies in shell apps when setting up CLI too"
This reverts commit abb604b3b5.
2020-04-20 10:26:16 +02:00
Stanisław Chmiela abb604b3b5 Install only production dependencies in shell apps when setting up CLI too 2020-04-20 09:41:27 +02:00
Wojciech Kozyra f87dcc6972 add --ignore-scripts to yarn install in shellapp 2020-04-09 16:37:56 +02:00
Dominik Sokal fb27531805 Release 0.14.6 2020-04-09 15:14:53 +02:00
Dominik Sokal b307e0ed7f update CHANGELOG 2020-04-09 15:13:56 +02:00
Wojciech Kozyra 9bfa7c5674 improve deployment speed for android workers (#205)
improve deployment speed for android workers
2020-04-09 13:43:45 +02:00
Dominik Sokal 0fcade4a1f include turtle mode in in-progress message (#206)
* send turtle mode in in-progress message

* update smoke test recordings
2020-04-09 10:20:56 +02:00
Dominik Sokal df4b38711a upgrade @expo/xdl to 57.8.17 to fix downloading assets smaller than 10 bytes (fixes expo/expo#7701) 2020-04-08 15:48:19 +02:00
dependabot[bot] a2b5aa2934 Bump acorn from 6.1.0 to 6.4.1 (#202)
Bumps [acorn](https://github.com/acornjs/acorn) from 6.1.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.1.0...6.4.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-04-08 10:13:07 +02:00
Dominik Sokal 556e0758e7 don't use nix for ios smoke tests 2020-04-07 10:22:28 +02:00
Dominik Sokal 762c6f0538 Release 0.14.5 2020-04-06 14:27:36 +02:00
Dominik Sokal f549695e07 [turtle-cli] make the @expo/config error more meaningful 2020-04-06 14:27:10 +02:00
Dominik Sokal 1e8868e190 Release 0.14.4 2020-04-06 13:25:00 +02:00
Dominik Sokal 93df019bbc update CHANGELOG 2020-04-06 13:24:20 +02:00
Dominik Sokal 5541daa6ec [turtle-cli] insatll @expo/config and use it for determining sdk version 2020-04-06 13:21:29 +02:00
Dominik Sokal 22d78bf6fc [circleci] update cache key for shell apps 2020-04-06 12:26:03 +02:00
Dominik Sokal 4c724289d7 install node deps in android shell app when running smoke tests 2020-04-06 12:25:46 +02:00
Dominik Sokal c5a44dfb67 [circleci] run ios smoke test for sdk37 2020-04-06 12:24:44 +02:00
Dominik Sokal 8bbdc55932 [android] update smoke tests recording file 2020-04-06 12:23:36 +02:00
Dominik Sokal 80233c5736 [ios] update smoke test recordings 2020-04-06 11:38:32 +02:00
Dominik Sokal 5a2b8c47f4 Release 0.14.3 2020-04-03 17:13:47 +02:00
Dominik Sokal ab9391d672 update CHANGELOG - change the version to 0.14.3 - I incidentally interrupted the release 2020-04-03 17:13:24 +02:00
Dominik Sokal e95a6f49ff Release 0.14.2 2020-04-03 17:11:15 +02:00
Dominik Sokal d662cd47b6 [android] update sdk37 tarball so it doesn't use jq internally (#201)
* [android] update sdk37 tarball so it doesn't use jq internally

* [android] update sdk37 tarball again

* update CHANGELOG
2020-04-03 17:10:19 +02:00
Eric Samelson ce5de0963b Release 0.14.1 2020-04-01 14:16:42 -07:00
Eric Samelson 8f717c6c2e update CHANGELOG 2020-04-01 14:16:29 -07:00
Eric Samelson 905b55b7a4 [ios] update SDK 37 shell tarball to properly exclude unnecessary unimodules 2020-04-01 12:21:38 -07:00
Eric Samelson 4588281ffa Update CHANGELOG 2020-03-31 14:42:25 -07:00
Eric Samelson bc13f12052 Release 0.14.0 2020-03-31 14:40:15 -07:00
Eric Samelson 63d3e82cd7 [ci] update android tests to use sdk 37 2020-03-31 12:30:21 -07:00
Eric Samelson b2f8fdd342 [ios][android] drop SDK 33 2020-03-30 21:53:42 -07:00
Eric Samelson 4d9b3bdee9 [android][sdk37] add SDK 37 shell tarball (#198) 2020-03-30 21:52:41 -07:00
Bartłomiej Bukowski 15c165be26 [ios][sdk37] Add SDK 37 shell app tarball (#194) 2020-03-30 21:51:32 -07:00
Dominik Sokal f63e34ace3 Upgrade node to v12 / Drop node v8 support / Drop SDK 31 and 32 (#186) 2020-03-23 16:17:18 -07:00
dependabot[bot] e4ec82d1db Bump acorn from 5.7.3 to 5.7.4 (#195)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-03-18 15:35:29 +01:00
276 changed files with 9600 additions and 8743 deletions

No files matched your search

+69 -19
View File
@@ -9,7 +9,7 @@ executors:
working_directory: ~/turtle
mac:
macos: # https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
xcode: '10.1.0'
xcode: "11.1.0"
working_directory: /Users/distiller/project
shell: /bin/bash -leo pipefail
android:
@@ -57,8 +57,8 @@ commands:
- run:
name: Configure aws-cli
command: |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
setup_nix:
steps:
@@ -77,6 +77,49 @@ commands:
EOF
chmod +x /bin/rm
install_nodejs_mac:
parameters:
nodejs_version:
type: string
default: 12.16.1
yarn_version:
type: string
default: 1.22.0
steps:
- restore_cache:
key: "node-js-v1-darwin-archive-<< parameters.nodejs_version >>"
- run:
name: Uninstall yarn with brew
command: brew uninstall --force yarn
- install_node_and_yarn:
platform: darwin
nodejs_version: "<< parameters.nodejs_version >>"
yarn_version: "<< parameters.yarn_version >>"
- save_cache:
key: "node-js-v1-darwin-archive-<< parameters.nodejs_version >>"
paths:
- /private/tmp/nodejs.tar.xz
install_node_and_yarn:
parameters:
platform:
type: string
nodejs_version:
type: string
yarn_version:
type: string
steps:
- run:
name: Install node & yarn
command: |
NODEJS_ARCHIVE="/tmp/nodejs.tar.xz"
if [ ! -f "$NODEJS_ARCHIVE" ]; then
curl -o $NODEJS_ARCHIVE -SL "https://nodejs.org/dist/v<< parameters.nodejs_version >>/node-v<< parameters.nodejs_version >>-<< parameters.platform >>-x64.tar.xz"
fi
tar -xJf $NODEJS_ARCHIVE -C /usr/local --strip-components=1 --exclude CHANGELOG.md --exclude README.md --exclude LICENSE
ln -s /usr/local/bin/node /usr/local/bin/nodejs
npm install --global yarn@<< parameters.yarn_version >>
decrypt_secrets_if_possible:
steps:
- run:
@@ -93,18 +136,24 @@ commands:
workingdir:
type: string
default: .
platform:
type: string
default: linux
steps:
- restore_cache:
key: yarn-v1-{{ checksum "<< parameters.workingdir >>/yarn.lock" }}
key: yarn-v3-<< parameters.platform >>-{{ checksum "<< parameters.workingdir >>/yarn.lock" }}
save_yarn_cache:
parameters:
workingdir:
type: string
default: .
platform:
type: string
default: linux
steps:
- save_cache:
key: yarn-v1-{{ checksum "<< parameters.workingdir >>/yarn.lock" }}
key: yarn-v3-<< parameters.platform >>-{{ checksum "<< parameters.workingdir >>/yarn.lock" }}
paths:
- ~/.cache/yarn # `yarn cache dir`
@@ -115,10 +164,10 @@ commands:
default: ios
sdk_version:
type: string
default: sdk32
default: sdk39
steps:
- restore_cache:
key: "workingdir-v1-<< parameters.platform >>-<< parameters.sdk_version >>"
key: "workingdir-v2-<< parameters.platform >>-<< parameters.sdk_version >>"
save_workingdir_cache:
parameters:
@@ -130,10 +179,10 @@ commands:
default: ios
sdk_version:
type: string
default: sdk32
default: sdk39
steps:
- save_cache:
key: "workingdir-v1-<< parameters.platform >>-<< parameters.sdk_version >>"
key: "workingdir-v2-<< parameters.platform >>-<< parameters.sdk_version >>"
paths:
- "<< parameters.workingdir >>/<< parameters.platform >>/<< parameters.sdk_version >>"
@@ -180,20 +229,23 @@ jobs:
executor: mac
steps:
- install_nix
- install_nodejs_mac
- setup
- decrypt_secrets_if_possible
- restore_yarn_cache
- restore_yarn_cache:
platform: darwin
- run: yarn
- save_yarn_cache
- save_yarn_cache:
platform: darwin
- restore_workingdir_cache:
sdk_version: sdk35
sdk_version: sdk39
platform: ios
- run:
name: Run iOS smoke tests
command: ./scripts/tests/runIOSSmokeTestsCI.sh
command: SDK_VERSION=sdk39 ./scripts/tests/runIOSSmokeTestsCI.sh
- save_workingdir_cache:
workingdir: /Users/distiller/project/workingdir
sdk_version: sdk35
sdk_version: sdk39
platform: ios
android_smoke_tests:
@@ -205,11 +257,11 @@ jobs:
- run: yarn
- save_yarn_cache
- restore_workingdir_cache:
sdk_version: sdk32
sdk_version: sdk39
platform: android
- run:
name: Fetch Android shell app
command: SDK_VERSION=sdk32 ./scripts/android/fetchRemoteAndroidTarball.sh
command: SDK_VERSION=sdk39 ./scripts/android/fetchRemoteAndroidTarball.sh
- run:
name: Run Android smoke tests
command: |
@@ -217,7 +269,7 @@ jobs:
--run "./scripts/tests/runAndroidSmokeTestsCI.sh"
- save_workingdir_cache:
workingdir: ~/turtle/workingdir
sdk_version: sdk32
sdk_version: sdk39
platform: android
android_staging_deploy:
@@ -255,8 +307,6 @@ workflows:
tests:
jobs:
- unit_tests
- ios_smoke_tests
- android_smoke_tests
deploy:
jobs:
- android_staging_approve_deploy:
+1 -1
View File
@@ -22,6 +22,6 @@ export NODE_ENV=development
export EXPO_TURTLE_TOOLS_DIR="$(pwd)/tools"
PATH_add $EXPO_TURTLE_TOOLS_DIR/bin
if [ "$CI" = "true" ]; then
if [ "$CI" = "true" ] && [[ ! $OSTYPE =~ darwin.* ]]; then
PATH_add $EXPO_TURTLE_TOOLS_DIR/ci/bin
fi
+6 -5
View File
@@ -1,10 +1,9 @@
---
name: "\U0001F41B Bug Report"
about: You want to report a reproducible bug or regression in turtle-cli.
title: ''
labels: 'bug'
assignees: ''
title: ""
labels: "bug"
assignees: ""
---
<!-- Thanks for helping expo! Before you submit your issue, please make sure you followed our checklist and check the appropriate boxes by putting an x in the [ ]: [x] -->
@@ -13,14 +12,16 @@ assignees: ''
- [ ] Updated turtle-cli to the latest version (`yarn global add turtle-cli` or `npm install --global turtle-cli`).
- [ ] I read the [Contribution Guidelines](https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [ ] I read [docs.expo.io](https://docs.expo.io) (Managed Workflow > Distributing Your App).
- [ ] I read [docs.expo.dev](https://docs.expo.dev) (Managed Workflow > Distributing Your App).
- [ ] I searched for [existing GitHub issues](https://github.com/expo/turtle/issues).
- [ ] **I enclosed the complete output when running turtle, including the stack trace and command used.**
### Issue Description
<!-- Please include what's happening, expected behavior, and any relevant code samples -->
##### Command executed
<!-- The command you executed on the command line that resulted in an error -->
##### Complete output when running turtle, including the stack trace and command used
+6 -5
View File
@@ -1,21 +1,22 @@
---
name: "\U00002753 Questions and discussions"
about: You have a question about turtle-cli or want to discuss some aspects of turtle-cli.
title: ''
labels: 'question'
assignees: ''
title: ""
labels: "question"
assignees: ""
---
### Question Checklist
- [ ] I read the [Contribution Guidelines](https://github.com/expo/turtle/blob/master/CONTRIBUTING.md).
- [ ] I read [docs.expo.io](https://docs.expo.io) (Managed Workflow > Distributing Your App).
- [ ] I read [docs.expo.dev](https://docs.expo.dev) (Managed Workflow > Distributing Your App).
- [ ] I searched for [existing GitHub issues](https://github.com/expo/turtle/issues).
### Question Subject
<!-- What command do you have a question about? -->
<!-- Is this a question about documentation? -->
#### Question Description
<!-- Please include expected behavior and any relevant code samples with your question if possible -->
+2
View File
@@ -2,9 +2,11 @@ node_modules
yarn-error.log
google-cloud-credentials.json
/build/
/workingdir/*
/artifacts/*
.history
.vscode/
shell.apk
.secrets*
+1 -1
View File
@@ -1 +1 @@
v8.15.1
v12.16.1
+3 -1
View File
@@ -10,6 +10,8 @@
"release": true
},
"hooks": {
"after:release": "yarn release:update:turtle-cli-example"
"before:init": [
"yarn"
],
}
}
+436
View File
@@ -7,11 +7,441 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
# [0.28.1] - 2022-08-22
- Update Android shell tarball for SDK 46 to remove deprecated *expo-analytics-segment* dependency.
# [0.28.0] - 2022-08-19
- Add iOS and Android shell tarballs for SDK 46.
# [0.27.5] - 2022-07-26
- Update iOS shell tarball for SDK 43, 44, 45 for [expo-notifications crash fix](https://github.com/expo/expo/pull/18023).
# [0.27.4] - 2022-06-28
- Update Android shell tarball for SDK 45.
# [0.27.3] - 2022-06-18
- Update Android SDK 45 shell tarball to fix the notification trampoline issues for Android 12+.
# [0.27.2] - 2022-06-15
- Update Android shell tarballs for SDK 44 and 43.
# [0.27.1] - 2022-06-13
- Update Android shell tarball for SDK 45.
# [0.27.0] - 2022-05-23
- Add iOS and Android shell tarballs for SDK 45.
# [0.26.0] - 2022-03-21
- Remove JDK 8 validation. [#389](https://github.com/expo/turtle/pull/389)
- Update android toolchain. [#389](https://github.com/expo/turtle/pull/389)
# [0.25.0] - 2022-03-11
- Swap out Cloudfront CDN for `classic-assets.eascdn.net`. [#375](https://github.com/expo/turtle/pull/375)
- Disable bitcode for iOS builds.
# [0.24.3] - 2021-12-29
- Update ios sdk 44 shell tarball with [orientation lock fix](https://github.com/expo/expo/pull/15715)
# [0.24.2] - 2021-12-16
- Update Android shell tarball for SDK 44.
# [0.24.1] - 2021-12-15
- Update iOS and Android tarballs for SDK 44 RC. [#369](https://github.com/expo/turtle/pull/369).
# [0.24.0] - 2021-12-10
- Update iOS and Android tarballs for SDK 44 beta.
- Add detection for Expo modules using `expo-module.config.json`, the successor to `unimodule.json`. [#368](https://github.com/expo/turtle/pull/368).
- Redirect google bintray url to localhost. [#361](https://github.com/expo/turtle/pull/361)
# [0.23.6] - 2021-12-08
- Update android shell tarballs for bintray error fix. [#363](https://github.com/expo/turtle/pull/363)
- Update AWS SDK. [#365](https://github.com/expo/turtle/pull/365)
# [0.23.5] - 2021-11-12
- Update iOS SDK 43 tarball with expo-updates fix for [#14967](https://github.com/expo/expo/issues/14967)
# [0.23.4] - 2021-11-09
- Update Android SDK 43 tarball with expo-updates fix for [#15112](https://github.com/expo/expo/issues/15112)
# [0.23.3] - 2021-11-04
- Update iOS and Android SDK 43 tarballs with expo-updates fixes for [#14930](https://github.com/expo/expo/issues/14930)
# [0.23.2] - 2021-10-29
- Update Android SDK 43 shell app with proguard fix
# [0.23.1] - 2021-10-20
- Add iOS and Android tarballs for SDK 43
# [0.23.0] - 2021-10-07
- Add iOS and Android beta tarballs for SDK 43
- Bump xdl to fix Android shell app for SDK 43
# [0.22.6] - 2021-10-01
- add `ACCESS_MEDIA_LOCATION` to blacklist for android permissions
- disable automatic versioning in Xcode 13
# [0.22.5] - 2021-09-09
- Fix s3 logger stream close crash.
- Update Android tarballs SDK 42, 41, 40, and 39 to include location workaround.
- Update Android tarball to include a local assets fix on SDK 42.
# [0.22.4] - 2021-07-27
- Update iOS and Android tarballs for SDK 42.
# [0.22.3] - 2021-07-02
- Update Android tarball for SDK 42.
# [0.22.1] - 2021-06-29
- Update iOS and Android beta tarballs for SDK 42.
# [0.22.0] - 2021-06-22
- Add iOS and Android beta tarballs for SDK 42.
# [0.21.9] - 2021-06-15
- Update `sharp` package, fixes support for M1 macs.
# [0.21.8] - 2021-05-25
- Update Android SDK41 tarball.
# [0.21.7] - 2021-05-21
- Update iOS SDK41 tarball.
- Update Android SDK41 tarball.
# [0.21.6] - 2021-04-22
- Update iOS SDK41 tarball.
- Update Android SDK41 tarball.
# [0.21.5] - 2021-04-15
- Revert iOS client tarball for SDK 41, use the SDK 40 tarball. No longer supporting this feature in SDK 41+.
- Update Android SDK 41 tarball.
# [0.21.4] - 2021-04-13
- Update iOS client tarball for SDK 41.
# [0.21.3] - 2021-04-13
- Update SDK 41 tarball for iOS and Android.
# [0.21.2] - 2021-04-07
- Update SDK 41 beta tarball for Android.
# [0.21.1] - 2021-04-01
- Update SDK 41 beta tarball for iOS.
# [0.21.0] - 2021-03-29
- Add SDK 41 beta tarballs.
- Bump @expo/xdl to 59.1.0.
# [0.20.7] - 2021-01-26
- Remove Go suffix from android app name
# [0.20.6] - 2021-01-25
- Update tarballs for SDK 40 patch release (3e345dd)
# [0.20.5] - 2020-12-23
### Changed
- Updated SDK 40 Android tarball to fix `expo-location` background permissions on Android <9.
# [0.20.4] - 2020-12-17
### Changed
- Updated SDK 40 iOS tarball to fix `expo-notifications` not emitting initial notification response.
# [0.20.3] - 2020-12-10
### Fixed
- Verify jq installation before proceeding with release ([#281](https://github.com/expo/turtle/pull/281)).
- Fixed the iOS build when running offline and user lacks elevated permissions.
# [0.20.2] - 2020-12-09
### Changed
- Updated SDK 40 Android tarball to fix `expo-notifications` installation identifier changing as a bug.
# [0.20.1] - 2020-12-08
### Changed
- Update SDK 40 iOS and Android tarballs for release
# [0.20.0] - 2020-11-30
- Add SDK 40 tarballs in preparation for SDK 40 beta
# [0.19.1] - 2020-11-19
### Fixed
- Fixed the iOS build using Xcode 12.1 by runnig `xcrun simctl list` before the build phase.
- Rebuild iOS tarballs (SDK 36, 37, 38, 39, Ad-Hoc Client) with Xcode 12.1 containing iOS 14 image fix.
# [0.19.0] - 2020-11-13
### Changed
- Rebuild iOS tarballs (SDK 36, 37, 38, 39, Ad-Hoc Client) with Xcode 12.1.
# [0.18.9] - 2020-11-09
### Fixed
- Updated xdl to 58.0.20 to fix an issue with updates.checkAutomatically not being applied properly to SDK 39 Android apps.
# [0.18.8] - 2020-10-27
### Fixed
- Fix issues with Reanimated v2 in Android SDK 39 tarball.
# [0.18.7] - 2020-10-23
### Fixed
- Fix issue with updates in self-hosted Android apps ([#10746](https://github.com/expo/expo/issues/10746)) in the SDK 39 tarball
# [0.18.6] - 2020-10-22
### Fixed
- Fix issues with notifications ([10624](https://github.com/expo/expo/pull/10624) and [10608](https://github.com/expo/expo/pull/10608)) in the Android SDK 39 tarball.
# [0.18.5] - 2020-10-07
### Fixed
- Always add expo-notifications for SDK >= 39 projects with android.enableDangerousExperimentalLeanBuilds enabled.
# [0.18.4] - 2020-10-06
### Fixed
- Fixed an issue with notifications ([expo/expo#10562](https://github.com/expo/expo/issues/10562)) in the Android SDK 39 tarball.
# [0.18.3] - 2020-10-03
### Fixed
- Update @expo/xdl to fix regression in SDK <= 39 splash
# [0.18.2] - 2020-10-03
### Fixed
- Updated SDK 39 Android tarball.
- Updated SDK 39 iOS tarball.
- Updated iOS client tarball.
- Update @expo/config and @expo/xdl. Temporarily bring in type definitions for color-string and xcode.
## [0.18.1] - 2020-09-22
### Fixed
- Fix building apps using SDK 39 for Android.
## [0.18.0] - 2020-09-21
### Added
- Added iOS and Android shell apps for SDK 39.
### Removed
- Dropped support for SDK 35.
## [0.17.3] - 2020-09-14
### Added
- Added gradle 6.2 to `turtle-android-base`
- Added `ANDROID_NDK_HOME` in `turtle-android-base`
### Changed
- Upgraded XDL so it processes root `build.gradle` of Android shell apps too
## [0.17.2] - 2020-08-06
### Changed
- Updated iOS shell app for SDK 38 with fixed integer tagging in expo-gl for iOS 14. ([#245](https://github.com/expo/turtle/pull/245))
## [0.17.1] - 2020-08-05
### Changed
- Updated Android shell app for SDK 38 with `targetSdkVersion` bumped to 29. ([#244](https://github.com/expo/turtle/pull/244))
## [0.17.0] - 2020-07-16
### Added
- `--gradle-args` option for `turtle build:android` which makes it possible to specify custom Gradle arguments.
### Changed
- Gradle Wrapper doesn't print when dots when the appropriate version of Gradle is being downloaded.
## [0.16.2] - 2020-07-01
### Added
- Added `--allow-non-https-public-url` to allow bypass of protocol validation on `--public-url`.
- Added support for dynamic configs (`app.config.ts`, `app.config.js`).
## [0.16.0] - 2020-06-25
### Added
- Added iOS shell app for Expo SDK38.
- Added Android shell app for SDK 38.
### Removed
- Dropped support for SDK 34.
## [0.15.1] - 2020-06-22
### Changed
- Configure Turtle to use the Redis CA certificate.
### Fixed
- Fix announcing supported SDK versions.
## [0.15.0] - 2020-06-02
### Changed
- Updated `@expo/xdl` to 57.9.13 (added \*.bak files clean-up when building .ipa).
## [0.14.12] - 2020-05-14
### Changed
- Update iOS custom client shell app with various fixes.
## [0.14.11] - 2020-05-04
### Changed
- Update SDK 37 iOS shell app with various fixes.
## [0.14.10] - 2020-05-01
### Added
- support for "android.enableDangerousExperimentalLeanBuilds" in app.json.
## [0.14.9] - 2020-04-21
### Changed
- Updated `@expo/xdl` to 57.8.30 (scoped the build command so it only builds the `:app` Android sub-project and not all the sub-projects available, [PR](https://github.com/expo/expo-cli/pull/1937)).
## [0.14.8] - 2020-04-20
### Changed
- Updated `@expo/xdl` to 57.8.29 (removed call to `check-dynamic-macros-android.sh`, [PR](https://github.com/expo/expo-cli/pull/1933)).
## [0.14.7] - 2020-04-20
### Changed
- Turtle no longer installs all dependencies of shell apps projects — only the production dependencies are installed now.
- Updated `@expo/xdl` to 57.8.25 (fixed unintuitive `google-services.json` handling for SDK37+, [PR](https://github.com/expo/expo-cli/pull/1897)).
## [0.14.6] - 2020-04-09
### Changed
- Updated @expo/xdl to 57.8.17 (fixed downloading assets smaller than 10 bytes).
## [0.14.5] - 2020-04-06
### Changed
- Made @expo/config error more meaningful.
## [0.14.4] - 2020-04-06
### Fixed
- Determining SDK version for Expo apps using SDK >=37.
## [0.14.3] - 2020-04-03
### Fixed
- A fix for Android SDK 37 - `check-dynamic-macros-android.sh` doesn't use `jq` anymore.
## [0.14.1] - 2020-04-01
### Changed
- Updated iOS shell app for SDK 37 to remove unnecessary unimodules.
## [0.14.0] - 2020-03-31
### Added
- Added iOS shell app for SDK 37.
- Added Android shell app for SDK 37.
### Changed
- Updated iOS client shell app to support SDK 37.
- Replace `/` with `__` in the artifact filename to fix a strange bug with selecting APK file in Android Studio.
- Print currently using Java version if it's not 8.
### Removed
- Dropped support for SDK 33.
## [0.13.10] - 2020-03-09
### Added
@@ -22,12 +452,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Changed the way of installing NDK - it's installed with `sdkmanager` now.
- Upgraded NDK to 17.2.4988734.
- Upgraded Node.js version to 12.16.1.
### Fixed
- A bug where the `platform` field in logs wasn't set correctly when using a shortcut command.
- Removed all remaining instances of `UIWebView` in iOS app builds.
### Removed
- Dropped support for Node.js versions older than 10.
- Dropped support for building Expo SDK 31 and 32 apps.
## [0.13.9] - 2020-02-13
### Fixed
+1 -1
View File
@@ -4,4 +4,4 @@ The Expo team is committed to fostering an open and welcoming environment.
**Our Community Guidelines can be found here:**
https://expo.io/guidelines
https://expo.dev/guidelines
+9 -2
View File
@@ -1,30 +1,37 @@
# Contributing to Turtle CLI
## How to contribute
You can contribute to Turtle CLI in various ways, including:
- [Reporting bugs or issues](https://github.com/expo/turtle/issues/new) on GitHub. Please make sure to fill in all the details suggested by the template to make sure the issue can be addressed as quickly as possible.
- [Submitting improvements to the documentation](https://github.com/expo/expo/tree/master/docs). Updates, enhancements, new guides, spelling fixes…
- Helping other people on [Expo Forums](https://forums.expo.io/) and on [Expo Developers Slack](http://slack.expo.io).
- Helping other people on [Expo Forums](https://forums.expo.dev/) and on [Expo Developers Discord](http://chat.expo.dev).
- Looking at existing [issues](https://github.com/expo/turtle/issues) and adding more information, particularly helping to reproduce the issues.
- [Submitting a pull request](#submitting-a-pull-request) with a bug fix or an improvement.
## Turtle CLI repository
### Codebase
This repository contains the codebase for the `turtle-cli` NPM package. The same codebase is used to run standalone app builders on the Expo servers.
### Branches
The `master` branch of the repository should be kept releasable at any time. This way we can continuously release fixes and improvements without costly managing of different branches and issues will be noticed and fixed quickly. This also ensures other contributors can check out the latest version from GitHub and work on it with minimal disruption from other features in progress.
## Submitting a pull request
To submit a pull request:
1. Fork the [repository](https://github.com/expo/turtle) and create a feature branch. (Existing contributors can create feature branches without forking. Prefix the branch name with `@your-github-username/`.)
2. Write the description of your pull request. Make sure to include a test plan and test your changes.
3. Make sure all tests pass on CircleCI.
4. Wait for a review and adjust the code if necessary.
## Publishing a release
- Make sure you have set `GITHUB_TOKEN` and `CIRCLE_API_USER_TOKEN` environment variables in `.envrc.local` file. If you don't have the file, run `cp .envrc.local.example .envrc.local` and edit the file.
- To release a new version of `turtle-cli`, run `yarn release` command.
- If you wish to release a new *beta* version of `turtle-cli`, run `yarn release:beta` instead.
- If you wish to release a new _beta_ version of `turtle-cli`, run `yarn release:beta` instead.
- Update the [changelog](CHANGELOG.md).
+1 -1
View File
@@ -8,7 +8,7 @@
## Setup
- Run `update-local-secrets` to populate the `.secrets*` files. You'll need to run this any time any secret changes (it shouldn't be very often).
- Run `EXPO_UNIVERSE_DIR=/path/to/universe/dir yarn secrets:init-private YOUR_SQS_NICKNAME`. Alternatively, you can create `.secrets.local-queue` file with the SQS queues' urls yourself (`AWS_SQS_OUT_QUEUE_URL`, `AWS_SQS_ANDROID_QUEUE_URL`, `AWS_SQS_ANDROID_PRIORITY_QUEUE_URL`, `AWS_SQS_IOS_QUEUE_URL`, `AWS_SQS_IOS_PRIORITY_QUEUE_URL`)
- Run `EXPO_UNIVERSE_DIR=/path/to/universe/dir yarn secrets:init-private YOUR_SQS_NICKNAME`. Alternatively, you can create `.secrets.local-queue` file with the SQS queues' urls yourself (`AWS_SQS_ANDROID_QUEUE_URL`, `AWS_SQS_ANDROID_PRIORITY_QUEUE_URL`, `AWS_SQS_IOS_QUEUE_URL`, `AWS_SQS_IOS_PRIORITY_QUEUE_URL`)
- Run `yarn set-workingdir:local` or `yarn set-workingdir:remote`:
- `:local` creates symlinks to the shell apps in `expo` repository (_unfortunately this is currently broken_)
- `:remote` downloads precompiled shell apps
+18 -18
View File
@@ -1,29 +1,29 @@
# see docker-base/Dockerfile to learn what's installed in the turtle-android-base image
FROM gcr.io/exponentjs/turtle-android-base:0.1.3
FROM gcr.io/exponentjs/turtle-android-base:0.8.0
ADD . /app/turtle
RUN mv /app/turtle/workingdir /app && \
for SDK_VERSION in `ls /app/workingdir/android/`; do \
echo "preparing $SDK_VERSION shell app" && \
cd /app/workingdir/android/$SDK_VERSION && \
if [ -f universe-package.json ]; then \
mv package.json exponent-package.json && \
mv universe-package.json package.json && \
yarn install && \
mv package.json universe-package.json && \
mv exponent-package.json package.json; \
else \
yarn install; \
fi \
; done && \
mv /app/workingdir /app/turtle
WORKDIR /app/turtle
RUN ./scripts/fetchRemoteTarballs.sh android
RUN ln -s /app/turtle/workingdir /app/workingdir && \
for SDK_VERSION in `ls /app/workingdir/android/`; do \
echo "preparing $SDK_VERSION shell app" && \
cd /app/workingdir/android/$SDK_VERSION && \
mv package.json copy_package.json && \
jq '.workspaces.packages = ["packages/expo", "packages/expo-modules-autolinking"]' copy_package.json > package.json && \
rm -f copy_package.json && \
# Keep in sync with src/bin/setup/android/index.ts#_installNodeModules
# --prod requires --ignore-scripts (otherwise
# expo-yarn-workspaces errors as missing)
yarn install --ignore-scripts --prod ; \
done
ENV NODE_ENV "production"
ENV TURTLE_WORKING_DIR_PATH /app/turtle/workingdir/
WORKDIR /app/turtle
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD redislabs_ca.pem /var/run/config/redislabs-tls/redislabs_ca.pem
CMD ["/usr/bin/supervisord"]
+3 -43
View File
@@ -1,43 +1,3 @@
<h3 align=center>
<img src="logo/horizontal.png" width=50%>
</h3>
[![CircleCI](https://img.shields.io/circleci/project/github/expo/turtle/master.svg)](https://circleci.com/gh/expo/turtle)
[![NPM](https://img.shields.io/npm/v/turtle-cli/latest.svg)](https://npmjs.com/package/turtle-cli)
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/expo/turtle/blob/master/LICENSE)
[![Expo Developers Slack](https://img.shields.io/badge/Expo%20Developers-e01563.svg?logo=slack)](http://slack.expo.io)
[![Expo Forums](https://img.shields.io/badge/Expo%20Forums-blue.svg)](https://forums.expo.io/)
<hr />
Turtle CLI is a command line interface for building Expo standalone apps.
You can use it both on your CI and your private computer.
- [Changelog](CHANGELOG.md)
- [Contributing](CONTRIBUTING.md)
- [Development](DEVELOPMENT.md)
- [Code of Conduct](CODE_OF_CONDUCT.md)
## Installation
[Installation instructions and documentation here.](https://docs.expo.io/versions/latest/distribution/turtle-cli)
## Usage example
See the [expo/turtle-cli-example](https://github.com/expo/turtle-cli-example) repository to learn how to use Turtle CLI in order to build Expo standalone apps on your CI.
## Do you need help?
- Make sure you've read [the Expo Docs](https://docs.expo.io/), especially [Building Standalone Apps on Your CI
](https://docs.expo.io/versions/latest/distribution/turtle-cli) and [Building Standalone Apps](https://docs.expo.io/versions/latest/distribution/building-standalone-apps) guides.
- Search for existing GitHub issues [in this repository](https://github.com/expo/turtle/issues) and in [expo/expo](https://github.com/expo/expo/issues) repository.
- Ask for help in **one** of the following ways:
* create [a GitHub issue](https://github.com/expo/turtle/issues/new).
* create a new topic on [Expo Forums](https://forums.expo.io/).
* ask a question on [Expo Developers Slack](http://slack.expo.io).
## License
The Turtle CLI source code is made available under the [MIT license](LICENSE).
Some of the dependencies are licensed differently, with the BSD license, for example.
> 🚨 This repository contains the legacy build service (Turtle), as well as its local version - Turtle CLI. The service has been shut down at the beginning of 2023.
>
> Learn how to migrate to EAS Build - https://docs.expo.dev/build-reference/migrating/
-104
View File
@@ -1,104 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
const nock_1 = __importDefault(require("nock"));
const config_1 = __importDefault(require("../config"));
const constants_1 = require("../constants");
const jobManager = __importStar(require("../jobManager"));
const logger_1 = __importDefault(require("../logger"));
jest.mock('../builders/utils/uploader.ts', () => ({
uploadBuildToS3: jest.fn(() => {
logger_1.default.debug('Faking uploading build');
return 'legit_path';
}),
}));
async function performSmokeTest(recording) {
jest.setTimeout(60 * 60 * 1000);
// @ts-ignore
const fixtureExists = await fs_extra_1.default.exists(recording);
if (fixtureExists) {
logger_1.default.info('Fixture exists, test will use existing one.');
nock_1.default.load(recording);
mockLogs();
mockSQS();
logger_1.default.info('Loading fixture');
}
else {
nock_1.default.recorder.rec({
dont_print: true,
output_objects: true,
enable_reqheaders_recording: false,
});
}
await jobManager.doJob();
if (!fixtureExists) {
await fs_extra_1.default.writeFile(recording, JSON.stringify(nock_1.default.recorder.play()));
}
}
function mockLogs() {
/*
Match log push messages. Seperate matcher, because it needs `persist` option
due to fact that it's being called variable amount times.
*/
return nock_1.default('https://exp-shell-app-assets.s3.us-west-1.amazonaws.com')
.persist()
.put((uri) => {
return uri.indexOf('/logs') >= 0;
})
.reply(200);
}
function mockSQS() {
return nock_1.default('https://sqs.us-west-2.amazonaws.com')
.persist()
.post(() => true)
.reply(200);
}
function mockFinish() {
// A separate matcher for the final request to ensure build was completed successfully
return nock_1.default('https://sqs.us-west-2.amazonaws.com:443')
.post('/', (body) => {
const keys = Object.keys(body);
if (keys.includes('MessageBody')) {
const mb = JSON.parse(body.MessageBody);
if (mb.status === 'finished') {
return true;
}
else if (mb.status === 'errored') {
fail('Build ended with error');
}
}
return false;
})
.reply(200);
}
async function testPlatform(platform) {
process.env.PLATFORM = platform;
const utils = require('turtle/aws/utils');
utils.QUEUE_URL = jest.fn((priority) => {
return config_1.default.sqs.queues[priority][platform];
});
nock_1.default.cleanAll();
nock_1.default.enableNetConnect();
const finishMock = mockFinish();
const fixtureLocation = `src/__smoke__/fixtures/${platform}/recording.json`;
await performSmokeTest(fixtureLocation);
expect(finishMock.isDone());
nock_1.default.disableNetConnect();
}
test('Android builds', async () => {
await testPlatform(constants_1.PLATFORMS.ANDROID);
});
test('iOS builds', async () => {
await testPlatform(constants_1.PLATFORMS.IOS);
});
//# sourceMappingURL=smoke.test.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"smoke.test.js","sourceRoot":"","sources":["../../src/__smoke__/smoke.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA0B;AAE1B,gDAAwB;AAExB,uDAAmC;AACnC,4CAA6C;AAC7C,0DAAgD;AAChD,uDAAmC;AAEnC,IAAI,CAAC,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE,CAAC,CAAC;IAChD,eAAe,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;QAC5B,gBAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC;CACH,CAAC,CAAC,CAAC;AAEJ,KAAK,UAAU,gBAAgB,CAAC,SAAiB;IAC/C,IAAI,C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IAAI,EAAE;IAChC,MAAM,YAAY,CAAC,qBAAS,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;IAC5B,MAAM,YAAY,CAAC,qBAAS,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC","sourcesContent":["import fs from 'fs-extra';\n\nimport nock from 'nock';\n\nimport config from 'turtle/config';\nimport { PLATFORMS } from 'turtle/constants';\nimport * as jobManager from 'turtle/jobManager';\nimport logger from 'turtle/logger';\n\njest.mock('../builders/utils/uploader.ts', () => ({\n uploadBuildToS3: jest.fn(() => {\n logger.debug('Faking uploading build');\n return 'legit_path';\n }),\n}));\n\nasync function performSmokeTest(recording: string) {\n jest.setTimeout(60 * 60 * 1000);\n\n // @ts-ignore\n const fixtureExists = await fs.exists(recording);\n if (fixtureExists) {\n logger.info('Fixture exists, test will use existing one.');\n\n nock.load(recording);\n mockLogs();\n mockSQS();\n logger.info('Loading fixture');\n } else {\n nock.recorder.rec({\n dont_print: true,\n output_objects: true,\n enable_reqheaders_recording: false,\n });\n }\n\n await jobManager.doJob();\n if (!fixtureExists) {\n await fs.writeFile(recording, JSON.stringify(nock.recorder.play()));\n }\n}\n\nfunction mockLogs() {\n /*\n Match log push messages. Seperate matcher, because it needs `persist` option\n due to fact that it's being called variable amount times.\n */\n return nock('https://exp-shell-app-assets.s3.us-west-1.amazonaws.com')\n .persist()\n .put((uri: string) => {\n return uri.indexOf('/logs') >= 0;\n })\n .reply(200);\n}\n\nfunction mockSQS() {\n return nock('https://sqs.us-west-2.amazonaws.com')\n .persist()\n .post(() => true)\n .reply(200);\n}\n\nfunction mockFinish() {\n // A separate matcher for the final request to ensure build was completed successfully\n\n return nock('https://sqs.us-west-2.amazonaws.com:443')\n .post('/', (body: any) => {\n const keys = Object.keys(body);\n if (keys.includes('MessageBody')) {\n const mb = JSON.parse(body.MessageBody);\n if (mb.status === 'finished') {\n return true;\n } else if (mb.status === 'errored') {\n fail('Build ended with error');\n }\n }\n return false;\n })\n .reply(200);\n}\n\nasync function testPlatform(platform: string) {\n process.env.PLATFORM = platform;\n\n const utils = require('turtle/aws/Line truncated
-14
View File
@@ -1,14 +0,0 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const context = __importStar(require("../turtleContext"));
test('Initially should not exit', () => {
expect(context.checkShouldExit()).toBe(false);
});
//# sourceMappingURL=turtleContext.test.js.map
@@ -1 +0,0 @@
{"version":3,"file":"turtleContext.test.js","sourceRoot":"","sources":["../../src/__tests__/turtleContext.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0DAAgD;AAEhD,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACrC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC","sourcesContent":["import * as context from 'turtle/turtleContext';\n\ntest('Initially should not exit', () => {\n expect(context.checkShouldExit()).toBe(false);\n});\n"]}
-21
View File
@@ -1,21 +0,0 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const validator = __importStar(require("../validator"));
const testValidator = (fixturePath) => {
const data = require(fixturePath);
expect(() => validator.sanitizeJob(data)).not.toThrow();
};
test('Passes valid manifest for Android', () => {
testValidator('turtle/__tests__/fixtures/androidJob.json');
});
test('Passes valid manifest for ios', () => {
testValidator('turtle/__tests__/fixtures/iosJob.json');
});
//# sourceMappingURL=validator.test.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"validator.test.js","sourceRoot":"","sources":["../../src/__tests__/validator.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wDAA8C;AAE9C,MAAM,aAAa,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAClC,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;AAC1D,CAAC,CAAC;AAEF,IAAI,CAAC,mCAAmC,EAAE,GAAG,EAAE;IAC7C,aAAa,CAAC,2CAA2C,CAAC,CAAC;AAC7D,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;IACzC,aAAa,CAAC,uCAAuC,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC","sourcesContent":["import * as validator from 'turtle/validator';\n\nconst testValidator = (fixturePath: string) => {\n const data = require(fixturePath);\n expect(() => validator.sanitizeJob(data)).not.toThrow();\n};\n\ntest('Passes valid manifest for Android', () => {\n testValidator('turtle/__tests__/fixtures/androidJob.json');\n});\n\ntest('Passes valid manifest for ios', () => {\n testValidator('turtle/__tests__/fixtures/iosJob.json');\n});\n"]}
-5
View File
@@ -1,5 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EXTRA_DIMENSIONS = Symbol('Extra Dimensions');
exports.GROUP_HASH = Symbol('Group Hash');
//# sourceMappingURL=constants.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/aws/cloudwatch/constants.ts"],"names":[],"mappings":";;AAAa,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC9C,QAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["export const EXTRA_DIMENSIONS = Symbol('Extra Dimensions');\nexport const GROUP_HASH = Symbol('Group Hash');\n"]}
-44
View File
@@ -1,44 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const config_1 = __importDefault(require("../../config"));
exports.TYPE_DIMENSIONS = (type) => [
[
{ Name: 'env', Value: config_1.default.deploymentEnv },
{ Name: 'platform', Value: config_1.default.platform },
{ Name: 'type', Value: type },
],
[
{ Name: 'env', Value: config_1.default.deploymentEnv },
{ Name: 'platform', Value: config_1.default.platform },
{ Name: 'type', Value: type },
{ Name: 'host', Value: config_1.default.hostname },
],
];
exports.PRIORITY_DIMENSIONS = (type, priority) => [
[
{ Name: 'env', Value: config_1.default.deploymentEnv },
{ Name: 'platform', Value: config_1.default.platform },
{ Name: 'priority', Value: priority },
],
[
{ Name: 'env', Value: config_1.default.deploymentEnv },
{ Name: 'platform', Value: config_1.default.platform },
{ Name: 'type', Value: type },
],
[
{ Name: 'env', Value: config_1.default.deploymentEnv },
{ Name: 'platform', Value: config_1.default.platform },
{ Name: 'type', Value: type },
{ Name: 'priority', Value: priority },
],
[
{ Name: 'env', Value: config_1.default.deploymentEnv },
{ Name: 'platform', Value: config_1.default.platform },
{ Name: 'type', Value: type },
{ Name: 'host', Value: config_1.default.hostname },
],
];
//# sourceMappingURL=dimensions.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"dimensions.js","sourceRoot":"","sources":["../../../src/aws/cloudwatch/dimensions.ts"],"names":[],"mappings":";;;;;AAAA,0DAAmC;AAEtB,QAAA,eAAe,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC;IAC/C;QACE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAM,CAAC,aAAa,EAAE;QAC5C,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAM,CAAC,QAAQ,EAAE;QAC5C,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE;KAC9B;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AAM,CAAC,QAAQ,EAAE;QAC5C,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE;QAC7B,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAM,CAAC,QAAQ,EAAE;KACzC;CACF,CAAC","sourcesContent":["import config from 'turtle/config';\n\nexport const TYPE_DIMENSIONS = (type: string) => [\n [\n { Name: 'env', Value: config.deploymentEnv },\n { Name: 'platform', Value: config.platform },\n { Name: 'type', Value: type },\n ],\n [\n { Name: 'env', Value: config.deploymentEnv },\n { Name: 'platform', Value: config.platform },\n { Name: 'type', Value: type },\n { Name: 'host', Value: config.hostname },\n ],\n];\n\nexport const PRIORITY_DIMENSIONS = (type: string, priority: string) => [\n [\n { Name: 'env', Value: config.deploymentEnv },\n { Name: 'platform', Value: config.platform },\n { Name: 'priority', Value: priority },\n ],\n [\n { Name: 'env', Value: config.deploymentEnv },\n { Name: 'platform', Value: config.platform },\n { Name: 'type', Value: type },\n ],\n [\n { Name: 'env', Value: config.deploymentEnv },\n { Name: 'platform', Value: config.platform },\n { Name: 'type', Value: type },\n { Name: 'priority', Value: priority },\n ],\n [\n { Name: 'env', Value: config.deploymentEnv },\n { Name: 'platform', Value: config.platform },\n { Name: 'type', Value: type },\n { Name: 'host', Value: config.hostname },\n ],\n];\n"]}
-138
View File
@@ -1,138 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const aws_sdk_1 = __importDefault(require("aws-sdk"));
const lodash_1 = __importDefault(require("lodash"));
const constants_1 = require("./constants");
const statistics_1 = __importDefault(require("./statistics"));
const config_1 = __importDefault(require("../../config"));
const logger_1 = __importDefault(require("../../logger"));
const SUCCESS_SUFFIX = '.success';
const FAIL_SUFFIX = '.fail';
const CHUNK_SIZE = 20;
const state = {
metrics: [],
registeredMetrics: {},
intervalId: null,
};
const cloudWatch = new aws_sdk_1.default.CloudWatch({
apiVersion: '2010-08-01',
region: config_1.default.cloudwatch.region,
accessKeyId: config_1.default.aws.accessKeyId,
secretAccessKey: config_1.default.aws.secretAccessKey,
});
function init() {
if (config_1.default.cloudwatch.disabled) {
return;
}
state.intervalId = setInterval(_dumpMetrics, config_1.default.cloudwatch.intervalMs);
}
exports.init = init;
function addMetricData({ name, value, success = true, explicitName = false, extraDimensions = [], }) {
if (config_1.default.cloudwatch.disabled) {
return;
}
const metricName = explicitName ? name : _createMetricName(name, success);
const registeredMetric = state.registeredMetrics[metricName];
if (!registeredMetric) {
return;
}
const { unit } = registeredMetric;
const metric = {
MetricName: metricName,
Unit: unit,
Value: value,
Timestamp: new Date(),
[constants_1.EXTRA_DIMENSIONS]: extraDimensions,
[constants_1.GROUP_HASH]: _calculateGroupHash(metricName, extraDimensions),
};
state.metrics.push(metric);
}
exports.addMetricData = addMetricData;
function registerMetric({ metricName, unit, reducer, dimensions = [], statistics = false, addEmpty = true, explicitName = false, }) {
if (config_1.default.cloudwatch.disabled) {
return;
}
const successMetricName = _createMetricName(metricName, true, explicitName);
state.registeredMetrics[successMetricName] = { unit, statistics, reducer, addEmpty, dimensions };
if (!explicitName) {
const failMetricName = _createMetricName(metricName, false);
state.registeredMetrics[failMetricName] = { unit, statistics, reducer, addEmpty, dimensions };
}
}
exports.registerMetric = registerMetric;
function _createMetricName(name, success, explicitName) {
if (explicitName) {
return name;
}
else {
const suffix = success ? SUCCESS_SUFFIX : FAIL_SUFFIX;
return `${name}${suffix}`;
}
}
function _calculateGroupHash(metricName, extraDimensions) {
const dimString = lodash_1.default.flatten(extraDimensions)
.map(({ Name, Value }) => `,${Name}:${Value}`)
.join('');
return `${metricName}${dimString}`;
}
function _dumpMetrics() {
if (!state.metrics.length && Object.keys(state.registeredMetrics).length < 0) {
// empty metrics list, skipping
return;
}
logger_1.default.trace('[cloudwatch] lenghts for state.metrics=%d, state.registeredMetrics=%d', state.metrics.length, Object.keys(state.registeredMetrics).length);
_addEmptyMetrics(state.metrics);
const formattedMetrics = _formatMetrics(state.metrics);
_pushMetrics(formattedMetrics);
state.metrics = [];
}
function _addEmptyMetrics(metrics) {
const seenMetrics = metrics.reduce((acc, i) => {
if (!acc.has(i.MetricName)) {
acc.add(i.MetricName);
}
return acc;
}, new Set());
const nonEmptyMetrics = lodash_1.default.omitBy(state.registeredMetrics, ({ addEmpty }) => !addEmpty);
const toAdd = lodash_1.default.difference(Object.keys(nonEmptyMetrics), Array.from(seenMetrics));
toAdd.forEach((name) => addMetricData({ name, value: 0, explicitName: true }));
}
function _formatMetrics(metrics) {
const reducedMetrics = _reduceMetrics(metrics);
const metricsWithDimensions = reducedMetrics.map((metric) => {
const { dimensions } = state.registeredMetrics[metric.MetricName];
const joinedDimensions = [...dimensions, ...metric[constants_1.EXTRA_DIMENSIONS]];
return joinedDimensions.map((i) => Object.assign({}, metric, { Dimensions: i }));
});
const metricData = lodash_1.default.flatten(metricsWithDimensions);
const chunks = lodash_1.default.chunk(metricData, CHUNK_SIZE);
return chunks.map((chunk) => ({
Namespace: config_1.default.cloudwatch.namespace,
MetricData: chunk,
}));
}
function _reduceMetrics(metrics) {
const grouped = lodash_1.default.groupBy(metrics, constants_1.GROUP_HASH);
return lodash_1.default.reduce(grouped, (acc, val) => {
const { MetricName: key } = val[0];
const { reducer, statistics } = state.registeredMetrics[key];
const reduced = reducer ? reducer(val) : val;
const withStats = statistics ? statistics_1.default(reduced) : reduced;
acc.push(...withStats);
return acc;
}, []);
}
function _pushMetrics(metrics) {
logger_1.default.trace('[cloudwatch] pushing metrics', JSON.stringify(metrics, null, '\t'));
metrics.forEach((metricsChunk) => {
cloudWatch.putMetricData(metricsChunk, (err) => {
if (err) {
logger_1.default.warn({ err }, '[cloudwatch]');
}
});
});
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/aws/cloudwatch/index.ts"],"names":[],"mappings":";;;;;AAAA,sDAA0B;AAC1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AC,CAAC;QAC5B,SAAS,EAAE,gBAAM,CAAC,UAAU,CAAC,SAAS;QACtC,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC,CAAC;AACN,CAAC;AAED,SAAS,cAAc,CAAC,OAAkB;IACxC,MAAM,OAAO,GAAG,gBAAC,CAAC,OAAO,CAAC,OAAO,EAAE,sBAAU,CAAC,CAAC;IAC/C,OAAO,gBAAC,CAAC,MAAM,CACb,OAAO,EACP,CAAC,GAAc,EAAE,GAAQ,EAAE,EAAE;QAC3B,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAY,CAAC;QAC9C,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAC7C,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,oBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACtE,GAAG,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACH,CAAC;AACJ,CAALine truncated
-29
View File
@@ -1,29 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function sum(metrics) {
if (metrics.length === 0) {
return [];
}
const reduced = metrics.reduce((acc, i) => {
let result = acc;
if (!result) {
result = { ...i };
}
else {
result.Value += i.Value;
}
return result;
}, null);
return [reduced];
}
exports.sum = sum;
function avg(metrics) {
if (!metrics.length) {
return [];
}
const metric = sum(metrics)[0];
metric.Value = metric.Value / metrics.length;
return [metric];
}
exports.avg = avg;
//# sourceMappingURL=reducers.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"reducers.js","sourceRoot":"","sources":["../../../src/aws/cloudwatch/reducers.ts"],"names":[],"mappings":";;AAEA,SAAgB,GAAG,CAAC,OAAkB;IACpC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAmB,EAAE,CAAU,EAAE,EAAE;QACjE,IAAI,MAAM,GAAG,GAAG,CAAC;QACjB,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;SACnB;aAAM;YACL,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC;SACzB;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,IAAI,CAAC,CAAC;IACT,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC;AAdD,kBAcC;AAED,SAAgB,GAAG,CAAC,OAAkB;IACpC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QACnB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAY,CAAC;IAC1C,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAC7C,OAAO,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC;AARD,kBAQC","sourcesContent":["import { IMetric } from 'turtle/aws/cloudwatch/types';\n\nexport function sum(metrics: IMetric[]) {\n if (metrics.length === 0) {\n return [];\n }\n const reduced = metrics.reduce((acc: IMetric | null, i: IMetric) => {\n let result = acc;\n if (!result) {\n result = { ...i };\n } else {\n result.Value += i.Value;\n }\n return result;\n }, null);\n return [reduced];\n}\n\nexport function avg(metrics: IMetric[]) {\n if (!metrics.length) {\n return [];\n }\n\n const metric = sum(metrics)[0] as IMetric;\n metric.Value = metric.Value / metrics.length;\n return [metric];\n}\n"]}
-29
View File
@@ -1,29 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function calculateStatistics(metrics) {
if (!metrics.length) {
return [];
}
const reduced = metrics.reduce((acc, i) => {
let result = acc;
if (!result) {
result = Object.assign({}, i, {
StatisticValues: {
Maximum: -Infinity,
Minimum: Infinity,
SampleCount: 0,
Sum: 0.0,
},
Value: undefined,
});
}
result.StatisticValues.Maximum = Math.max(result.StatisticValues.Maximum, i.Value);
result.StatisticValues.Minimum = Math.min(result.StatisticValues.Minimum, i.Value);
result.StatisticValues.SampleCount += 1;
result.StatisticValues.Sum += i.Value;
return result;
}, null);
return [reduced];
}
exports.default = calculateStatistics;
//# sourceMappingURL=statistics.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"statistics.js","sourceRoot":"","sources":["../../../src/aws/cloudwatch/statistics.ts"],"names":[],"mappings":";;AAEA,SAAwB,mBAAmB,CAAC,OAAkB;IAC5D,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QACnB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAA2B,EAAE,CAAU,EAAE,EAAE;QACzE,IAAI,MAAM,GAAG,GAAG,CAAC;QACjB,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE;gBAC5B,eAAe,EAAE;oBACf,OAAO,EAAE,CAAC,QAAQ;oBAClB,OAAO,EAAE,QAAQ;oBACjB,WAAW,EAAE,CAAC;oBACd,GAAG,EAAE,GAAG;iBACT;gBACD,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;SACJ;QAED,MAAM,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QACnF,MAAM,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QACnF,MAAM,CAAC,eAAe,CAAC,WAAW,IAAI,CAAC,CAAC;QACxC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,IAAI,CAAC,CAAC;IACT,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC;AA1BD,sCA0BC","sourcesContent":["import { IMetric, MetricWithStats } from 'turtle/aws/cloudwatch/types';\n\nexport default function calculateStatistics(metrics: IMetric[]) {\n if (!metrics.length) {\n return [];\n }\n\n const reduced = metrics.reduce((acc: MetricWithStats | null, i: IMetric) => {\n let result = acc;\n if (!result) {\n result = Object.assign({}, i, {\n StatisticValues: {\n Maximum: -Infinity,\n Minimum: Infinity,\n SampleCount: 0,\n Sum: 0.0,\n },\n Value: undefined,\n });\n }\n\n result.StatisticValues.Maximum = Math.max(result.StatisticValues.Maximum, i.Value);\n result.StatisticValues.Minimum = Math.min(result.StatisticValues.Minimum, i.Value);\n result.StatisticValues.SampleCount += 1;\n result.StatisticValues.Sum += i.Value;\n return result;\n }, null);\n return [reduced];\n}\n"]}
-4
View File
@@ -1,4 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("./constants");
//# sourceMappingURL=types.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/aws/cloudwatch/types.ts"],"names":[],"mappings":";;AAAA,2CAA+E","sourcesContent":["import { EXTRA_DIMENSIONS, GROUP_HASH } from 'turtle/aws/cloudwatch/constants';\n\nexport interface IMetric {\n MetricName: string;\n Unit: string;\n Value: number;\n Timestamp: Date;\n StatisticValues?: {\n Maximum: number;\n Minimum: number;\n SampleCount: number;\n Sum: number;\n };\n [EXTRA_DIMENSIONS]: any;\n [GROUP_HASH]: string;\n}\n\nexport type MetricWithStats = {\n StatisticValues: {\n Maximum: number;\n Minimum: number;\n SampleCount: number;\n Sum: number;\n },\n} & IMetric;\n\nexport interface IMetricData {\n name: string;\n value: number;\n success?: boolean;\n explicitName?: boolean;\n extraDimensions?: any;\n}\n\nexport interface IMetricConfiguration {\n unit: string;\n statistics?: boolean;\n reducer?: any;\n addEmpty?: boolean;\n dimensions?: any;\n}\n\nexport type MetricRegistrationObject = { metricName: string, explicitName?: boolean } & IMetricConfiguration;\n\nexport interface IMetricsChunk {\n Namespace: string;\n MetricData: IMetric[];\n}\n"]}
-25
View File
@@ -1,25 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const aws_sdk_1 = __importDefault(require("aws-sdk"));
const fs_extra_1 = __importDefault(require("fs-extra"));
const lodash_1 = __importDefault(require("lodash"));
const config_1 = __importDefault(require("../config"));
const s3 = new aws_sdk_1.default.S3({
...lodash_1.default.pick(config_1.default.aws, ['accessKeyId', 'secretAccessKey']),
...lodash_1.default.pick(config_1.default.s3, ['region']),
});
exports.default = s3;
async function uploadFile({ bucketName = config_1.default.s3.bucket, key, srcPath }) {
return await s3
.upload({
Bucket: bucketName,
Key: key,
Body: fs_extra_1.default.createReadStream(srcPath),
})
.promise();
}
exports.uploadFile = uploadFile;
//# sourceMappingURL=s3.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../src/aws/s3.ts"],"names":[],"mappings":";;;;;AAAA,sDAA0B;AAC1B,wDAA0B;AAC1B,oDAAuB;AAEvB,uDAAmC;AAQnC,MAAM,EAAE,GAAG,IAAI,iBAAG,CAAC,EAAE,CAAC;IACpB,GAAG,gBAAC,CAAC,IAAI,CAAC,gBAAM,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACzD,GAAG,gBAAC,CAAC,IAAI,CAAC,gBAAM,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC;CACjC,CAAC,CAAC;AAEH,kBAAe,EAAE,CAAC;AAEX,KAAK,UAAU,UAAU,CAAC,EAAE,UAAU,GAAG,gBAAM,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAqB;IACjG,OAAO,MAAM,EAAE;SACZ,MAAM,CAAC;QACN,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,kBAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;KACnC,CAAC;SACD,OAAO,EAAE,CAAC;AACf,CAAC;AARD,gCAQC","sourcesContent":["import AWS from 'aws-sdk';\nimport fs from 'fs-extra';\nimport _ from 'lodash';\n\nimport config from 'turtle/config';\n\ninterface IFileUploadParams {\n bucketName?: string;\n key: string;\n srcPath: string;\n}\n\nconst s3 = new AWS.S3({\n ..._.pick(config.aws, ['accessKeyId', 'secretAccessKey']),\n ..._.pick(config.s3, ['region']),\n});\n\nexport default s3;\n\nexport async function uploadFile({ bucketName = config.s3.bucket, key, srcPath }: IFileUploadParams) {\n return await s3\n .upload({\n Bucket: bucketName,\n Key: key,\n Body: fs.createReadStream(srcPath),\n })\n .promise();\n}\n"]}
-95
View File
@@ -1,95 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const async_retry_1 = __importDefault(require("async-retry"));
const aws_sdk_1 = __importDefault(require("aws-sdk"));
const lodash_1 = __importDefault(require("lodash"));
const utils_1 = require("./utils");
const config_1 = __importDefault(require("../config"));
const logger_1 = __importDefault(require("../logger"));
const turtleContext_1 = require("../turtleContext");
const sqs = new aws_sdk_1.default.SQS({
apiVersion: '2012-11-05',
...lodash_1.default.pick(config_1.default.aws, ['accessKeyId', 'secretAccessKey']),
...lodash_1.default.pick(config_1.default.sqs, ['region']),
});
const VISIBILITY_TIMEOUT_SEC = 30;
async function receiveMessage(priority) {
const params = {
MaxNumberOfMessages: 1,
QueueUrl: utils_1.QUEUE_URL(priority),
VisibilityTimeout: VISIBILITY_TIMEOUT_SEC,
};
return await async_retry_1.default(() => {
return sqs
.receiveMessage(params)
.promise()
.then((data) => {
if (data.Messages) {
logger_1.default.info(`Received a message`);
return data.Messages[0];
}
else {
logger_1.default.debug(`No messages received [${priority}]`);
return null;
}
})
.catch((err) => {
logger_1.default.error({ err }, 'Receive error');
throw err;
});
});
}
exports.receiveMessage = receiveMessage;
async function deleteMessage(priority, receiptHandle) {
const params = {
QueueUrl: utils_1.QUEUE_URL(priority),
ReceiptHandle: receiptHandle,
};
return await async_retry_1.default(() => {
return sqs.deleteMessage(params).promise();
});
}
exports.deleteMessage = deleteMessage;
async function changeMessageVisibility(priority, receiptHandle) {
const params = {
QueueUrl: utils_1.QUEUE_URL(priority),
ReceiptHandle: receiptHandle,
VisibilityTimeout: VISIBILITY_TIMEOUT_SEC,
};
return sqs.changeMessageVisibility(params).promise();
}
exports.changeMessageVisibility = changeMessageVisibility;
// Every VISIBILITY_TIMEOUT_SEC / 3 seconds we are telling AWS SQS
// that we're still processing the message, so it does not
// send the build job to another turtle agent
function changeMessageVisibilityRecurring(priority, receiptHandle, jobId) {
return setInterval(() => {
if (turtleContext_1.getCurrentJobId() === jobId) {
changeMessageVisibility(priority, receiptHandle).catch((err) => {
logger_1.default.warn({ err }, 'Error at change msg visibility');
});
}
}, (VISIBILITY_TIMEOUT_SEC * 1000) / 3);
}
exports.changeMessageVisibilityRecurring = changeMessageVisibilityRecurring;
async function sendMessage(jobId, status, data = {}) {
const params = {
MessageBody: JSON.stringify({ jobId, status, ...data }),
QueueUrl: utils_1.OUTPUT_QUEUE_URL(),
DelaySeconds: 0,
MessageGroupId: jobId,
};
try {
return await async_retry_1.default(async () => {
return await sqs.sendMessage(params).promise();
});
}
catch (err) {
logger_1.default.error({ err }, `Error sending SQS message: ${JSON.stringify(params)}}`);
}
}
exports.sendMessage = sendMessage;
//# sourceMappingURL=sqs.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file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jF,MAAM,MAAM,GAAG;QACb,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;QACvD,QAAQ,EAAE,wBAAgB,EAAE;QAC5B,YAAY,EAAE,CAAC;QACf,cAAc,EAAE,KAAK;KACtB,CAAC;IACF,IAAI;QACF,OAAO,MAAM,qBAAK,CAAC,KAAK,IAAI,EAAE;YAC5B,OAAO,MAAM,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;QACjD,CAAC,CAAC,CAAC;KACJ;IAAC,OAAO,GAAG,EAAE;QACZ,gBAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,8BAA8B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAChF;AACH,CAAC;AAdD,kCAcC","sourcesContent":["import retry from 'async-retry';\nimport AWS from 'aws-sdk';\nimport _ from 'lodash';\n\nimport { OUTPUT_QUEUE_URL, QUEUE_URL } from 'turtle/aws/utils';\nimport config from 'turtle/config';\nimport { JOB_UPDATE_TYPE } from 'turtle/constants/build';\nimport logger from 'turtle/logger';\nimport { getCurrentJobId } from 'turtle/turtleContext';\n\nconst sqs = new AWS.SQS({\n apiVersion: '2012-11-05',\n ..._.pick(config.aws, ['accessKeyId', 'secretAccessKey']),\n ..._.pick(config.sqs, ['region']),\n});\n\nconst VISIBILITY_TIMEOUT_SEC = 30;\n\nexport async function receiveMessage(priority: string) {\n const params = {\n MaxNumberOfMessages: 1,\n QueueUrl: QUEUE_URL(priority),\n VisibilityTimeout: VISIBILITY_TIMEOUT_SEC,\n };\n return await retry(() => {\n return sqs\n .receiveMessage(params)\n .promise()\n .then((data) => {\n if (data.Messages) {\n logger.info(`Received a message`);\n return data.Messages[0];\n } else {\n logger.debug(`No messages received [${priority}]`);\n return null;\n }\n })\n .catch((err) => {\n logger.error({ err }, 'Receive error');\n throw err;\n });\n });\n}\n\nexport async function deleteMessage(priority: string, receiptHandle: string) {\n const params = {\n QueueUrl: QUEUE_URL(priority),\n ReceiptHandle: receiptHandle,\n };\n return await retry(() => {\n return sqs.deleteMessage(params).promise();\n });\n}\n\nexport async function changeMessageVisibility(priority: string, receiptHandle: string) {\n const params = {\n QueueUrl: QUEUE_URL(priority),\n ReceiptHandle: receiptHandle,\n VisibilityTimeout: VISIBILITY_TIMEOUT_SEC,\n };\n return sqs.changeMessageVisibility(params).promise();\n}\n\n// Every VISIBILITY_TIMEOUT_SEC / 3 seconds we are telling AWS SQS\n// that we're still processing the message, so it does not\n// send the build job to another turtle agent\nexport function changeMessageVisibilityRecurring(priority: string, receiptHandle: string, jobId: string) {\n return setInterval(() => {\n if (getCurrentJobId() === jobId) {\n changeMessageVisibility(priority, receiptHandle).catch((err) => {\n logger.warn({ err }, 'Error at change msg visibility');\n });\n }\n }, (VISIBILITY_TIMEOUT_SEC * 1000) / 3);\n}\n\nexport async function sendMessagLine truncated
-9
View File
@@ -1,9 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const config_1 = __importDefault(require("../config"));
exports.QUEUE_URL = (priority) => config_1.default.sqs.queues[priority][config_1.default.platform];
exports.OUTPUT_QUEUE_URL = () => config_1.default.sqs.queues.out;
//# sourceMappingURL=utils.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/aws/utils.ts"],"names":[],"mappings":";;;;;AAAA,uDAAmC;AAEtB,QAAA,SAAS,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAE,gBAAM,CAAC,GAAG,CAAC,MAAc,CAAC,QAAQ,CAAC,CAAC,gBAAM,CAAC,QAAQ,CAAC,CAAC;AACxF,QAAA,gBAAgB,GAAG,GAAG,EAAE,CAAC,gBAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC","sourcesContent":["import config from 'turtle/config';\n\nexport const QUEUE_URL = (priority: string) => (config.sqs.queues as any)[priority][config.platform];\nexport const OUTPUT_QUEUE_URL = () => config.sqs.queues.out;\n"]}
@@ -1,6 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ErrorWithCommandHelp extends Error {
}
exports.ErrorWithCommandHelp = ErrorWithCommandHelp;
//# sourceMappingURL=ErrorWithCommandHelp.js.map
@@ -1 +0,0 @@
{"version":3,"file":"ErrorWithCommandHelp.js","sourceRoot":"","sources":["../../../src/bin/commands/ErrorWithCommandHelp.ts"],"names":[],"mappings":";;AAAA,MAAa,oBAAqB,SAAQ,KAAK;CAC9C;AADD,oDACC","sourcesContent":["export class ErrorWithCommandHelp extends Error {\n}\n"]}
@@ -1,6 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ErrorWithProgramHelp extends Error {
}
exports.ErrorWithProgramHelp = ErrorWithProgramHelp;
//# sourceMappingURL=ErrorWithProgramHelp.js.map
@@ -1 +0,0 @@
{"version":3,"file":"ErrorWithProgramHelp.js","sourceRoot":"","sources":["../../../src/bin/commands/ErrorWithProgramHelp.ts"],"names":[],"mappings":";;AAAA,MAAa,oBAAqB,SAAQ,KAAK;CAC9C;AADD,oDACC","sourcesContent":["export class ErrorWithProgramHelp extends Error {\n}\n"]}
-55
View File
@@ -1,55 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
const ErrorWithCommandHelp_1 = require("../ErrorWithCommandHelp");
const builder_1 = require("../../utils/builder");
const android_1 = __importDefault(require("../../../builders/android"));
const constants_1 = require("../../../constants");
exports.default = (program, setCommonCommandOptions) => {
const command = program.command('build:android [project-dir]');
setCommonCommandOptions(command);
command
.alias('ba')
.option('--keystore-path <app.jks>', 'path to your Keystore (please provide Keystore password and Key password as EXPO_ANDROID_KEYSTORE_PASSWORD'
+ ' and EXPO_ANDROID_KEY_PASSWORD env variables)')
.option('--keystore-alias <alias>', 'keystore Alias')
.option('-t --type <build>', 'type of build: app-bundle|apk', /^(app-bundle|apk)$/i, 'app-bundle')
.option('-m --mode <build>', 'type of build: debug|release', /^(debug|release)$/i, 'release')
.description('Build a standalone APK or App Bundle for your project, either signed and ready for submission to'
+ ' the Google Play Store or in debug mode.')
.asyncAction(builder_1.createBuilderAction({
program,
command,
prepareCredentials,
builder: android_1.default,
platform: constants_1.PLATFORMS.ANDROID,
os: ['darwin', 'linux'],
}));
};
const prepareCredentials = async (cmd) => {
const { keystorePath, keystoreAlias } = cmd;
const keystorePassword = process.env.EXPO_ANDROID_KEYSTORE_PASSWORD;
const keyPassword = process.env.EXPO_ANDROID_KEY_PASSWORD;
const someCredentialsExist = keystorePath || keystoreAlias || keystorePassword || keyPassword;
const credentialsExist = keystorePath && keystoreAlias && keystorePassword && keyPassword;
if (!credentialsExist) {
if (someCredentialsExist) {
throw new ErrorWithCommandHelp_1.ErrorWithCommandHelp('Please provide all required credentials - Keystore (with password), Keystore alias and Key password');
}
else {
return null;
}
}
else {
return {
keystore: (await fs_extra_1.default.readFile(keystorePath)).toString('base64'),
keystoreAlias,
keystorePassword,
keyPassword,
};
}
};
//# sourceMappingURL=android.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../../../src/bin/commands/build/android.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0B;AAG1B,kEAAgF;AAChF,iDAA+D;AAC/D,wEAA8C;AAC9C,kDAA6C;AAE7C,kBAAe,CAAC,OAAY,EAAE,uBAA4B,EAAE,EAAE;IAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC/D,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO;SACJ,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CACL,2BAA2B,EAC3B,4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C,CAAC","sourcesContent":["import fs from 'fs-extra';\nimport _ from 'lodash';\n\nimport { ErrorWithCommandHelp } from 'turtle/bin/commands/ErrorWithCommandHelp';\nimport { createBuilderAction } from 'turtle/bin/utils/builder';\nimport builder from 'turtle/builders/android';\nimport { PLATFORMS } from 'turtle/constants';\n\nexport default (program: any, setCommonCommandOptions: any) => {\n const command = program.command('build:android [project-dir]');\n setCommonCommandOptions(command);\n command\n .alias('ba')\n .option(\n '--keystore-path <app.jks>',\n 'path to your Keystore (please provide Keystore password and Key password as EXPO_ANDROID_KEYSTORE_PASSWORD'\n + ' and EXPO_ANDROID_KEY_PASSWORD env variables)',\n )\n .option('--keystore-alias <alias>', 'keystore Alias')\n .option(\n '-t --type <build>',\n 'type of build: app-bundle|apk',\n /^(app-bundle|apk)$/i,\n 'app-bundle',\n )\n .option(\n '-m --mode <build>',\n 'type of build: debug|release',\n /^(debug|release)$/i,\n 'release',\n )\n .description(\n 'Build a standalone APK or App Bundle for your project, either signed and ready for submission to'\n + ' the Google Play Store or in debug mode.',\n )\n .asyncAction(\n createBuilderAction({\n program,\n command,\n prepareCredentials,\n builder,\n platform: PLATFORMS.ANDROID,\n os: ['darwin', 'linux'],\n }),\n );\n};\n\nconst prepareCredentials = async (cmd: any) => {\n const { keystorePath, keystoreAlias } = cmd;\n const keystorePassword = process.env.EXPO_ANDROID_KEYSTORE_PASSWORD;\n const keyPassword = process.env.EXPO_ANDROID_KEY_PASSWORD;\n\n const someCredentialsExist = keystorePath || keystoreAlias || keystorePassword || keyPassword;\n const credentialsExist = keystorePath && keystoreAlias && keystorePassword && keyPassword;\n if (!credentialsExist) {\n if (someCredentialsExist) {\n throw new ErrorWithCommandHelp(\n 'Please provide all required credentials - Keystore (with password), Keystore alias and Key password',\n );\n } else {\n return null;\n }\n } else {\n return {\n keystore: (await fs.readFile(keystorePath)).toString('base64'),\n keystoreAlias,\n keystorePassword,\n keyPassword,\n };\n }\n};\n"]}
-27
View File
@@ -1,27 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const android_1 = __importDefault(require("./android"));
const ios_1 = __importDefault(require("./ios"));
function createCommand(builder) {
return (program) => {
return builder(program, setCommonCommandOptions);
};
}
function setCommonCommandOptions(cmd) {
cmd
.option('-u --username <username>', 'username (you can also set EXPO_USERNAME env variable)')
.option('-p --password <password>', 'password (you can also set EXPO_PASSWORD env variable)')
.option('-d --build-dir <build-dir>', 'directory for build artifact (default: `~/expo-apps`)')
.option('-o --output <output-file-path>', 'output file path')
.option('--public-url <url>', 'the URL of an externally hosted manifest (for self-hosted apps), only HTTPS URLs are supported!')
.option('--release-channel <channel-name>', 'pull from specified release channel (default: default)')
.option('-c --config <config-file>', 'specify a path to app.json');
}
exports.default = {
ios: createCommand(ios_1.default),
android: createCommand(android_1.default),
};
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/bin/commands/build/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAC5E,gDAAoE;AAEpE,SAAS,aAAa,CAAC,OAAY;IACjC,OAAO,CAAC,OAAY,EAAE,EAAE;QACtB,OAAO,OAAO,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;IACnD,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,GAAQ;IACvC,GAAG;SACA,MAAM,CAAC,0BAA0B,EAAE,wDAAwD,CAAC;SAC5F,MAAM,CAAC,0BAA0B,EAAE,wDAAwD,CAAC;SAC5F,MAAM,CAAC,4BAA4B,EAAE,uDAAuD,CAAC;SAC7F,MAAM,CAAC,gCAAgC,EAAE,kBAAkB,CAAC;SAC5D,MAAM,CACL,oBAAoB,EACpB,iGAAiG,CAClG;SACA,MAAM,CACL,kCAAkC,EAClC,wDAAwD,CACzD;SACA,MAAM,CAAC,2BAA2B,EAAE,4BAA4B,CAAC,CAAC;AACvE,CAAC;AAED,kBAAe;IACb,GAAG,EAAE,aAAa,CAAC,aAAQ,CAAC;IAC5B,OAAO,EAAE,aAAa,CAAC,iBAAY,CAAC;CACrC,CAAC","sourcesContent":["import { default as buildAndroid } from 'turtle/bin/commands/build/android';\nimport { default as buildIOS } from 'turtle/bin/commands/build/ios';\n\nfunction createCommand(builder: any) {\n return (program: any) => {\n return builder(program, setCommonCommandOptions);\n };\n}\n\nfunction setCommonCommandOptions(cmd: any) {\n cmd\n .option('-u --username <username>', 'username (you can also set EXPO_USERNAME env variable)')\n .option('-p --password <password>', 'password (you can also set EXPO_PASSWORD env variable)')\n .option('-d --build-dir <build-dir>', 'directory for build artifact (default: `~/expo-apps`)')\n .option('-o --output <output-file-path>', 'output file path')\n .option(\n '--public-url <url>',\n 'the URL of an externally hosted manifest (for self-hosted apps), only HTTPS URLs are supported!',\n )\n .option(\n '--release-channel <channel-name>',\n 'pull from specified release channel (default: default)',\n )\n .option('-c --config <config-file>', 'specify a path to app.json');\n}\n\nexport default {\n ios: createCommand(buildIOS),\n android: createCommand(buildAndroid),\n};\n"]}
-48
View File
@@ -1,48 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
const ErrorWithCommandHelp_1 = require("../ErrorWithCommandHelp");
const builder_1 = require("../../utils/builder");
const ios_1 = __importDefault(require("../../../builders/ios"));
const constants_1 = require("../../../constants");
exports.default = (program, setCommonCommandOptions) => {
const command = program.command('build:ios [project-dir]');
setCommonCommandOptions(command);
command
.alias('bi')
.option('-t --type <build>', 'type of build: archive|simulator', /^(archive|simulator)$/i, 'archive')
.option('--team-id <apple-teamId>', 'Apple Team ID')
.option('--dist-p12-path <dist.p12>', 'path to your Distribution Certificate P12 (please provide password as EXPO_IOS_DIST_P12_PASSWORD env variable)')
.option('--provisioning-profile-path <.mobileprovision>', 'path to your Provisioning Profile')
.description('Build a standalone IPA for your project, signed and ready for submission to the Apple App Store.')
.asyncAction(builder_1.createBuilderAction({
program,
command,
prepareCredentials,
builder: ios_1.default,
platform: constants_1.PLATFORMS.IOS,
os: 'darwin',
}));
};
const prepareCredentials = async (cmd) => {
if (cmd.type !== constants_1.IOS_BUILD_TYPES.ARCHIVE) {
return null;
}
const { teamId, distP12Path, provisioningProfilePath } = cmd;
const certPassword = process.env.EXPO_IOS_DIST_P12_PASSWORD;
const credentialsExist = teamId && distP12Path && certPassword && provisioningProfilePath;
if (!credentialsExist) {
throw new ErrorWithCommandHelp_1.ErrorWithCommandHelp('Please provide all required credentials'
+ '- Apple Team ID, Distribution Certificate P12 (with password) and Provisioning Profile');
}
return {
teamId,
certP12: (await fs_extra_1.default.readFile(distP12Path)).toString('base64'),
certPassword,
provisioningProfile: (await fs_extra_1.default.readFile(provisioningProfilePath)).toString('base64'),
};
};
//# sourceMappingURL=ios.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../../../src/bin/commands/build/ios.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0B;AAG1B,kEAAgF;AAChF,iDAA+D;AAC/D,gEAA0C;AAC1C,kDAA8D;AAE9D,kBAAe,CAAC,OAAY,EAAE,uBAA4B,EAAE,EAAE;IAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC3D,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO;SACJ,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CACL,mBAAmB,EACnB,kCAAkC,EAClC,wBAAwB,EACxB,SAAS,CACV;SACA,MAAM,CAAC,0BAA0B,EAAE,eAAe,CAAC;SACnD,MAAM,CACL,4BAA4B,EAC5B,gHAAgH,CACjH;SACA,MAAM,CAAC,gDAAgD,EAAE,mCAAmC,CAAC;SAC7F,WAAW,CACV,kGAAkG,CACnG;SACA,WAAW,CACV,6BAAmB,CAAC;QAClB,OAAO;QACP,OAAO;QACP,kBAAkB;QAClB,OAAO,EAAP,aAAO;QACP,QAAQ,EAAE,qBAAS,CAAC,GAAG;QACvB,EAAE,EAAE,QAAQ;KACb,CAAC,CACH,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,KAAK,EAAE,GAAQ,EAAE,EAAE;IAC5C,IAAI,GAAG,CAAC,IAAI,KAAK,2BAAe,CAAC,OAAO,EAAE;QACxC,OAAO,IAAI,CAAC;KACb;IAED,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,uBAAuB,EAAE,GAAG,GAAG,CAAC;IAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAE5D,MAAM,gBAAgB,GACpB,MAAM,IAAI,WAAW,IAAI,YAAY,IAAI,uBAAuB,CAAC;IAEnE,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,2CAAoB,CAC5B,yCAAyC;cACvC,wFAAwF,CAC3F,CAAC;KACH;IAED,OAAO;QACL,MAAM;QACN,OAAO,EAAE,CAAC,MAAM,kBAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC5D,YAAY;QACZ,mBAAmB,EAAE,CAAC,MAAM,kBAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;KACrF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import fs from 'fs-extra';\nimport _ from 'lodash';\n\nimport { ErrorWithCommandHelp } from 'turtle/bin/commands/ErrorWithCommandHelp';\nimport { createBuilderAction } from 'turtle/bin/utils/builder';\nimport builder from 'turtle/builders/ios';\nimport { IOS_BUILD_TYPES, PLATFORMS } from 'turtle/constants';\n\nexport default (program: any, setCommonCommandOptions: any) => {\n const command = program.command('build:ios [project-dir]');\n setCommonCommandOptions(command);\n command\n .alias('bi')\n .option(\n '-t --type <build>',\n 'type of build: archive|simulator',\n /^(archive|simulator)$/i,\n 'archive',\n )\n .option('--team-id <apple-teamId>', 'Apple Team ID')\n .option(\n '--dist-p12-path <dist.p12>',\n 'path to your Distribution Certificate P12 (please provide password as EXPO_IOS_DIST_P12_PASSWORD env variable)',\n )\n .option('--provisioning-profile-path <.mobileprovision>', 'path to your Provisioning Profile')\n .description(\n 'Build a standalone IPA for your project, signed and ready for submission to the Apple App Store.',\n )\n .asyncAction(\n createBuilderAction({\n program,\n command,\n prepareCredentials,\n builder,\n platform: PLATFORMS.IOS,\n os: 'darwin',\n }),\n );\n};\n\nconst prepareCredentials = async (cmd: any) => {\n if (cmd.type !== IOS_BUILD_TYPES.ARCHIVE) {\n return null;\n }\n\n const { teamId, distP12Path, provisioningProfilePath } = cmd;\n const certPassword = process.env.EXPO_IOS_DIST_P12_PASSWORD;\n\n const credentialsExist =\n teamId && distP12Path && certPassword && provisioningProfilePath;\n\n if (!credentialsExist) {\n throw new ErrorWithCommandHelp(\n 'Please provide all required credentials'\n + '- Apple Team ID, Distribution Certificate P12 (with password) and Provisioning Profile',\n );\n }\n\n return {\n teamId,\n certP12: (await fs.readFile(distP12Path)).toString('base64'),\n certPassword,\n provisioningProfile: (await fs.readFile(provisioningProfilePath)).toString('base64'),\n };\n};\n"]}
-12
View File
@@ -1,12 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const build_1 = __importDefault(require("./build"));
const setup_1 = __importDefault(require("./setup"));
exports.setupIOS = setup_1.default.ios;
exports.setupAndroid = setup_1.default.android;
exports.buildIOS = build_1.default.ios;
exports.buildAndroid = build_1.default.android;
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bin/commands/index.ts"],"names":[],"mappings":";;;;;AAAA,oDAAiD;AACjD,oDAA8C;AAEjC,QAAA,QAAQ,GAAG,eAAK,CAAC,GAAG,CAAC;AACrB,QAAA,YAAY,GAAG,eAAK,CAAC,OAAO,CAAC;AAE7B,QAAA,QAAQ,GAAG,eAAQ,CAAC,GAAG,CAAC;AACxB,QAAA,YAAY,GAAG,eAAQ,CAAC,OAAO,CAAC","sourcesContent":["import builders from 'turtle/bin/commands/build';\nimport setup from 'turtle/bin/commands/setup';\n\nexport const setupIOS = setup.ios;\nexport const setupAndroid = setup.android;\n\nexport const buildIOS = builders.ios;\nexport const buildAndroid = builders.android;\n"]}
-48
View File
@@ -1,48 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_1 = __importDefault(require("lodash"));
const ErrorWithCommandHelp_1 = require("./ErrorWithCommandHelp");
const ErrorWithProgramHelp_1 = require("./ErrorWithProgramHelp");
const setup_1 = __importDefault(require("../setup/setup"));
const constants_1 = require("../../constants");
const logger_1 = __importDefault(require("../../logger"));
const l = logger_1.default.child({ buildPhase: 'setting up environment' });
function createSetupCommand(platform, os) {
return (program) => {
const command = program.command(`setup:${platform}`);
const platformFirstLetter = platform[0];
command
.alias(`s${platformFirstLetter}`)
.description(`Setup environment for building ${lodash_1.default.capitalize(platform)} standalone apps.`)
.option('--sdk-version <sdk-version>', 'version of Expo SDK shell app to download (optional)')
.asyncAction(async (cmd) => await setupAction(program, cmd, platform, os));
};
}
async function setupAction(program, cmd, platform, os) {
try {
if (os && process.platform !== os) {
throw new Error('We don\'t support running standalone app builds for this platform on your operating system');
}
const { sdkVersion } = cmd;
await setup_1.default(platform, sdkVersion);
l.info('it\'s all set!');
}
catch (err) {
logger_1.default.error({ err }, `Failed to setup environment for ${platform} builds`);
if (err instanceof ErrorWithCommandHelp_1.ErrorWithCommandHelp) {
cmd.help();
}
else if (err instanceof ErrorWithProgramHelp_1.ErrorWithProgramHelp) {
program.help();
}
process.exit(1);
}
}
exports.default = {
ios: createSetupCommand(constants_1.PLATFORMS.IOS, 'darwin'),
android: createSetupCommand(constants_1.PLATFORMS.ANDROID),
};
//# sourceMappingURL=setup.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/bin/commands/setup.ts"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AAEvB,iEAAgF;AAChF,iEAAgF;AAChF,2DAA2C;AAC3C,+CAA6C;AAC7C,0DAAmC;AAEnC,MAAM,CAAC,GAAG,gBAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAEjE,SAAS,kBAAkB,CAAC,QAAgB,EAAE,EAAW;IACvD,OAAO,CAAC,OAAY,EAAE,EAAE;QACtB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC;QACrD,MAAM,mBAAmB,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxC,OAAO;aACJ,KAAK,CAAC,IAAI,mBAAmB,EAAE,CAAC;aAChC,WAAW,CAAC,kCAAkC,gBAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,mBAAmB,CAAC;aACxF,MAAM,CACL,6BAA6B,EAC7B,sDAAsD,CACvD;aACA,WAAW,CAAC,KAAK,EAAE,GAAQ,EAAE,EAAE,CAAC,MAAM,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,OAAY,EAAE,GAAQ,EAAE,QAAgB,EAAE,EAAW;IAC9E,IAAI;QACF,IAAI,EAAE,IAAI,OAAO,CAAC,QAAQ,KAAK,EAAE,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;SAC/G;QAED,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;QAC3B,MAAM,eAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAClC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;KAC1B;IAAC,OAAO,GAAG,EAAE;QACZ,gBAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mCAAmC,QAAQ,SAAS,CAAC,CAAC;QAC5E,IAAI,GAAG,YAAY,2CAAoB,EAAE;YACvC,GAAG,CAAC,IAAI,EAAE,CAAC;SACZ;aAAM,IAAI,GAAG,YAAY,2CAAoB,EAAE;YAC9C,OAAO,CAAC,IAAI,EAAE,CAAC;SAChB;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC;AAED,kBAAe;IACb,GAAG,EAAE,kBAAkB,CAAC,qBAAS,CAAC,GAAG,EAAE,QAAQ,CAAC;IAChD,OAAO,EAAE,kBAAkB,CAAC,qBAAS,CAAC,OAAO,CAAC;CAC/C,CAAC","sourcesContent":["import _ from 'lodash';\n\nimport { ErrorWithCommandHelp } from 'turtle/bin/commands/ErrorWithCommandHelp';\nimport { ErrorWithProgramHelp } from 'turtle/bin/commands/ErrorWithProgramHelp';\nimport setup from 'turtle/bin/setup/setup';\nimport { PLATFORMS } from 'turtle/constants';\nimport logger from 'turtle/logger';\n\nconst l = logger.child({ buildPhase: 'setting up environment' });\n\nfunction createSetupCommand(platform: string, os?: string) {\n return (program: any) => {\n const command = program.command(`setup:${platform}`);\n const platformFirstLetter = platform[0];\n command\n .alias(`s${platformFirstLetter}`)\n .description(`Setup environment for building ${_.capitalize(platform)} standalone apps.`)\n .option(\n '--sdk-version <sdk-version>',\n 'version of Expo SDK shell app to download (optional)',\n )\n .asyncAction(async (cmd: any) => await setupAction(program, cmd, platform, os));\n };\n}\n\nasync function setupAction(program: any, cmd: any, platform: string, os?: string) {\n try {\n if (os && process.platform !== os) {\n throw new Error('We don\\'t support running standalone app builds for this platform on your operating system');\n }\n\n const { sdkVersion } = cmd;\n await setup(platform, sdkVersion);\n l.info('it\\'s all set!');\n } catch (err) {\n logger.error({ err }, `Failed to setup environment for ${platform} builds`);\n if (err instanceof ErrorWithCommandHelp) {\n cmd.help();\n } else if (err instanceof ErrorWithProgramHelp) {\n program.help();\n }\n process.exit(1);\n }\n}\n\nexport default {\n ios: createSetupCommand(PLATFORMS.IOS, 'darwin'),\n android: createSetupCommand(PLATFORMS.ANDROID),\n};\n"]}
-53
View File
@@ -1,53 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const os_1 = __importDefault(require("os"));
const path_1 = __importDefault(require("path"));
const lodash_1 = __importDefault(require("lodash"));
const env_1 = require("../utils/env");
const resolveEnv = () => {
if (env_1.env('EXPO_LOCAL', '0') === '1') {
return 'local';
}
else if (env_1.env('EXPO_STAGING', '0') === '1') {
return 'staging';
}
else {
return 'production';
}
};
const currentEnv = resolveEnv();
const isLocal = (envName) => envName === 'local';
const isStaging = (envName) => envName === 'staging';
const apiConfig = {
protocol: 'https',
hostname: 'exp.host',
port: 443,
};
if (isStaging(currentEnv)) {
apiConfig.hostname = 'staging.exp.host';
}
else if (isLocal(currentEnv)) {
apiConfig.protocol = 'http';
apiConfig.hostname = 'localhost';
apiConfig.port = 3000;
}
const OFFLINE_ENV_VARS = {
TURTLE_MODE: 'offline',
API_PROTOCOL: apiConfig.protocol,
API_HOSTNAME: apiConfig.hostname,
API_PORT: apiConfig.port,
TURTLE_FAKE_UPLOAD: '1',
TURTLE_FAKE_UPLOAD_DIR: path_1.default.join(os_1.default.homedir(), 'expo-apps'),
TURTLE_WORKING_DIR_PATH: path_1.default.join(os_1.default.homedir(), '.turtle/workingdir'),
EXPO_SKIP_SOURCING: '1',
};
function initOfflineEnv() {
lodash_1.default.map(OFFLINE_ENV_VARS, (val, key) => {
process.env[key] = String(val);
});
}
exports.initOfflineEnv = initOfflineEnv;
//# sourceMappingURL=env.js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CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC;IAC5D,uBAAuB,EAAE,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,oBAAoB,CAAC;IACtE,kBAAkB,EAAE,GAAG;CACxB,CAAC;AAEF,SAAgB,cAAc;IAC5B,gBAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACnC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,wCAIC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport _ from 'lodash';\n\nimport { env } from 'turtle/utils/env';\n\nconst resolveEnv = () => {\n if (env('EXPO_LOCAL', '0') === '1') {\n return 'local';\n } else if (env('EXPO_STAGING', '0') === '1') {\n return 'staging';\n } else {\n return 'production';\n }\n};\n\nconst currentEnv = resolveEnv();\nconst isLocal = (envName: string) => envName === 'local';\nconst isStaging = (envName: string) => envName === 'staging';\n\nconst apiConfig = {\n protocol: 'https',\n hostname: 'exp.host',\n port: 443,\n};\n\nif (isStaging(currentEnv)) {\n apiConfig.hostname = 'staging.exp.host';\n} else if (isLocal(currentEnv)) {\n apiConfig.protocol = 'http';\n apiConfig.hostname = 'localhost';\n apiConfig.port = 3000;\n}\n\nconst OFFLINE_ENV_VARS = {\n TURTLE_MODE: 'offline',\n API_PROTOCOL: apiConfig.protocol,\n API_HOSTNAME: apiConfig.hostname,\n API_PORT: apiConfig.port,\n TURTLE_FAKE_UPLOAD: '1',\n TURTLE_FAKE_UPLOAD_DIR: path.join(os.homedir(), 'expo-apps'),\n TURTLE_WORKING_DIR_PATH: path.join(os.homedir(), '.turtle/workingdir'),\n EXPO_SKIP_SOURCING: '1',\n};\n\nexport function initOfflineEnv() {\n _.map(OFFLINE_ENV_VARS, (val, key) => {\n process.env[key] = String(val);\n });\n}\n"]}
-71
View File
@@ -1,71 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const xdl_1 = require("@expo/xdl");
const commander_1 = __importStar(require("commander"));
const fs_extra_1 = __importDefault(require("fs-extra"));
const commands = __importStar(require("./commands"));
const logger_1 = __importDefault(require("../logger"));
const { name, version } = JSON.parse(fs_extra_1.default.readFileSync(path_1.default.join(__dirname, '../../package.json'), 'utf-8'));
const ModuleVersionChecker = xdl_1.ModuleVersion.createModuleVersionChecker(name, version);
xdl_1.LoggerDetach.configure(logger_1.default);
commander_1.Command.prototype.asyncAction = function asyncAction(asyncFn) {
return this.action(async (...args) => {
try {
await checkForUpdateAsync();
}
catch (err) {
logger_1.default.warn({ err }, 'Failed to check for turtle-cli update.');
}
return await asyncFn(...args);
});
};
function run(programName) {
runAsync(programName).catch((err) => {
logger_1.default.error({ err }, 'Uncaught Error');
process.exit(1);
});
}
exports.run = run;
async function runAsync(programName) {
commander_1.default.version(version);
Object.values(commands).forEach((command) => registerCommand(commander_1.default, command));
commander_1.default.parse(process.argv);
const subCommand = process.argv[2];
if (subCommand) {
const commandNames = commander_1.default.commands.reduce((acc, command) => {
acc.push(command._name);
const alias = command._alias;
if (alias) {
acc.push(alias);
}
return acc;
}, []);
if (!commandNames.includes(subCommand)) {
logger_1.default.error(`"${subCommand}" is not an ${programName} command. See "${programName} --help" for the full list of commands.`);
}
}
else {
commander_1.default.help();
}
}
const registerCommand = (prog, command) => command(prog);
async function checkForUpdateAsync() {
const { updateIsAvailable, current, latest } = await ModuleVersionChecker.checkAsync();
if (updateIsAvailable) {
logger_1.default.warn(`There is a new version of ${name} available (${latest}).
You are currently using ${name} ${current}
Run \`npm install -g ${name}\` to get the latest version`);
}
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAwB;AAExB,mCAAwD;AACxD,uDAA6C;AAC7C,wDAA0B;AAE1B,qDAAgD;AAChD,uDAAmC;AAEnC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAE3G,MAAM,oBAAoB,GAAG,mBAAa,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAErF,kBAAY,CAAC,SAAS,CAAC,gBAAM,CAAC,CAAC;AAE/B,mBAAO,CAAC,SAAS,CAAC,WAAW,GAAG,SAAS,WAAW,CAAC,OAAwC;IAC3F,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;QACnC,IAAI;YACF,MAAM,mBAAmB,EAAE,CAAC;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,gBAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,wCAAwC,CAAC,CAAC;SAChE;QACD,OAAO,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,SAAgB,GAAG,CAAC,WAAmB;IACrC,QAAQ,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QAClC,gBAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CA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,CAAC,IAAI,CACT,6BAA6B,IAAI,eAAe,MAAM;0BAClC,IAAI,IAAI,OAAO;uBAClB,IAAI,8BAA8B,CACpD,CAAC;KACH;AACH,CAAC","sourcesContent":["import path from 'path';\n\nimport { LoggerDetach, ModuleVersion } from '@expo/xdl';\nimport program, { Command } from 'commander';\nimport fs from 'fs-extra';\n\nimport * as commands from 'turtle/bin/commands';\nimport logger from 'turtle/logger';\n\nconst { name, version } = JSON.parse(fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf-8'));\n\nconst ModuleVersionChecker = ModuleVersion.createModuleVersionChecker(name, version);\n\nLoggerDetach.configure(logger);\n\nCommand.prototype.asyncAction = function asyncAction(asyncFn: (...asyncFnArgs: any[]) => void): Command {\n return this.action(async (...args) => {\n try {\n await checkForUpdateAsync();\n } catch (err) {\n logger.warn({ err }, 'Failed to check for turtle-cli update.');\n }\n return await asyncFn(...args);\n });\n};\n\nexport function run(programName: string) {\n runAsync(programName).catch((err) => {\n logger.error({ err }, 'Uncaught Error');\n process.exit(1);\n });\n}\n\nasync function runAsync(programName: string) {\n program.version(version);\n Object.values(commands).forEach((command) => registerCommand(program, command));\n program.parse(process.argv);\n\n const subCommand = process.argv[2];\n if (subCommand) {\n const commandNames = program.commands.reduce((acc: string[], command: any) => {\n acc.push(command._name);\n const alias = command._alias;\n if (alias) {\n acc.push(alias);\n }\n return acc;\n }, []);\n if (!commandNames.includes(subCommand)) {\n logger.error(\n `\"${subCommand}\" is not an ${programName} command. See \"${programName} --help\" for the full list of commands.`,\n );\n }\n } else {\n program.help();\n }\n}\n\nconst registerCommand = (prog: any, command: any) => command(prog);\n\nasync function checkForUpdateAsync() {\n const { updateIsAvailable, current, latest } = await ModuleVersionChecker.checkAsync();\n if (updateIsAvailable) {\n logger.warn(\n `There is a new version of ${name} available (${latest}).\nYou are currently using ${name} ${current}\nRun \\`npm install -g ${name}\\` to get the latest version`,\n );\n }\n}\n"]}
-116
View File
@@ -1,116 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const util_1 = __importDefault(require("util"));
const xdl_1 = require("@expo/xdl");
const fs_extra_1 = __importDefault(require("fs-extra"));
const which_1 = __importDefault(require("which"));
const sdk_1 = __importDefault(require("./sdk"));
const common_1 = require("../utils/common");
const workingdir_1 = require("../../../builders/utils/android/workingdir");
const config_1 = __importDefault(require("../../../config"));
const constants_1 = require("../../../constants");
const logger_1 = __importDefault(require("../../../logger"));
const which = util_1.default.promisify(which_1.default);
const JAVA_REQUIRED_VERSION = 8;
const REQUIRED_TOOLS = [
{
command: 'bash',
missingDescription: 'Please install bash',
},
{
command: 'javac',
missingDescription: `Please install JDK 8 - keep in mind that other versions are not supported by Android`,
testFn: async () => {
const { status, stdout, stderr } = await xdl_1.ExponentTools.spawnAsyncThrowError('java', ['-version'], { stdio: 'pipe' });
if (stdout.match(/no java runtime present/i)) {
return false;
}
const matchResult = stderr.match(/.*version "(.*)"/);
if (matchResult) {
const [, currentFullJavaVersion] = matchResult;
const javaMajorVersionPosition = currentFullJavaVersion.startsWith('1.') ? 1 : 0;
const javaMajorVersion = Number(currentFullJavaVersion.split('.')[javaMajorVersionPosition]);
if (javaMajorVersion !== JAVA_REQUIRED_VERSION) {
throw new Error(`You're on Java ${currentFullJavaVersion}, please install version ${JAVA_REQUIRED_VERSION}`);
}
}
else {
logger_1.default.warn(`Couldn't find Java version number, assuming you're on Java ${JAVA_REQUIRED_VERSION}...`);
}
return status === 0;
},
},
];
const LOGGER_FIELDS = { buildPhase: 'setting up environment' };
const l = logger_1.default.child(LOGGER_FIELDS);
async function setup(sdkVersion) {
await common_1.checkSystem(REQUIRED_TOOLS);
await prepareAndroidEnv();
if (sdkVersion) {
await common_1.ensureShellAppIsPresent(sdkVersion, { formatShellAppDirectory: workingdir_1.formatShellAppDirectory, formatShellAppTarballUriPath }, _shellAppPostDownloadAction);
}
}
exports.default = setup;
async function prepareAndroidEnv() {
await fs_extra_1.default.ensureDir(config_1.default.directories.androidDependenciesDir);
const sdkConfig = await sdk_1.default();
_setEnvVars(sdkConfig.envVars);
_alterPath(sdkConfig.path);
}
function formatShellAppTarballUriPath(sdkMajorVersion) {
return path_1.default.join(config_1.default.directories.shellTarballsDir, constants_1.PLATFORMS.ANDROID, `sdk${sdkMajorVersion}`);
}
async function _shellAppPostDownloadAction(sdkVersion, workingdir) {
const inWorkingdir = (filename) => path_1.default.join(workingdir, filename);
if (await fs_extra_1.default.pathExists(inWorkingdir('universe-package.json'))) {
// legacy shell app built from universe
await fs_extra_1.default.move(inWorkingdir('package.json'), inWorkingdir('exponent-package.json'));
await fs_extra_1.default.move(inWorkingdir('universe-package.json'), inWorkingdir('package.json'));
await _installNodeModules(workingdir);
await fs_extra_1.default.move(inWorkingdir('package.json'), inWorkingdir('universe-package.json'));
await fs_extra_1.default.move(inWorkingdir('exponent-package.json'), inWorkingdir('package.json'));
}
else {
// new shell app built from expo or not
await _installNodeModules(workingdir);
}
// TODO: remove this after making sure that we don't need node_modules in tools-public for older sdks
if (xdl_1.ExponentTools.parseSdkMajorVersion(sdkVersion) < 33) {
const toolsPublicDir = path_1.default.join(workingdir, 'tools-public');
await _installNodeModules(toolsPublicDir);
}
}
async function _installNodeModules(cwd) {
l.info(`installing dependencies in ${cwd} directory...`);
const command = await _shouldUseYarnOrNpm();
await xdl_1.ExponentTools.spawnAsyncThrowError(command, ['install'], {
pipeToLogger: true,
loggerFields: LOGGER_FIELDS,
cwd,
});
l.info('dependencies installed!');
}
async function _shouldUseYarnOrNpm() {
try {
await which('yarn');
return 'yarn';
}
catch (err) {
return 'npm';
}
}
function _setEnvVars(envVars) {
Object
.entries(envVars)
.forEach(([key, value]) => process.env[key] = value);
}
function _alterPath(newPaths) {
const currentPaths = process.env.PATH ? process.env.PATH.split(':') : [];
const paths = [...newPaths, ...currentPaths];
process.env.PATH = paths.join(':');
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/bin/setup/android/index.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,gDAAwB;AAExB,mCAA0C;AAC1C,wDAA0B;AAC1B,kDAA2B;AAE3B,gDAAqE;AACrE,4CAAqF;AAErF,2EAAmF;AACnF,6DAAmC;AACnC,kDAA6C;AAC7C,6DAAmC;AAEnC,MAAM,KAAK,GAAG,cAAI,CAAC,SAAS,CAAC,eAAM,CAAC,CAAC;AACrC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,cAAc,GAAsB;IACxC;QACE,OAAO,EAAE,MAAM;QACf,kBAAkB,EAAE,qBAAqB;KAC1C;IACD;QACE,OAAO,EAAE,OAAO;QAChB,kBAAkB,EAChB,sFAAsF;QACxF,MAAM,EAAE,KAAK,IAAI,EAAE;YACjB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,mBAAa,CAAC,oBAAoB,CACzE,MAAM,EACN,CAAC,UAAU,CAAC,EACZ,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;YACF,IAAI,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE;gBAC5C,OAAO,KAAK,CAAC;aACd;YAED,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACrD,IAAI,WAAW,EAAE;gBACf,MAAM,CAAC,EAAE,sBAAsB,CAAC,GAAG,WAAW,CAAC;gBAC/C,MAAM,wBAAwB,GAAG,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjF,MAAM,gBAAgB,GAAG,MAAM,CAAC,sBAAsB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC;gBAC7F,IAAI,gBAAgB,KAAK,qBA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AAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;AACpC,CAAC;AAED,KAAK,UAAU,mBAAmB;IAChC,IAAI;QACF,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC;KACf;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAED,SAAS,WAAW,CAAC,OAAe;IAClC,MAAM;SACH,OAAO,CAAC,OAAO,CAAC;SAChB,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,UAAU,CAAC,QAAkB;IACpC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,MAAM,KAAK,GAAG,CAAC,GAAG,QAAQ,EAAE,GAAG,YAAY,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import path from 'path';\nimport util from 'util';\n\nimport { ExponentTools } from '@expo/xdl';\nimport fs from 'fs-extra';\nimport _which from 'which';\n\nimport ensureAndroidSDKIsPresent from 'turtle/bin/setup/android/sdk';\nimport { checkSystem, ensureShellAppIsPresent } from 'turtle/bin/setup/utils/common';\nimport { IToolDefinition } from 'turtle/bin/setup/utils/toolsDetector';\nimport { formatShellAppDirectory } from 'turtle/builders/utils/android/workingdir';\nimport config from 'turtle/config';\nimport { PLATFORMS } from 'turtle/constants';\nimport logger from 'turtle/logger';\n\nconst which = util.promisify(_which);\nconst JAVA_REQUIRED_VERSION = 8;\nconst REQUIRED_TOOLS: IToolDefinition[] = [\n {\n command: 'bash',\n missingDescription: 'Please install bash',\n },\n {\n command: 'javac',\n missingDescription:\n `Please install JDK 8 - keep in mind that other versions are not supported by Android`,\n testFn: async () => {\n const { status, stdout, stderr } = await ExponentTools.spawnAsyncThrowError(\n 'java',\n ['-version'],\n { stdio: 'pipe' },\n Line truncated
-87
View File
@@ -1,87 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const os_1 = __importDefault(require("os"));
const path_1 = __importDefault(require("path"));
const xdl_1 = require("@expo/xdl");
const decompress_1 = __importDefault(require("decompress"));
const fs_extra_1 = __importDefault(require("fs-extra"));
const utils = __importStar(require("../utils/common"));
const downloader_1 = __importDefault(require("../utils/downloader"));
const config_1 = __importDefault(require("../../../config"));
const logger_1 = __importDefault(require("../../../logger"));
const ANDROID_SDK_URL = 'https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip';
const LOGGER_FIELDS = { buildPhase: 'setting up environment' };
const l = logger_1.default.child(LOGGER_FIELDS);
async function ensureAndroidSDKIsPresent() {
const androidSdkDir = path_1.default.join(config_1.default.directories.androidDependenciesDir, 'sdk');
await utils.removeDirectoryUnlessReady(androidSdkDir);
if (!(await fs_extra_1.default.pathExists(androidSdkDir))) {
await fs_extra_1.default.ensureDir(androidSdkDir);
const androidSdkDownloadPath = utils.formatArtifactDownloadPath(ANDROID_SDK_URL);
try {
l.info('Downloading Android SDK');
await fs_extra_1.default.ensureDir(config_1.default.directories.artifactsDir);
await downloader_1.default(ANDROID_SDK_URL, androidSdkDownloadPath);
await fs_extra_1.default.ensureDir(androidSdkDir);
l.info('Decompressing Android SDK');
await decompress_1.default(androidSdkDownloadPath, androidSdkDir);
await fs_extra_1.default.remove(androidSdkDownloadPath);
l.info('Configuring Android SDK, this may take a while');
await _configureSdk(androidSdkDir);
await utils.markDirectoryAsReady(androidSdkDir);
l.info('Android SDK installed and configured successfully');
}
catch (err) {
await fs_extra_1.default.remove(androidSdkDir);
throw err;
}
finally {
await fs_extra_1.default.remove(androidSdkDownloadPath);
}
}
return {
envVars: _createEnvVars(androidSdkDir),
path: _createPaths(androidSdkDir),
};
}
exports.default = ensureAndroidSDKIsPresent;
async function _configureSdk(androidSdkDir) {
// prevents warnings about missing repo config
const androidRepositoriesCfgPath = path_1.default.join(os_1.default.homedir(), '.android/repositories.cfg');
await fs_extra_1.default.ensureFile(androidRepositoriesCfgPath);
await xdl_1.ExponentTools.spawnAsyncThrowError('./configureAndroidSdk.sh', [], {
pipeToLogger: true,
loggerFields: LOGGER_FIELDS,
cwd: path_1.default.join(config_1.default.directories.rootDir, 'scripts/android'),
env: {
...process.env,
ANDROID_HOME: androidSdkDir,
ANDROID_SDK: androidSdkDir,
},
});
}
function _createEnvVars(androidSdkDir) {
return {
ANDROID_HOME: androidSdkDir,
ANDROID_SDK: androidSdkDir,
};
}
function _createPaths(androidSdkDir) {
return [
path_1.default.join(androidSdkDir, 'platform-tools'),
path_1.default.join(androidSdkDir, 'tools'),
path_1.default.join(androidSdkDir, 'tools/bin'),
path_1.default.join(androidSdkDir, 'build-tools/28.0.3'),
];
}
//# sourceMappingURL=sdk.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../../src/bin/setup/android/sdk.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,mCAA0C;AAC1C,4DAAoC;AACpC,wDAA0B;AAE1B,uDAAuD;AACvD,qEAAyD;AACzD,6DAAmC;AACnC,6DAAmC;AAEnC,MAAM,eAAe,GAAG,sEAAsE,CAAC;AAE/F,MAAM,aAAa,GAAG,EAAE,UAAU,EAAE,wBAAwB,EAAE,CAAC;AAC/D,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M,CAAC,sBAAsB,CAAC,CAAC;SACzC;KACF;IACD,OAAO;QACL,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC;QACtC,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC;KAClC,CAAC;AACJ,CAAC;AA9BD,4CA8BC;AAED,KAAK,UAAU,aAAa,CAAC,aAAqB;IAChD,8CAA8C;IAC9C,MAAM,0BAA0B,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,2BAA2B,CAAC,CAAC;IACxF,MAAM,kBAAE,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAChD,MAAM,mBAAa,CAAC,oBAAoB,CAAC,0BAA0B,EAAE,EAAE,EAAE;QACvE,YAAY,EAAE,IAAI;QAClB,YAAY,EAAE,aAAa;QAC3B,GAAG,EAAE,cAAI,CAAC,IAAI,CAAC,gBAAM,CAAC,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC;QAC7D,GAAG,EAAE;YACH,GAAG,OAAO,CAAC,GAAG;YACd,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,aAAa;SAC3B;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CAAC,aAAqB;IAC3C,OAAO;QACL,YAAY,EAAE,aAAa;QAC3B,WAAW,EAAE,aAAa;KAC3B,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,aAAqB;IACzC,OAAO;QACL,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC;QAC1C,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;QACjC,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;QACrC,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC;KAC/C,CAAC;AACJ,CAAC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { ExponentTools } from '@expo/xdl';\nimport decompress from 'decompress';\nimport fs from 'fs-extra';\n\nimport * as utils from 'turtle/bin/setup/utils/common';\nimport download from 'turtle/bin/setup/utils/downloader';\nimport config from 'turtle/config';\nimport logger from 'turtle/logger';\n\nconst ANDROID_SDK_URL = 'https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip';\n\nconst LOGGER_FIELDS = { buildPhase: 'setting up environment' };\nconst l = logger.child(LOGGER_FIELDS);\n\nexport default async function ensureAndroidSDKIsPresent() {\n const androidSdkDir = path.join(config.directories.androidDependenciesDir, 'sdk');\n await utils.removeDirectoryUnlessReady(androidSdkDir);\n if (!(await fs.pathExists(androidSdkDir))) {\n await fs.ensureDir(androidSdkDir);\n const androidSdkDownloadPath = utils.formatArtifactDownloadPath(ANDROID_SDK_URL);\n\n try {\n l.info('Downloading Android SDK');\n await fs.ensureDir(config.directories.artifactsDir);\n await download(ANDROID_SDK_URL, androidSdkDownloadPath);\n await fs.ensureDir(androidSdkDir);\n l.info('Decompressing Android SDK');\n await decompress(androidSdkDownloadPath, androidSdkDir);\n await fs.remove(androidSdkDownloadPath);\n l.info('Configuring Android SDK, this may take a while');\n await _configureSdk(androidSdkDir);\n await utils.markDirectoryAsReady(androidSdkDir);\n l.info('Android SDK installed and configured successfully');\n } catch (err) {\n await fs.remove(androidSdkDir);\n throw err;\n } finally {\n await fs.remove(androidSdkDownloadPath);\n }\n }\n return {\n envVars: _createEnvVars(androidSdkDir),\n path: _createPaths(androidSdkDir),\n };\n}\n\nasync function _configureSdk(androidSdkDir: string) {\n // prevents warnings about missing repo config\n const androidRepositoriesCfgPath = path.join(os.homedir(), '.android/repositories.cfg');\n await fs.ensureFile(androidRepositoriesCfgPath);\n await ExponentTools.spawnAsyncThrowError('./configureAndroidSdk.sh', [], {\n pipeToLogger: true,\n loggerFields: LOGGER_FIELDS,\n cwd: path.join(config.directories.rootDir, 'scripts/android'),\n env: {\n ...process.env,\n ANDROID_HOME: androidSdkDir,\n ANDROID_SDK: androidSdkDir,\n },\n });\n}\n\nfunction _createEnvVars(androidSdkDir: string) {\n return {\n ANDROID_HOME: androidSdkDir,\n ANDROID_SDK: androidSdkDir,\n };\n}\n\nfunction _createPaths(androidSdkDir: string) {\n return [\n path.join(androidSdkDir, 'platform-toLine truncated
-84
View File
@@ -1,84 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const last_1 = __importDefault(require("lodash/last"));
const trim_1 = __importDefault(require("lodash/trim"));
const path_1 = __importDefault(require("path"));
const semver_1 = __importDefault(require("semver"));
const xdl_1 = require("@expo/xdl");
const common_1 = require("./utils/common");
const workingdir_1 = require("../../builders/utils/ios/workingdir");
const config_1 = __importDefault(require("../../config"));
const constants_1 = require("../../constants");
const logger_1 = __importDefault(require("../../logger"));
const REQUIRED_TOOLS = [
{
command: 'bash',
missingDescription: 'Please install bash',
},
{
command: 'fastlane',
missingDescription: 'Please check https://docs.fastlane.tools/getting-started/ios/setup/',
versionCheckFn: async () => {
const MINIMAL_VERSION = '2.99.0';
const { stdout } = await xdl_1.ExponentTools.spawnAsyncThrowError('fastlane', ['--version'], { stdio: 'pipe', env: { ...process.env, FASTLANE_SKIP_UPDATE_CHECK: '1', LC_ALL: 'en_US.UTF-8' } });
const fastlaneVersion = parseFastlaneVersion(stdout);
if (fastlaneVersion && !semver_1.default.satisfies(fastlaneVersion, `>= ${MINIMAL_VERSION}`)) {
throw new Error(`Your fastlane is on version ${fastlaneVersion}. Please upgrade it to at least ${MINIMAL_VERSION}.`);
}
},
},
{
command: 'xcode',
missingDescription: 'Please ensure xcode is properly installed',
testFn: async () => {
const { status, stdout } = await xdl_1.ExponentTools.spawnAsyncThrowError('xcodebuild', ['-version'], { stdio: 'pipe' });
if (stdout.match(/requires xcode/i)) {
return false;
}
if (status !== 0) {
return false;
}
try {
await xdl_1.ExponentTools.spawnAsyncThrowError('ibtool', ['--version'], { stdio: 'pipe' });
}
catch (err) {
if (err.stderr) {
const stderr = err.stderr.trim();
if (stderr.match(/Agreeing to the Xcode\/iOS license/)) {
logger_1.default.error('You have not accepted the Xcode license. Run \'sudo xcodebuild -runFirstLaunch\' to do so.');
return false;
}
if (stderr.match(/The bundle is damaged or missing necessary resources/)) {
logger_1.default.error('Make sure to install additional required components. Run \'sudo xcodebuild -runFirstLaunch\' to do so.');
return false;
}
}
}
return true;
},
},
];
async function setup(sdkVersion) {
await common_1.checkSystem(REQUIRED_TOOLS);
if (sdkVersion) {
await common_1.ensureShellAppIsPresent(sdkVersion, {
formatShellAppDirectory: workingdir_1.formatShellAppDirectory,
formatShellAppTarballUriPath,
});
}
}
exports.default = setup;
function formatShellAppTarballUriPath(sdkMajorVersion) {
return path_1.default.join(config_1.default.directories.shellTarballsDir, constants_1.PLATFORMS.IOS, `sdk${sdkMajorVersion}`);
}
function parseFastlaneVersion(stdout) {
const lastLine = last_1.default(trim_1.default(stdout).split('\n'));
if (!lastLine) {
return null;
}
return last_1.default(lastLine.split(' ')) || null;
}
//# sourceMappingURL=ios.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../../src/bin/setup/ios.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+B;AAC/B,uDAA+B;AAC/B,gDAAwB;AACxB,oDAA4B;AAE5B,mCAA0C;AAE1C,2CAAqF;AAErF,oEAA+E;AAC/E,0DAAmC;AACnC,+CAA6C;AAC7C,0DAAmC;AAEnC,MAAM,cAAc,GAAsB;IACxC;QACE,OAAO,EAAE,MAAM;QACf,kBAAkB,EAAE,qBAAqB;KAC1C;IACD;QACE,OAAO,EAAE,UAAU;QACnB,kBAAkB,EAAE,qEAAqE;QACzF,cAAc,EAAE,KAAK,IAAI,EAAE;YACzB,MAAM,eAAe,GAAG,QAAQ,CAAC;YAEjC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,mBAAa,CAAC,oBAAoB,CACzD,UAAU,EACV,CAAC,WAAW,CAAC,EACb,EAAE,KAAK,EAAE,MAAM,EAAE,G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;wBACxE,gBAAM,CAAC,KAAK,CACV,wGAAwG,CACzG,CAAC;wBACF,OAAO,KAAK,CAAC;qBACd;iBACF;aACF;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF;CACF,CAAC;AAEa,KAAK,UAAU,KAAK,CAAC,UAAmB;IACrD,MAAM,oBAAW,CAAC,cAAc,CAAC,CAAC;IAClC,IAAI,UAAU,EAAE;QACd,MAAM,gCAAuB,CAAC,UAAU,EAAE;YACxC,uBAAuB,EAAvB,oCAAuB;YACvB,4BAA4B;SAC7B,CAAC,CAAC;KACJ;AACH,CAAC;AARD,wBAQC;AAED,SAAS,4BAA4B,CAAC,eAAuB;IAC3D,OAAO,cAAI,CAAC,IAAI,CAAC,gBAAM,CAAC,WAAW,CAAC,gBAAgB,EAAE,qBAAS,CAAC,GAAG,EAAE,MAAM,eAAe,EAAE,CAAC,CAAC;AAChG,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAc;IAC1C,MAAM,QAAQ,GAAG,cAAI,CAAC,cAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,IAAI,CAAC;KACb;IACD,OAAO,cAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;AAC3C,CAAC","sourcesContent":["import last from 'lodash/last';\nimport trim from 'lodash/trim';\nimport path from 'path';\nimport semver from 'semver';\n\nimport { ExponentTools } from '@expo/xdl';\n\nimport { checkSystem, ensureShellAppIsPresent } from 'turtle/bin/setup/utils/common';\nimport { IToolDefinition } from 'turtle/bin/setup/utils/toolsDetector';\nimport { formatShellAppDirectory } from 'turtle/builders/utils/ios/workingdir';\nimport config from 'turtle/config';\nimport { PLATFORMS } from 'turtle/constants';\nimport logger from 'turtle/logger';\n\nconst REQUIRED_TOOLS: IToolDefinition[] = [\n {\n command: 'bash',\n missingDescription: 'Please install bash',\n },\n {\n command: 'fastlane',\n missingDescription: 'Please check https://docs.fastlane.tools/getting-started/ios/setup/',\n versionCheckFn: async () => {\n const MINIMAL_VERSION = '2.99.0';\n\n const { stdout } = await ExponentTools.spawnAsyncThrowError(\n 'fastlane',\n ['--version'],\n { stdio: 'pipe', env: { ...process.env, FASTLANE_SKIP_UPDATE_CHECK: '1', LC_ALL: 'en_US.UTF-8' } },\n );\n const fastlaneVersion = parseFastlaneVersion(stdout);\n if (fastlaneVersion && !semver.satisfies(fastlaneVersion, `>= ${MINIMAL_VERSION}`)) {\n throw new Error(\n `Your fastlane is on version ${fastlaneVersion}. Please upgrade it to at least ${MINIMAL_VERSION}.`,\n );\n }\n },\n },\n {\n command: 'xcode',\n missingDescription: 'Please ensure xcode is properly installed',\n testFn: async () => {\n const { status, stdout } = await ExponentTools.spawnAsyncThrowError(\n 'xcodebuild',\n ['-version'],\n { stdio: 'pipe' },\n );\n if (stdout.match(/requires xcode/i)) {\n return false;\n }\n\n if (status !== 0) {\n return false;\n }\n\n try {\n await ExponentTools.spawnAsyncThrowError('ibtool', ['--version'], { stdio: 'pipe' });\n } catch (err) {\n if (err.stderr) {\n const stderr = err.stderr.trim();\n if (stderr.match(/Agreeing to the Xcode\\/iOS license/)) {\n logger.error('You have not accepted the Xcode license. Run \\'sudo xcodebuild -runFirstLaunch\\' to do so.');\n return false;\n }\n if (stderr.match(/The bundle is damaged or missing necessary resources/)) {\n logger.error(\n 'Make sure to install additional required components. Run \\'sudo xcodebuild -runFirstLaunch\\' to do so.',\n );\n return false;\n }\n }\n }\n\n return true;\n },\n },\n];\n\nexport dLine truncated
-25
View File
@@ -1,25 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const is_semver_1 = __importDefault(require("is-semver"));
const android_1 = __importDefault(require("./android"));
const ios_1 = __importDefault(require("./ios"));
const constants_1 = require("../../constants");
async function setup(platform, sdkVersion) {
if (sdkVersion && !is_semver_1.default(sdkVersion)) {
throw new Error('SDK version is not valid.');
}
if (platform === constants_1.PLATFORMS.IOS) {
return await ios_1.default(sdkVersion);
}
else if (platform === constants_1.PLATFORMS.ANDROID) {
return await android_1.default(sdkVersion);
}
else {
throw new Error('This should never happen :(');
}
}
exports.default = setup;
//# sourceMappingURL=setup.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/bin/setup/setup.ts"],"names":[],"mappings":";;;;;AAAA,0DAAiC;AAEjC,wDAAoD;AACpD,gDAA4C;AAC5C,+CAA6C;AAE9B,KAAK,UAAU,KAAK,CAAC,QAAgB,EAAE,UAAmB;IACvE,IAAI,UAAU,IAAI,CAAC,mBAAQ,CAAC,UAAU,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;KAC9C;IAED,IAAI,QAAQ,KAAK,qBAAS,CAAC,GAAG,EAAE;QAC9B,OAAO,MAAM,aAAQ,CAAC,UAAU,CAAC,CAAC;KACnC;SAAM,IAAI,QAAQ,KAAK,qBAAS,CAAC,OAAO,EAAE;QACzC,OAAO,MAAM,iBAAY,CAAC,UAAU,CAAC,CAAC;KACvC;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;AACH,CAAC;AAZD,wBAYC","sourcesContent":["import isSemver from 'is-semver';\n\nimport setupAndroid from 'turtle/bin/setup/android';\nimport setupIos from 'turtle/bin/setup/ios';\nimport { PLATFORMS } from 'turtle/constants';\n\nexport default async function setup(platform: string, sdkVersion?: string) {\n if (sdkVersion && !isSemver(sdkVersion)) {\n throw new Error('SDK version is not valid.');\n }\n\n if (platform === PLATFORMS.IOS) {\n return await setupIos(sdkVersion);\n } else if (platform === PLATFORMS.ANDROID) {\n return await setupAndroid(sdkVersion);\n } else {\n throw new Error('This should never happen :(');\n }\n}\n"]}
-89
View File
@@ -1,89 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const xdl_1 = require("@expo/xdl");
const fs_extra_1 = __importDefault(require("fs-extra"));
const tar_1 = __importDefault(require("tar"));
const downloader_1 = __importDefault(require("./downloader"));
const toolsDetector_1 = require("./toolsDetector");
const config_1 = __importDefault(require("../../../config"));
const logger_1 = __importDefault(require("../../../logger"));
const l = logger_1.default.child({ buildPhase: 'setting up environment' });
async function checkSystem(requiredTools) {
await toolsDetector_1.ensureToolsAreInstalled(requiredTools);
}
exports.checkSystem = checkSystem;
async function ensureShellAppIsPresent(sdkVersion, formatters, postDownloadAction) {
const workingdir = formatters.formatShellAppDirectory({ sdkVersion });
const shellAppMetadata = await _readShellAppTarballS3Uri(sdkVersion, formatters);
await removeDirectoryUnlessReady(workingdir, shellAppMetadata);
if (await fs_extra_1.default.pathExists(workingdir)) {
return;
}
l.info(`shell app for SDK ${sdkVersion} doesn't exist, downloading...`);
await _downloadShellApp(sdkVersion, workingdir, formatters);
if (postDownloadAction) {
await postDownloadAction(sdkVersion, workingdir);
}
await markDirectoryAsReady(workingdir, shellAppMetadata);
}
exports.ensureShellAppIsPresent = ensureShellAppIsPresent;
async function _downloadShellApp(sdkVersion, targetDirectory, formatters) {
const shellAppTarballS3Uri = await _readShellAppTarballS3Uri(sdkVersion, formatters);
const tarballDownloadTargetPath = formatArtifactDownloadPath(shellAppTarballS3Uri);
await fs_extra_1.default.ensureDir(config_1.default.directories.artifactsDir);
await downloader_1.default(shellAppTarballS3Uri, tarballDownloadTargetPath);
l.info('shell app has been downloaded');
await fs_extra_1.default.ensureDir(targetDirectory);
l.info('extracting shell app (this may take a while)...');
await tar_1.default.x({
file: tarballDownloadTargetPath,
C: targetDirectory,
});
l.info('shell app extracted');
}
function formatArtifactDownloadPath(uri) {
const { base } = path_1.default.parse(uri);
return path_1.default.join(config_1.default.directories.artifactsDir, base);
}
exports.formatArtifactDownloadPath = formatArtifactDownloadPath;
async function _readShellAppTarballS3Uri(sdkVersion, formatters) {
const sdkMajorVersion = xdl_1.ExponentTools.parseSdkMajorVersion(sdkVersion);
const filePath = formatters.formatShellAppTarballUriPath(sdkMajorVersion);
const data = await fs_extra_1.default.readFile(filePath, 'utf8');
return data.trim();
}
async function removeDirectoryUnlessReady(dir, metadata) {
const readyFilePath = path_1.default.join(dir, '.ready');
const readyFileExists = await fs_extra_1.default.pathExists(readyFilePath);
let shouldRemove = false;
if (readyFileExists) {
if (metadata !== undefined) {
const readyFileContents = (await fs_extra_1.default.readFile(readyFilePath, 'utf-8')).trim();
if (readyFileContents !== metadata) {
shouldRemove = true;
}
}
}
else {
shouldRemove = true;
}
if (shouldRemove) {
await fs_extra_1.default.remove(dir);
}
}
exports.removeDirectoryUnlessReady = removeDirectoryUnlessReady;
async function markDirectoryAsReady(dir, metadata) {
const readyFilePath = path_1.default.join(dir, '.ready');
if (metadata === undefined) {
await fs_extra_1.default.open(readyFilePath, 'w');
}
else {
await fs_extra_1.default.writeFile(readyFilePath, metadata);
}
}
exports.markDirectoryAsReady = markDirectoryAsReady;
//# sourceMappingURL=common.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/bin/setup/utils/common.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,mCAA0C;AAC1C,wDAA0B;AAC1B,8CAAsB;AAEtB,8DAAyD;AACzD,mDAAgG;AAEhG,6DAAmC;AACnC,6DAAmC;AAEnC,MAAM,CAAC,GAAG,gBAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAS1D,KAAK,UAAU,WAAW,CAAC,aAAgC;IAChE,MAAM,uCAAuB,CAAC,aAAa,CAAC,CAAC;AAC/C,CAAC;AAFD,kCAEC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,UAAkB,EAClB,UAA8B,EAC9B,kBAAuC;IA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CAAC;KACtB;AACH,CAAC;AAjBD,gEAiBC;AAEM,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,QAAiB;IACvE,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC/C,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC1B,MAAM,kBAAE,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;KACnC;SAAM;QACL,MAAM,kBAAE,CAAC,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;KAC7C;AACH,CAAC;AAPD,oDAOC","sourcesContent":["import path from 'path';\n\nimport { ExponentTools } from '@expo/xdl';\nimport fs from 'fs-extra';\nimport tar from 'tar';\n\nimport download from 'turtle/bin/setup/utils/downloader';\nimport { ensureToolsAreInstalled, IToolDefinition } from 'turtle/bin/setup/utils/toolsDetector';\nimport { IShellAppDirectoryConfig } from 'turtle/builders/utils/workingdir';\nimport config from 'turtle/config';\nimport logger from 'turtle/logger';\n\nconst l = logger.child({ buildPhase: 'setting up environment' });\n\ninterface IShellAppFormaters {\n formatShellAppDirectory: (config: IShellAppDirectoryConfig) => string;\n formatShellAppTarballUriPath: (sdkMajorVersion: string) => string;\n}\n\ntype PostDownloadAction = (sdkVersion: string, workingdir: string) => void;\n\nexport async function checkSystem(requiredTools: IToolDefinition[]) {\n await ensureToolsAreInstalled(requiredTools);\n}\n\nexport async function ensureShellAppIsPresent(\n sdkVersion: string,\n formatters: IShellAppFormaters,\n postDownloadAction?: PostDownloadAction,\n) {\n const workingdir = formatters.formatShellAppDirectory({ sdkVersion });\n const shellAppMetadata = await _readShellAppTarballS3Uri(sdkVersion, formatters);\n await removeDirectoryUnlessReady(workingdir, shellAppMetadata);\n if (await fs.pathExists(workingdir)) {\n return;\n }\n l.info(`shell app for SDK ${sdkVersion} doesn't exist, downloading...`);\n await _downloadShellApp(sdkVersion, workingdir, formatters);\n if (postDownloadAction) {\n await postDownloadAction(sdkVersion, workingdir);\n }\n await markDirectoryAsReady(workingdir, shellAppMetadata);\n}\n\nasync function _downloadShellApp(sdkVersion: string, targetDirectory: string, formatters: IShellAppFormaters) {\n const shellAppTarballS3Uri = await _readShellAppTarballS3Uri(sdkVersion, formatters);\n const tarballDownloadTargetPath = formatArtifactDownloadPath(shellAppTarballS3Uri);\n await fs.ensureDir(config.directories.artifactsDir);\n await download(shellAppTarballS3Uri, tarballDownloadTargetPath);\n l.info('shell app has been downloaded');\n await fs.ensureDir(targLine truncated
-49
View File
@@ -1,49 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const url_1 = require("url");
const progress_1 = __importDefault(require("progress"));
const request_1 = __importDefault(require("request"));
const request_progress_1 = __importDefault(require("request-progress"));
const S3_PROTOCOL = 's3:';
const PROGRESS_BAR_CONFIG = {
TEMPLATE: 'downloading [:bar] :percent :etas',
BAR: {
COMPLETE_CHAR: '=',
INCOMPLETE_CHAR: ' ',
WIDTH: 20,
},
};
async function download(url, destPath) {
const httpUrl = url.startsWith(S3_PROTOCOL) ? convertS3ToHttpsUrl(url) : url;
let bar;
return new Promise((res, rej) => {
request_progress_1.default(request_1.default(httpUrl))
.on('progress', (state) => {
if (!bar) {
bar = new progress_1.default(PROGRESS_BAR_CONFIG.TEMPLATE, {
complete: PROGRESS_BAR_CONFIG.BAR.COMPLETE_CHAR,
incomplete: PROGRESS_BAR_CONFIG.BAR.INCOMPLETE_CHAR,
width: PROGRESS_BAR_CONFIG.BAR.WIDTH,
total: state.size.total,
});
}
bar.tick(state.size.transferred - bar.curr);
})
.on('error', (err) => rej(err))
.on('end', () => res())
.pipe(fs_1.default.createWriteStream(destPath));
});
}
exports.default = download;
function convertS3ToHttpsUrl(s3UrlRaw) {
const { host: s3Bucket, pathname: s3Path, protocol } = new url_1.URL(s3UrlRaw);
if (protocol !== S3_PROTOCOL) {
throw new Error('Wrong S3 URL provided');
}
return `https://${s3Bucket}.s3.amazonaws.com${s3Path}`;
}
//# sourceMappingURL=downloader.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"downloader.js","sourceRoot":"","sources":["../../../../src/bin/setup/utils/downloader.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,6BAA0B;AAE1B,wDAAmC;AACnC,sDAA8B;AAC9B,wEAA+C;AAE/C,MAAM,WAAW,GAAG,KAAK,CAAC;AAC1B,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,mCAAmC;IAC7C,GAAG,EAAE;QACH,aAAa,EAAE,GAAG;QAClB,eAAe,EAAE,GAAG;QACpB,KAAK,EAAE,EAAE;KACV;CACF,CAAC;AAEa,KAAK,UAAU,QAAQ,CAAC,GAAW,EAAE,QAAgB;IAClE,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC7E,IAAI,GAAgB,CAAC;IAErB,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC9B,0BAAe,CAAC,iBAAO,CAAC,OAAO,CAAC,CAAC;aAC9B,EAAE,CAAC,UAAU,EAAE,CAAC,KAAU,EAAE,EAAE;YAC3B,IAAI,CAAC,GAAG,EAAE;gBACR,GAAG,GAAG,IAAI,kBAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE;oBAClD,QAAQ,EAAE,mBAAmB,CAAC,GAAG,CAAC,aAAa;oBAC/C,UAAU,EAAE,mBAAmB,CAAC,GAAG,CAAC,eAAe;oBACnD,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,KAAK;oBACpC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK;iBACxB,CAAC,CAAC;aACJ;YACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,GAAI,GAAW,CAAC,IAAI,CAAC,CAAC;QACzD,CAAC,CAAC;aACD,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACrC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;aACtB,IAAI,CAAC,YAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC;AArBD,2BAqBC;AAED,SAAS,mBAAmB,CAAC,QAAgB;IAC3C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,SAAG,CAAC,QAAQ,CAAC,CAAC;IACzE,IAAI,QAAQ,KAAK,WAAW,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAC1C;IACD,OAAO,WAAW,QAAQ,oBAAoB,MAAM,EAAE,CAAC;AACzD,CAAC","sourcesContent":["import fs from 'fs';\nimport { URL } from 'url';\n\nimport ProgressBar from 'progress';\nimport request from 'request';\nimport requestProgress from 'request-progress';\n\nconst S3_PROTOCOL = 's3:';\nconst PROGRESS_BAR_CONFIG = {\n TEMPLATE: 'downloading [:bar] :percent :etas',\n BAR: {\n COMPLETE_CHAR: '=',\n INCOMPLETE_CHAR: ' ',\n WIDTH: 20,\n },\n};\n\nexport default async function download(url: string, destPath: string) {\n const httpUrl = url.startsWith(S3_PROTOCOL) ? convertS3ToHttpsUrl(url) : url;\n let bar: ProgressBar;\n\n return new Promise((res, rej) => {\n requestProgress(request(httpUrl))\n .on('progress', (state: any) => {\n if (!bar) {\n bar = new ProgressBar(PROGRESS_BAR_CONFIG.TEMPLATE, {\n complete: PROGRESS_BAR_CONFIG.BAR.COMPLETE_CHAR,\n incomplete: PROGRESS_BAR_CONFIG.BAR.INCOMPLETE_CHAR,\n width: PROGRESS_BAR_CONFIG.BAR.WIDTH,\n total: state.size.total,\n });\n }\n bar.tick(state.size.transferred - (bar as any).curr);\n })\n .on('error', (err: Error) => rej(err))\n .on('end', () => res())\n .pipe(fs.createWriteStream(destPath));\n });\n}\n\nfunction convertS3ToHttpsUrl(s3UrlRaw: string) {\n const { host: s3Bucket, pathname: s3Path, protocol } = new URL(s3UrlRaw);\n if (protocol !== S3_PROTOCOL) {\n throw new Error('Wrong S3 URL provided');\n }\n return `https://${s3Bucket}.s3.amazonaws.com${s3Path}`;\n}\n"]}
-46
View File
@@ -1,46 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = __importDefault(require("util"));
const which_1 = __importDefault(require("which"));
const logger_1 = __importDefault(require("../../../logger"));
const which = util_1.default.promisify(which_1.default);
const l = logger_1.default.child({ buildPhase: 'setting up environment' });
async function ensureToolsAreInstalled(tools) {
let isAnyToolMissing = false;
for (const { command, missingDescription, testFn, versionCheckFn } of tools) {
try {
if (testFn) {
if (!await testFn()) {
throw new Error('Required tool is not properly installed');
}
}
else {
await which(command);
}
}
catch (err) {
isAnyToolMissing = true;
if (!testFn) {
l.error({ err }, `${command} is missing in your $PATH`);
}
l.error({ err }, missingDescription);
}
if (versionCheckFn) {
try {
await versionCheckFn();
}
catch (err) {
isAnyToolMissing = true;
l.error({ err }, `wrong version of ${command} installed`);
}
}
}
if (isAnyToolMissing) {
throw new Error('Tools required to perform standalone app build are missing. Please install them.');
}
}
exports.ensureToolsAreInstalled = ensureToolsAreInstalled;
//# sourceMappingURL=toolsDetector.js.map
@@ -1 +0,0 @@
{"version":3,"file":"toolsDetector.js","sourceRoot":"","sources":["../../../../src/bin/setup/utils/toolsDetector.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,kDAA2B;AAE3B,6DAAmC;AAEnC,MAAM,KAAK,GAAG,cAAI,CAAC,SAAS,CAAC,eAAM,CAAC,CAAC;AACrC,MAAM,CAAC,GAAG,gBAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAS1D,KAAK,UAAU,uBAAuB,CAAC,KAAwB;IACpE,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,KAAK,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,KAAK,EAAE;QAC3E,IAAI;YACF,IAAI,MAAM,EAAE;gBACV,IAAI,CAAC,MAAM,MAAM,EAAE,EAAE;oBACnB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;iBAC5D;aACF;iBAAM;gBACL,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;aACtB;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,gBAAgB,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,MAAM,EAAE;gBACX,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,OAAO,2BAA2B,CAAC,CAAC;aACzD;YACD,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC;SACtC;QACD,IAAI,cAAc,EAAE;YAClB,IAAI;gBACF,MAAM,cAAc,EAAE,CAAC;aACxB;YAAC,OAAO,GAAG,EAAE;gBACZ,gBAAgB,GAAG,IAAI,CAAC;gBACxB,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,OAAO,YAAY,CAAC,CAAC;aAC3D;SACF;KACF;IACD,IAAI,gBAAgB,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;KACrG;AACH,CAAC;AA9BD,0DA8BC","sourcesContent":["import util from 'util';\nimport _which from 'which';\n\nimport logger from 'turtle/logger';\n\nconst which = util.promisify(_which);\nconst l = logger.child({ buildPhase: 'setting up environment' });\n\nexport interface IToolDefinition {\n command: string;\n missingDescription: string;\n testFn?: () => Promise<boolean>;\n versionCheckFn?: () => void;\n}\n\nexport async function ensureToolsAreInstalled(tools: IToolDefinition[]) {\n let isAnyToolMissing = false;\n for (const { command, missingDescription, testFn, versionCheckFn } of tools) {\n try {\n if (testFn) {\n if (!await testFn()) {\n throw new Error('Required tool is not properly installed');\n }\n } else {\n await which(command);\n }\n } catch (err) {\n isAnyToolMissing = true;\n if (!testFn) {\n l.error({ err }, `${command} is missing in your $PATH`);\n }\n l.error({ err }, missingDescription);\n }\n if (versionCheckFn) {\n try {\n await versionCheckFn();\n } catch (err) {\n isAnyToolMissing = true;\n l.error({ err }, `wrong version of ${command} installed`);\n }\n }\n }\n if (isAnyToolMissing) {\n throw new Error('Tools required to perform standalone app build are missing. Please install them.');\n }\n}\n"]}
-123
View File
@@ -1,123 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const url_1 = __importDefault(require("url"));
const xdl_1 = require("@expo/xdl");
const lodash_1 = __importDefault(require("lodash"));
const uuid_1 = __importDefault(require("uuid"));
const ErrorWithCommandHelp_1 = require("../commands/ErrorWithCommandHelp");
const ErrorWithProgramHelp_1 = require("../commands/ErrorWithProgramHelp");
const setup_1 = __importDefault(require("../setup/setup"));
const ProjectUtils = __importStar(require("./project"));
const UserUtils = __importStar(require("./user"));
const common_1 = require("../../builders/utils/common");
const logger_1 = __importDefault(require("../../logger"));
const validator_1 = require("../../validator");
function createBuilderAction({ program, command, prepareCredentials, builder, platform, os, }) {
return async (projectDirArg, cmd) => {
try {
const osList = [];
if (Array.isArray(os)) {
osList.push(...os);
}
else {
osList.push(os);
}
if (osList.length && !osList.includes(process.platform)) {
throw new Error('We don\'t support running standalone app builds for this platform on your operating system');
}
if (cmd.buildDir && cmd.output) {
throw new ErrorWithCommandHelp_1.ErrorWithCommandHelp('You can\'t provide both --build-dir and --output parameters, please choose one');
}
const userData = {
username: cmd.username || process.env.EXPO_USERNAME,
password: cmd.password || process.env.EXPO_PASSWORD,
};
if (userData.username || userData.password) {
if (userData.username && userData.password) {
await UserUtils.ensureUserLoggedIn(userData);
}
else {
throw new ErrorWithCommandHelp_1.ErrorWithCommandHelp('You must provide both Expo username and password');
}
}
else if (!cmd.publicUrl) {
throw new ErrorWithCommandHelp_1.ErrorWithCommandHelp('You must provide your Expo username and password unless you specify --public-url to your project manifest.');
}
if (cmd.publicUrl) {
const parsedPublicUrl = url_1.default.parse(cmd.publicUrl);
if (parsedPublicUrl.protocol !== 'https:') {
throw new ErrorWithCommandHelp_1.ErrorWithCommandHelp('--public-url is invalid - only HTTPS urls are supported');
}
}
const args = {
releaseChannel: cmd.releaseChannel || 'default',
buildType: cmd.type,
buildMode: cmd.mode,
username: userData.username || 'anonymous',
projectDir: ProjectUtils.resolveAbsoluteDir(projectDirArg),
publicUrl: cmd.publicUrl,
};
const appJSON = await ProjectUtils.loadAppJSON(projectDirArg, cmd.config);
const sdkVersion = lodash_1.default.get(appJSON, 'expo.sdkVersion');
await setup_1.default(platform, sdkVersion);
const credentials = await prepareCredentials(cmd);
const rawJob = {
...await buildJobObject(platform, appJSON, args, credentials),
...cmd.buildDir && { fakeUploadDir: ProjectUtils.resolveAbsoluteDir(cmd.buildDir) },
...cmd.output && { fakeUploadBuildPath: ProjectUtils.resolveAbsoluteDir(cmd.output) },
};
const job = await validator_1.sanitizeJob(rawJob);
await builder(job);
}
catch (err) {
logger_1.default.error({ err }, 'Failed to build standalone app');
if (err instanceof ErrorWithCommandHelp_1.ErrorWithCommandHelp) {
command.help();
}
else if (err instanceof ErrorWithProgramHelp_1.ErrorWithProgramHelp) {
program.help();
}
process.exit(1);
}
};
}
exports.createBuilderAction = createBuilderAction;
const buildJobObject = async (platform, appJSON, { releaseChannel, buildType, buildMode, username, publicUrl, projectDir }, credentials) => {
const experienceName = `@${lodash_1.default.get(appJSON, 'expo.owner', username)}/${lodash_1.default.get(appJSON, 'expo.slug')}`;
const job = {
config: {
...lodash_1.default.get(appJSON, `expo.${platform}.config`, {}),
buildType,
...(platform === 'android' ? { buildMode } : {}),
releaseChannel,
...(platform === 'ios' ? { bundleIdentifier: lodash_1.default.get(appJSON, 'expo.ios.bundleIdentifier') } : {}),
...(platform === 'android' ? { androidPackage: lodash_1.default.get(appJSON, 'expo.android.package') } : {}),
publicUrl,
},
id: uuid_1.default.v4(),
platform,
projectDir,
sdkVersion: lodash_1.default.get(appJSON, 'expo.sdkVersion'),
experienceName,
...(credentials && { credentials }),
};
const url = common_1.getExperienceUrl(job.experienceName, job.config.publicUrl);
const manifest = await xdl_1.ExponentTools.getManifestAsync(url, {
'Exponent-SDK-Version': lodash_1.default.get(appJSON, 'expo.sdkVersion'),
'Exponent-Platform': platform,
'Expo-Release-Channel': releaseChannel,
'Accept': 'application/expo+json,application/json',
});
return { ...job, manifest };
};
//# sourceMappingURL=builder.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../src/bin/utils/builder.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAuB;AAEvB,mCAA0C;AAC1C,oDAAuB;AACvB,gDAAwB;AAExB,2EAAgF;AAChF,2EAAgF;AAChF,2DAA2C;AAC3C,wDAAyD;AACzD,kDAAmD;AACnD,wDAAgE;AAChE,0DAAmC;AACnC,+CAA+C;AAE/C,SAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,OAAO,EACP,QAAQ,EACR,EAAE,GACE;IACJ,OAAO,KAAK,EAAE,aAAqB,EAAE,GAAQ,EAAE,EAAE;QAC/C,IAAI;YACF,MAAM,MAAM,GAAG,EAAE,CAAC;YAClB,IAAI,KAAK,CA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iBAAiB,CAAC;QAC7C,cAAc;QACd,GAAG,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,CAAC;KACpC,CAAC;IACF,MAAM,GAAG,GAAG,yBAAgB,CAAC,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAEvE,MAAM,QAAQ,GAAG,MAAM,mBAAa,CAAC,gBAAgB,CAAC,GAAG,EAAE;QACzD,sBAAsB,EAAE,gBAAC,CAAC,GAAG,CAAC,OAAO,EAAE,iBAAiB,CAAC;QACzD,mBAAmB,EAAE,QAAQ;QAC7B,sBAAsB,EAAE,cAAc;QACtC,QAAQ,EAAE,wCAAwC;KACnD,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["import _url from 'url';\n\nimport { ExponentTools } from '@expo/xdl';\nimport _ from 'lodash';\nimport uuid from 'uuid';\n\nimport { ErrorWithCommandHelp } from 'turtle/bin/commands/ErrorWithCommandHelp';\nimport { ErrorWithProgramHelp } from 'turtle/bin/commands/ErrorWithProgramHelp';\nimport setup from 'turtle/bin/setup/setup';\nimport * as ProjectUtils from 'turtle/bin/utils/project';\nimport * as UserUtils from 'turtle/bin/utils/user';\nimport { getExperienceUrl } from 'turtle/builders/utils/common';\nimport logger from 'turtle/logger';\nimport { sanitizeJob } from 'turtle/validator';\n\nexport function createBuilderAction({\n program,\n command,\n prepareCredentials,\n builder,\n platform,\n os,\n}: any) {\n return async (projectDirArg: string, cmd: any) => {\n try {\n const osList = [];\n if (Array.isArray(os)) {\n osList.push(...os);\n } else {\n osList.push(os);\n }\n if (osList.length && !osLiLine truncated
-35
View File
@@ -1,35 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
const path_1 = __importDefault(require("path"));
async function loadAppJSON(projectDirArg, config) {
let appJSONPath;
if (config) {
appJSONPath = exports.resolveAbsoluteDir(config);
}
else {
const projectDir = exports.resolveAbsoluteDir(projectDirArg);
appJSONPath = path_1.default.join(projectDir, 'app.json');
}
const appJSONExists = await fs_extra_1.default.pathExists(appJSONPath);
if (!appJSONExists) {
throw new Error(`Couldn't find app.json.`);
}
else {
return require(appJSONPath);
}
}
exports.loadAppJSON = loadAppJSON;
exports.resolveAbsoluteDir = (dir) => {
if (dir && path_1.default.isAbsolute(dir)) {
return dir;
}
else {
const cwd = process.env.INIT_CWD || process.cwd();
return dir ? path_1.default.join(cwd, dir) : cwd;
}
};
//# sourceMappingURL=project.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../src/bin/utils/project.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0B;AAC1B,gDAAwB;AAEjB,KAAK,UAAU,WAAW,CAAC,aAAqB,EAAE,MAAqB;IAC5E,IAAI,WAAW,CAAC;IAChB,IAAI,MAAM,EAAE;QACV,WAAW,GAAG,0BAAkB,CAAC,MAAM,CAAC,CAAC;KAC1C;SAAM;QACL,MAAM,UAAU,GAAG,0BAAkB,CAAC,aAAa,CAAC,CAAC;QACrD,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;KACjD;IACD,MAAM,aAAa,GAAG,MAAM,kBAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,CAAC,aAAa,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAC5C;SAAM;QACL,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC;KAC7B;AACH,CAAC;AAdD,kCAcC;AAEY,QAAA,kBAAkB,GAAG,CAAC,GAAW,EAAE,EAAE;IAChD,IAAI,GAAG,IAAI,cAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC/B,OAAO,GAAG,CAAC;KACZ;SAAM;QACL,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClD,OAAO,GAAG,CAAC,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;KACxC;AACH,CAAC,CAAC","sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\n\nexport async function loadAppJSON(projectDirArg: string, config: string | null) {\n let appJSONPath;\n if (config) {\n appJSONPath = resolveAbsoluteDir(config);\n } else {\n const projectDir = resolveAbsoluteDir(projectDirArg);\n appJSONPath = path.join(projectDir, 'app.json');\n }\n const appJSONExists = await fs.pathExists(appJSONPath);\n if (!appJSONExists) {\n throw new Error(`Couldn't find app.json.`);\n } else {\n return require(appJSONPath);\n }\n}\n\nexport const resolveAbsoluteDir = (dir: string) => {\n if (dir && path.isAbsolute(dir)) {\n return dir;\n } else {\n const cwd = process.env.INIT_CWD || process.cwd();\n return dir ? path.join(cwd, dir) : cwd;\n }\n};\n"]}
-23
View File
@@ -1,23 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const xdl_1 = require("@expo/xdl");
const ErrorWithProgramHelp_1 = require("../commands/ErrorWithProgramHelp");
async function ensureUserLoggedIn(userData) {
const currentUser = await xdl_1.UserManager.getCurrentUserAsync();
if (currentUser) {
return currentUser;
}
else if (!userData.username || !userData.password) {
throw new ErrorWithProgramHelp_1.ErrorWithProgramHelp('Please provide username and password');
}
else {
try {
return await xdl_1.UserManager.loginAsync('user-pass', userData);
}
catch (err) {
throw new Error('Failed to log in with provided username and password');
}
}
}
exports.ensureUserLoggedIn = ensureUserLoggedIn;
//# sourceMappingURL=user.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/bin/utils/user.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,2EAAgF;AAOzE,KAAK,UAAU,kBAAkB,CAAC,QAAmB;IAC1D,MAAM,WAAW,GAAG,MAAM,iBAAW,CAAC,mBAAmB,EAAE,CAAC;IAC5D,IAAI,WAAW,EAAE;QACf,OAAO,WAAW,CAAC;KACpB;SAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;QACnD,MAAM,IAAI,2CAAoB,CAAC,sCAAsC,CAAC,CAAC;KACxE;SAAM;QACL,IAAI;YACF,OAAO,MAAM,iBAAW,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;SAC5D;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;SACzE;KACF;AACH,CAAC;AAbD,gDAaC","sourcesContent":["import { UserManager } from '@expo/xdl';\n\nimport { ErrorWithProgramHelp } from 'turtle/bin/commands/ErrorWithProgramHelp';\n\ninterface IUserData {\n username?: string;\n password?: string;\n}\n\nexport async function ensureUserLoggedIn(userData: IUserData) {\n const currentUser = await UserManager.getCurrentUserAsync();\n if (currentUser) {\n return currentUser;\n } else if (!userData.username || !userData.password) {\n throw new ErrorWithProgramHelp('Please provide username and password');\n } else {\n try {\n return await UserManager.loginAsync('user-pass', userData);\n } catch (err) {\n throw new Error('Failed to log in with provided username and password');\n }\n }\n}\n"]}
-17
View File
@@ -1,17 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class BuildError extends Error {
constructor(reason, message) {
super(message);
this.name = 'BuildError';
this.reason = reason;
}
}
var BuildErrorReason;
(function (BuildErrorReason) {
BuildErrorReason["SESSION_EXPIRED"] = "session-expired";
BuildErrorReason["PROVISIONING_PROFILE_MISSING"] = "provisioning-profile-missing";
})(BuildErrorReason || (BuildErrorReason = {}));
exports.BuildErrorReason = BuildErrorReason;
exports.default = BuildError;
//# sourceMappingURL=BuildError.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"BuildError.js","sourceRoot":"","sources":["../../src/builders/BuildError.ts"],"names":[],"mappings":";;AAAA,MAAM,UAAW,SAAQ,KAAK;IAG5B,YAAY,MAAwB,EAAE,OAAe;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED,IAAK,gBAGJ;AAHD,WAAK,gBAAgB;IACnB,uDAAmC,CAAA;IACnC,iFAA6D,CAAA;AAC/D,CAAC,EAHI,gBAAgB,KAAhB,gBAAgB,QAGpB;AAGQ,4CAAgB;AADzB,kBAAe,UAAU,CAAC","sourcesContent":["class BuildError extends Error {\n public reason: BuildErrorReason;\n\n constructor(reason: BuildErrorReason, message: string) {\n super(message);\n this.name = 'BuildError';\n this.reason = reason;\n }\n}\n\nenum BuildErrorReason {\n SESSION_EXPIRED = 'session-expired',\n PROVISIONING_PROFILE_MISSING = 'provisioning-profile-missing',\n}\n\nexport default BuildError;\nexport { BuildErrorReason };\n"]}
-108
View File
@@ -1,108 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const xdl_1 = require("@expo/xdl");
const fs_extra_1 = __importDefault(require("fs-extra"));
const lodash_1 = __importDefault(require("lodash"));
const semver_1 = __importDefault(require("semver"));
const constants_1 = require("../constants");
const v4_1 = __importDefault(require("uuid/v4"));
const credentials_1 = __importDefault(require("./utils/android/credentials"));
const workingdir_1 = require("./utils/android/workingdir");
const commonUtils = __importStar(require("./utils/common"));
const imageHelpers = __importStar(require("./utils/image"));
const unimodules_1 = require("./utils/unimodules");
const uploader_1 = require("./utils/uploader");
const version_1 = require("./utils/version");
const config_1 = __importDefault(require("../config"));
const logger_1 = __importDefault(require("../logger"));
async function buildAndroid(jobData) {
await version_1.ensureCanBuildSdkVersion(jobData);
const credentials = await credentials_1.default(jobData);
const outputFilePath = await runShellAppBuilder(jobData, credentials);
const randomHex = v4_1.default().replace(/-/g, '');
const s3FileExtension = jobData.config.buildType === constants_1.ANDROID_BUILD_TYPES.APP_BUNDLE ? 'aab' : 'apk';
const s3Filename = `${jobData.experienceName}-${randomHex}-signed.${s3FileExtension}`;
const s3FileKey = `android/${s3Filename}`;
const fakeUploadFilename = s3Filename.replace('/', '__');
const artifactUrl = await uploader_1.uploadBuildToS3({
uploadPath: outputFilePath,
s3FileKey,
...config_1.default.builder.fakeUpload && {
fakeUploadBuildPath: jobData.fakeUploadBuildPath
? jobData.fakeUploadBuildPath
: path_1.default.join(jobData.fakeUploadDir || config_1.default.directories.fakeUploadDir, fakeUploadFilename),
},
});
return { artifactUrl };
}
exports.default = buildAndroid;
async function runShellAppBuilder(jobData, credentials) {
const { temporaryFilesRoot } = config_1.default.directories;
await fs_extra_1.default.ensureDir(temporaryFilesRoot);
const tempShellAppConfigPath = path_1.default.join(temporaryFilesRoot, `app-config-${jobData.id}.json`);
const tempKeystorePath = path_1.default.join(temporaryFilesRoot, `keystore-${jobData.id}.jks`);
const configJSON = JSON.stringify(jobData.config);
await fs_extra_1.default.writeFile(tempShellAppConfigPath, configJSON, { mode: 0o644 });
await fs_extra_1.default.writeFile(tempKeystorePath, Buffer.from(credentials.keystore, 'base64'), {
mode: 0o600,
});
logger_1.default.info({ buildPhase: 'starting builder' }, 'Starting build process');
logger_1.default.info({ buildPhase: 'icons setup' }, 'ImageUtils: setting image functions to alternative sharp implementations');
xdl_1.ImageUtils.setResizeImageFunction(imageHelpers.resizeIconWithSharpAsync);
xdl_1.ImageUtils.setGetImageDimensionsFunction(imageHelpers.getImageDimensionsWithSharpAsync);
const fileExtension = jobData.config.buildType === constants_1.ANDROID_BUILD_TYPES.APP_BUNDLE ? 'aab' : 'apk';
const outputFilePath = path_1.default.join(temporaryFilesRoot, `shell-signed-${jobData.id}.${fileExtension}`);
const { config: jobConfig, manifest, sdkVersion: sdkVersionFromJob } = jobData;
const sdkVersion = lodash_1.default.get(manifest, 'sdkVersion', sdkVersionFromJob);
const workingDir = workingdir_1.formatShellAppDirectory({ sdkVersion });
// (2019-07-31) We are explicitly choosing to disable this option until we have more
// infrastructure/tooling built around optional modules and OTA updates, as right now it's
// very easy for developers to break apps in production with optional modules.
//
// to enable full resolver switch resolveExplicitOptIn to resolveNativeModules
logger_1.default.info({ buildPhase: 'resolve native modules' }, 'Resolving universal modules dependencies');
const enabledModules = semver_1.default.satisfies(sdkVersion, '>= 33.0.0')
? await unimodules_1.resolveExplicitOptIn(workingDir, lodash_1.default.get(manifest, 'dependencies'))
: null;
try {
await xdl_1.AndroidShellApp.createAndroidShellAppAsync({
url: commonUtils.getExperienceUrl(jobData.experienceName, jobData.config.publicUrl),
sdkVersion,
keystore: tempKeystorePath,
manifest,
alias: credentials.keystoreAlias,
keystorePassword: credentials.keystorePassword,
keyPassword: credentials.keyPassword,
privateConfigFile: tempShellAppConfigPath,
releaseChannel: jobConfig.releaseChannel,
workingDir,
outputFile: outputFilePath,
modules: enabledModules,
buildType: jobData.config.buildType,
buildMode: jobData.config.buildMode,
});
}
catch (err) {
commonUtils.logErrorOnce(err);
throw err;
}
finally {
if (!config_1.default.builder.skipCleanup) {
await fs_extra_1.default.unlink(tempShellAppConfigPath);
await fs_extra_1.default.unlink(tempKeystorePath);
}
}
return outputFilePath;
}
//# sourceMappingURL=android.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAwB;AAExB,mCAAwD;AACxD,wDAA0B;AAC1B,oDAAuB;AACvB,oDAA4B;AAC5B,4CAAuD;AACvD,iDAA6B;AAE7B,8EAA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,CAAC;KACJ;IAAC,OAAO,GAAG,EAAE;QACZ,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,GAAG,CAAC;KACX;YAAS;QACR,IAAI,CAAC,gBAAM,CAAC,OAAO,CAAC,WAAW,EAAE;YAC/B,MAAM,kBAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;YACxC,MAAM,kBAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;SACnC;KACF;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import path from 'path';\n\nimport { AndroidShellApp, ImageUtils } from '@expo/xdl';\nimport fs from 'fs-extra';\nimport _ from 'lodash';\nimport semver from 'semver';\nimport { ANDROID_BUILD_TYPES } from 'turtle/constants';\nimport uuidv4 from 'uuid/v4';\n\nimport getOrCreateCredentials from 'turtle/builders/utils/android/credentials';\nimport { formatShellAppDirectory } from 'turtle/builders/utils/android/workingdir';\nimport * as commonUtils from 'turtle/builders/utils/common';\nimport * as imageHelpers from 'turtle/builders/utils/image';\nimport { resolveExplicitOptIn } from 'turtle/builders/utils/unimodules';\nimport { uploadBuildToS3 } from 'turtle/builders/utils/uploader';\nimport { ensureCanBuildSdkVersion } from 'turtle/builders/utils/version';\nimport config from 'turtle/config';\nimport { IAndroidCredentials, IJob, IJobResult } from 'turtle/job';\nimport logger from 'turtle/logger';\n\nexport default async function buildAndroid(jobData: IJob): Promise<IJobResult> {\n await ensureCanBuildSdkVersion(jobData);\n const credentials = await getOrCreateCredentials(jobData);\n const outputFilePath = await runShellAppBuilder(jobData, credentials);\n\n const randomHex = uuidv4().replace(/-/g, '');\n const s3FileExtension = jobData.config.buildType === ANDROID_BUILD_TYPES.APP_BUNDLE ? 'aab' : 'apk';\n const s3Filename = `${jobLine truncated
-12
View File
@@ -1,12 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const android_1 = __importDefault(require("./android"));
const ios_1 = __importDefault(require("./ios"));
exports.default = {
ios: ios_1.default,
android: android_1.default,
};
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/builders/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAqC;AACrC,gDAA6B;AAE7B,kBAAe;IACb,GAAG,EAAE,aAAQ;IACb,OAAO,EAAE,iBAAY;CACtB,CAAC","sourcesContent":["import buildAndroid from './android';\nimport buildIOS from './ios';\n\nexport default {\n ios: buildIOS,\n android: buildAndroid,\n};\n"]}
-64
View File
@@ -1,64 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const xdl_1 = require("@expo/xdl");
const lodash_1 = __importDefault(require("lodash"));
const common_1 = require("../utils/common");
const fileUtils = __importStar(require("../utils/file"));
const keychain = __importStar(require("../utils/ios/keychain"));
const shellAppBuilder_1 = __importDefault(require("../utils/ios/shellAppBuilder"));
const index_1 = __importDefault(require("../../logger/index"));
async function buildArchive(ctx, job) {
let keychainInfo;
try {
keychainInfo = await keychain.create(ctx);
const { credentials } = job;
const { certP12, certPassword } = credentials;
await keychain.importCert(ctx, { keychainPath: keychainInfo.path, certP12, certPassword });
const manifest = await shellAppBuilder_1.default(ctx, job);
await buildAndSignIPA(ctx, job, keychainInfo.path, manifest);
}
catch (err) {
common_1.logErrorOnce(err);
throw err;
}
finally {
if (keychainInfo) {
await keychain.remove(ctx, keychainInfo.path);
}
}
}
exports.default = buildArchive;
async function buildAndSignIPA(ctx, job, keychainPath, manifest) {
const l = index_1.default.child({ buildPhase: 'building and signing IPA' });
l.info('building and signing IPA');
const { credentials: { provisioningProfile, certPassword, teamId }, config: { bundleIdentifier: bundleIdentifierFromConfig }, } = job;
const bundleIdentifierFromManifest = lodash_1.default.get(manifest, 'ios.bundleIdentifier');
const bundleIdentifier = bundleIdentifierFromConfig || bundleIdentifierFromManifest;
const { provisioningProfilePath } = ctx;
await fileUtils.writeBase64ToBinaryFile(provisioningProfilePath, provisioningProfile);
l.info('saved provisioning profile to temporary path');
const ipaBuilder = xdl_1.IosIPABuilder({
keychainPath,
provisioningProfilePath,
appUUID: ctx.appUUID,
certPath: ctx.tempCertPath,
certPassword,
teamID: teamId,
bundleIdentifier,
workspacePath: ctx.workspacePath,
manifest,
});
await ipaBuilder.build();
l.info(`done building and signing IPA`);
}
//# sourceMappingURL=archive.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../../src/builders/ios/archive.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAA8D;AAC9D,oDAAuB;AAGvB,4CAA4D;AAC5D,yDAAwD;AACxD,gEAA+D;AAC/D,mFAA2E;AAE3E,+DAAyC;AAE1B,KAAK,UAAU,YAAY,CAAC,GAAa,EAAE,GAAS;IACjE,IAAI,YAAY,CAAC;IACjB,IAAI;QACF,YAAY,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;QAC5B,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,WAAwD,CAAC;QAC3F,MAAM,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;QAC3F,MAAM,QAAQ,GAAG,MAAM,yBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,MAAM,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,CAAC,IAAI,E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C,KAAK,EAAE,CAAC;IAEzB,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { IosIPABuilder as createIPABuilder } from '@expo/xdl';\nimport _ from 'lodash';\n\nimport { IContext } from 'turtle/builders/ios/context';\nimport { logErrorOnce } from 'turtle/builders/utils/common';\nimport * as fileUtils from 'turtle/builders/utils/file';\nimport * as keychain from 'turtle/builders/utils/ios/keychain';\nimport runShellAppBuilder from 'turtle/builders/utils/ios/shellAppBuilder';\nimport { IJob } from 'turtle/job';\nimport logger from 'turtle/logger/index';\n\nexport default async function buildArchive(ctx: IContext, job: IJob) {\n let keychainInfo;\n try {\n keychainInfo = await keychain.create(ctx);\n const { credentials } = job;\n const { certP12, certPassword } = credentials as { certP12: string; certPassword: string };\n await keychain.importCert(ctx, { keychainPath: keychainInfo.path, certP12, certPassword });\n const manifest = await runShellAppBuilder(ctx, job);\n await buildAndSignIPA(ctx, job, keychainInfo.path, manifest);\n } catch (err) {\n logErrorOnce(err);\n throw err;\n } finally {\n if (keychainInfo) {\n await keychain.remove(ctx, keychainInfo.path);\n }\n }\n}\n\nasync function buildAndSignIPA(ctx: IContext, job: IJob, keychainPath: string, manifest: any) {\n const l = logger.child({ buildPhase: 'building and signing IPA' });\n l.info('building and signing IPA');\n\n const {\n credentials: { provisioningProfile, certPassword, teamId },\n config: { bundleIdentifier: bundleIdentifierFromConfig },\n } = job;\n\n const bundleIdentifierFromManifest = _.get(manifest, 'ios.bundleIdentifier');\n const bundleIdentifier = bundleIdentifierFromConfig || bundleIdentifierFromManifest;\n\n const { provisioningProfilePath } = ctx;\n await fileUtils.writeBase64ToBinaryFile(provisioningProfilePath, provisioningProfile as string);\n l.info('saved provisioning profile to temporary path');\n\n const ipaBuilder = createIPABuilder({\n keychainPath,\n provisioningProfilePath,\n appUUID: ctx.appUUID,\n certPath: ctx.tempCertPath,\n certPassword,\n teamID: teamId,\n bundleIdentifier,\n workspacePath: ctx.workspacePath,\n manifest,\n });\n await ipaBuilder.build();\n\n l.info(`done building and signing IPA`);\n}\n"]}
-79
View File
@@ -1,79 +0,0 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path"));
const xdl_1 = require("@expo/xdl");
const uuid_1 = require("uuid");
const workingdir_1 = require("../utils/ios/workingdir");
const config_1 = __importDefault(require("../../config"));
const index_1 = require("../../constants/index");
const { EXPOKIT_APP, EXPONENT_APP } = xdl_1.IosShellApp;
function createBuilderContext(job) {
const { join } = path;
const appUUID = uuid_1.v4();
const { manifest: { sdkVersion: sdkVersionFromManifest = null, } = {}, sdkVersion: sdkVersionFromJob, config: { buildType }, } = job;
const sdkVersion = sdkVersionFromJob || sdkVersionFromManifest;
const workingDir = workingdir_1.formatShellAppDirectory({ sdkVersion, buildType: buildType });
const majorSdkVersion = xdl_1.ExponentTools.parseSdkMajorVersion(sdkVersion);
const context = {
appDir: join(config_1.default.directories.temporaryFilesRoot, appUUID),
appUUID,
workingDir,
};
context.buildDir = join(context.appDir, 'build');
context.provisioningProfileDir = join(context.appDir, 'provisioning');
context.provisioningProfilePath = join(context.provisioningProfileDir, `${appUUID}.mobileprovision`);
context.tempCertPath = join(context.appDir, 'cert.p12');
context.baseArchiveDir = join(context.appDir, 'archive');
if (buildType === index_1.IOS_BUILD_TYPES.CLIENT) {
context.applicationFilesSrc = join(workingDir, 'expo-client-build', '**', '*');
}
else {
context.applicationFilesSrc = join(workingDir, 'shellAppBase-builds', buildType, '**', '*');
}
if (buildType === index_1.IOS_BUILD_TYPES.ARCHIVE) {
context.outputPath = join(context.appDir, 'archive.xcarchive');
context.uploadPath = join(context.buildDir, 'archive.ipa');
context.archiveDir = join(context.baseArchiveDir, 'Release', `${EXPOKIT_APP}.xcarchive`, 'Products', 'Applications', `${EXPOKIT_APP}.app`);
if (majorSdkVersion >= 33) {
context.workspacePath = path.join(workingDir, 'shellAppWorkspaces', 'default', 'ios', `${EXPOKIT_APP}.xcworkspace`);
}
else {
context.workspacePath = path.join(workingDir, 'shellAppWorkspaces', 'ios', 'default', `${EXPOKIT_APP}.xcworkspace`);
}
}
else if (buildType === index_1.IOS_BUILD_TYPES.CLIENT) {
context.outputPath = join(context.appDir, 'archive.xcarchive');
context.uploadPath = join(context.buildDir, 'archive.ipa');
context.archiveDir = join(context.baseArchiveDir, `${EXPONENT_APP}.xcarchive`, 'Products', 'Applications', `${EXPONENT_APP}.app`);
context.workspacePath = path.join(workingDir, 'ios', `${EXPONENT_APP}.xcworkspace`);
}
else if (buildType === index_1.IOS_BUILD_TYPES.SIMULATOR) {
context.outputPath = join(context.appDir, 'archive.tar.gz');
context.uploadPath = join(context.appDir, 'archive.tar.gz');
context.archiveDir = join(context.baseArchiveDir, 'Release', `${EXPOKIT_APP}.app`);
}
const s3FileExtension = buildType === index_1.IOS_BUILD_TYPES.SIMULATOR ? 'tar.gz' : 'ipa';
const s3Filename = `${job.experienceName}-${appUUID}-${buildType}.${s3FileExtension}`;
if (config_1.default.builder.fakeUpload) {
const fakeUploadFilename = s3Filename.replace('/', '__');
context.fakeUploadBuildPath = job.fakeUploadBuildPath
? job.fakeUploadBuildPath
: join(job.fakeUploadDir || config_1.default.directories.fakeUploadDir, fakeUploadFilename);
}
else {
context.s3FileKey = join(index_1.PLATFORMS.IOS, s3Filename);
}
return context;
}
exports.createBuilderContext = createBuilderContext;
//# sourceMappingURL=context.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/builders/ios/context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA6B;AAE7B,mCAAuD;AACvD,+BAAoC;AAEpC,wDAA+E;AAC/E,0DA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nimport { ExponentTools, IosShellApp } from '@expo/xdl';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { formatShellAppDirectory } from 'turtle/builders/utils/ios/workingdir';\nimport config from 'turtle/config';\nimport { IOS_BUILD_TYPES, PLATFORMS } from 'turtle/constants/index';\nimport { IJob } from 'turtle/job';\n\nexport interface IContext {\n appDir: string;\n appUUID: string;\n archiveDir: string;\n baseArchiveDir: string;\n buildDir: string;\n fakeUploadBuildPath?: string;\n outputPath: string;\n provisioningProfilePath: string;\n provisioningProfileDir: string;\n s3FileKey?: string;\n tempCertPath: string;\n uploadPath: string;\n workingDir: string;\n workspacePath: string;\n applicationFilesSrc: string;\n}\n\nconst { EXPOKIT_APP, EXPONENT_APP } = IosShellApp;\n\nexport function createBuilderContext(job: IJob): IContext {\n const { join } = path;\n const appUUID = uuidv4();\n const {\n manifest: {\n sdkVersion: sdkVersionFromManifest = null,\n } = {},\n sdkVersion: sdkVersionFromJob,\n config: { buildType },\n } = job;\n\n const sdkVersion = sdkVersionFromJob || sdkVersionFromManifest;\n const workingDir = formatShellAppDirectory({ sdkVersion, buildType: buildType! });\n const majorSdkVersion = ExponentTools.parseSdkMajorVersion(sdkVersion);\n\n const context: any = {\n appDir: join(config.directories.temporaryFilesRoot, appUUID),\n appUUID,\n workingDir,\n };\n context.buildDir = join(context.appDir, 'build');\n context.provisioningProfileDir = join(context.appDir, 'provisioning');\n context.provisioningProfilePath = join(\n context.prLine truncated
-62
View File
@@ -1,62 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
const pick_1 = __importDefault(require("lodash/pick"));
const archive_1 = __importDefault(require("./archive"));
const context_1 = require("./context");
const simulator_1 = __importDefault(require("./simulator"));
const common_1 = require("../utils/common");
const adhocBuild_1 = __importDefault(require("../utils/ios/adhocBuild"));
const uploader_1 = require("../utils/uploader");
const version_1 = require("../utils/version");
const config_1 = __importDefault(require("../../config"));
const constants_1 = require("../../constants");
async function iosBuilder(job) {
if (job.config.buildType !== constants_1.IOS_BUILD_TYPES.CLIENT) {
await version_1.ensureCanBuildSdkVersion(job);
}
const ctx = context_1.createBuilderContext(job);
try {
await initBuilder(ctx);
const { buildType } = job.config;
if (buildType === constants_1.IOS_BUILD_TYPES.CLIENT) {
await adhocBuild_1.default(job);
}
if ([constants_1.IOS_BUILD_TYPES.ARCHIVE, constants_1.IOS_BUILD_TYPES.CLIENT].includes(buildType)) {
await archive_1.default(ctx, job);
}
else if (buildType === constants_1.IOS_BUILD_TYPES.SIMULATOR) {
await simulator_1.default(ctx, job);
}
else {
throw new Error(`Unsupported iOS build type: ${buildType}`);
}
const artifactUrl = await uploader_1.uploadBuildToS3(ctx);
return { artifactUrl };
}
catch (err) {
common_1.logErrorOnce(err);
throw err;
}
finally {
await cleanup(ctx);
}
}
exports.default = iosBuilder;
async function initBuilder(ctx) {
for (const dir of getTemporaryDirs(ctx)) {
await fs_extra_1.default.ensureDir(dir);
await fs_extra_1.default.chmod(dir, 0o755);
}
}
async function cleanup(ctx) {
if (config_1.default.builder.skipCleanup) {
return;
}
await Promise.all(getTemporaryDirs(ctx).map((dir) => fs_extra_1.default.remove(dir)));
}
const getTemporaryDirs = (ctx) => Object.values(pick_1.default(ctx, ['appDir', 'provisioningProfileDir']));
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builders/ios/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0B;AAC1B,uDAA+B;AAE/B,wDAAuD;AACvD,uCAA6E;AAC7E,4DAA2D;AAC3D,4CAA4D;AAC5D,yEAAgF;AAChF,gDAAiE;AACjE,8CAAyE;AACzE,0DAAmC;AACnC,+CAAmD;AAGpC,KAAK,UAAU,UAAU,CAAC,GAAS;IAChD,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,KAAK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AAO,CAAC,GAAa;IAClC,IAAI,gBAAM,CAAC,OAAO,CAAC,WAAW,EAAE;QAC9B,OAAO;KACR;IACD,MAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,kBAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,gBAAgB,GAAG,CAAC,GAAa,EAAE,EAAE,CACzC,MAAM,CAAC,MAAM,CAAC,cAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC,CAAa,CAAC","sourcesContent":["import fs from 'fs-extra';\nimport pick from 'lodash/pick';\n\nimport buildArchive from 'turtle/builders/ios/archive';\nimport { createBuilderContext, IContext } from 'turtle/builders/ios/context';\nimport buildSimulator from 'turtle/builders/ios/simulator';\nimport { logErrorOnce } from 'turtle/builders/utils/common';\nimport prepareAdHocBuildCredentials from 'turtle/builders/utils/ios/adhocBuild';\nimport { uploadBuildToS3 } from 'turtle/builders/utils/uploader';\nimport { ensureCanBuildSdkVersion } from 'turtle/builders/utils/version';\nimport config from 'turtle/config';\nimport { IOS_BUILD_TYPES } from 'turtle/constants';\nimport { IJob, IJobResult } from 'turtle/job';\n\nexport default async function iosBuilder(job: IJob): Promise<IJobResult> {\n if (job.config.buildType !== IOS_BUILD_TYPES.CLIENT) {\n await ensureCanBuildSdkVersion(job);\n }\n\n const ctx = createBuilderContext(job);\n\n try {\n await initBuilder(ctx);\n\n const { buildType } = job.config;\n\n if (buildType === IOS_BUILD_TYPES.CLIENT) {\n await prepareAdHocBuildCredentials(job);\n }\n\n if ([IOS_BUILD_TYPES.ARCHIVE, IOS_BUILD_TYPES.CLIENT].includes(buildType!)) {\n await buildArchive(ctx, job);\n } else if (buildType === IOS_BUILD_TYPES.SIMULATOR) {\n await buildSimulator(ctx, job);\n } else {\n throw new Error(`Unsupported iOS build type: ${buildType}`);\n }\n\n const artifactUrl = await uploadBuildToS3(ctx);\n return { artifactUrl };\n } catch (err) {\n logErrorOnce(err);\n throw err;\n } finally {\n await cleanup(ctx);\n }\n}\n\nasync function initBuilder(ctx: IContext) {\n for (const dir of getTemporaryDirs(ctx)) {\n await fs.ensureDir(dir);\n await fs.chmod(dir, 0o755);\n }\n}\n\nasync function cleanup(ctx: IContext) {\n if (config.builder.skipCleanup) {\n return;\n }\n await Promise.all(getTemporaryDirs(ctx).map((dir: string) => fs.remove(dir)));\n}\n\nconst getTemporaryDirs = (ctx: IContext) =>\n Object.values(pick(ctx, ['appDir', 'provisioningProfileDir'])) as string[];\n"]}
-15
View File
@@ -1,15 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const shellAppBuilder_1 = __importDefault(require("../utils/ios/shellAppBuilder"));
const logger_1 = __importDefault(require("../../logger"));
async function buildSimulator(ctx, job) {
const l = logger_1.default.child({ buildPhase: 'running simulator builder' });
l.info('running simulator build');
await shellAppBuilder_1.default(ctx, job);
l.info('build complete');
}
exports.default = buildSimulator;
//# sourceMappingURL=simulator.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"simulator.js","sourceRoot":"","sources":["../../../src/builders/ios/simulator.ts"],"names":[],"mappings":";;;;;AACA,mFAA2E;AAE3E,0DAAmC;AAEpB,KAAK,UAAU,cAAc,CAAC,GAAa,EAAE,GAAS;IACnE,MAAM,CAAC,GAAG,gBAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,2BAA2B,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IAClC,MAAM,yBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAC3B,CAAC;AALD,iCAKC","sourcesContent":["import { IContext } from 'turtle/builders/ios/context';\nimport runShellAppBuilder from 'turtle/builders/utils/ios/shellAppBuilder';\nimport { IJob } from 'turtle/job';\nimport logger from 'turtle/logger';\n\nexport default async function buildSimulator(ctx: IContext, job: IJob) {\n const l = logger.child({ buildPhase: 'running simulator builder' });\n l.info('running simulator build');\n await runShellAppBuilder(ctx, job);\n l.info('build complete');\n}\n"]}
@@ -1,65 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const xdl_1 = require("@expo/xdl");
const fs_extra_1 = __importDefault(require("fs-extra"));
const get_1 = __importDefault(require("lodash/get"));
const v4_1 = __importDefault(require("uuid/v4"));
const sqs = __importStar(require("../../../aws/sqs"));
const build_1 = require("../../../constants/build");
const logger_1 = __importDefault(require("../../../logger"));
const turtleContext_1 = require("../../../turtleContext");
async function getOrCreateCredentials(jobData) {
if (!jobData.credentials) {
const l = logger_1.default.child({ buildPhase: 'generating keystore' });
const credentials = {};
l.info('Creating keystore');
const keystoreFilename = `/tmp/keystore-${jobData.id}.tmp.jks`;
credentials.keystorePassword = v4_1.default().replace(/-/g, '');
credentials.keyPassword = v4_1.default().replace(/-/g, '');
credentials.keystoreAlias = Buffer.from(jobData.experienceName).toString('base64');
const androidPackage = get_1.default(jobData, 'manifest.android.package')
|| get_1.default(jobData, 'config.androidPackage');
if (!androidPackage) {
throw new Error('Android package name is not set in the app manifest (please update app.json if you\'re using turtle-cli).');
}
await xdl_1.AndroidCredentials.createKeystore({
keystorePath: keystoreFilename,
keystorePassword: credentials.keystorePassword,
keyPassword: credentials.keyPassword,
keyAlias: credentials.keystoreAlias,
}, androidPackage);
credentials.keystore = (await fs_extra_1.default.readFile(keystoreFilename)).toString('base64');
l.info('Keystore created successfully');
if (turtleContext_1.isOffline()) {
const projectKeystorePath = path_1.default.join(jobData.projectDir, `${jobData.experienceName}.jks`);
await fs_extra_1.default.copy(keystoreFilename, projectKeystorePath);
l.info(`Saved created keystore to ${projectKeystorePath}`);
l.info(`Keystore password: ${credentials.keystorePassword}`);
l.info(`Keystore alias: ${credentials.keystoreAlias}`);
l.info(`Key password: ${credentials.keyPassword}`);
l.info(`Please keep these credentials safe`);
}
else {
await sqs.sendMessage(jobData.id, build_1.UPDATE_CREDENTIALS, {
...credentials,
});
l.info('Keystore sent to storage successfully');
}
await fs_extra_1.default.unlink(keystoreFilename);
return credentials;
}
return jobData.credentials;
}
exports.default = getOrCreateCredentials;
//# sourceMappingURL=credentials.js.map
@@ -1 +0,0 @@
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../../src/builders/utils/android/credentials.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAwB;AAExB,mCAA+C;AAC/C,wDAA0B;AAC1B,qDAA6B;AAC7B,iDAA6B;AAE7B,sDAAsC;AACtC,oDAA4D;AAE5D,6DAAmC;AACnC,0DAAiD;AAEjD,KAAK,UAAU,sBAAsB,CAAC,OAAa;IACjD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;QACxB,MAAM,CAAC,GAAG,gBAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,qBAAqB,EAAE,CAAC,CAAC;QAC9D,MAAM,WAAW,GAAQ,EAAE,CAAC;QAC5B,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC5B,MAAM,gBAAgB,GAAG,iBAAiB,OAAO,CAAC,EAAE,UAAU,CAAC;QAC/D,WAAW,CAAC,gBAAgB,GAAG,YAAM,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1D,WAAW,CAAC,WAAW,GAAG,YAAM,EAAE,CAAC,OAAO,CAAC,IAAI,EA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CAAC;YACnD,CAAC,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;SAC9C;aAAM;YACL,MAAM,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,0BAAkB,EAAE;gBACpD,GAAG,WAAW;aACf,CAAC,CAAC;YACH,CAAC,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;SACjD;QACD,MAAM,kBAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAClC,OAAO,WAAW,CAAC;KACpB;IAED,OAAO,OAAO,CAAC,WAAkC,CAAC;AACpD,CAAC;AAED,kBAAe,sBAAsB,CAAC","sourcesContent":["import path from 'path';\n\nimport { AndroidCredentials } from '@expo/xdl';\nimport fs from 'fs-extra';\nimport get from 'lodash/get';\nimport uuidv4 from 'uuid/v4';\n\nimport * as sqs from 'turtle/aws/sqs';\nimport { UPDATE_CREDENTIALS } from 'turtle/constants/build';\nimport { IAndroidCredentials, IJob } from 'turtle/job';\nimport logger from 'turtle/logger';\nimport { isOffline } from 'turtle/turtleContext';\n\nasync function getOrCreateCredentials(jobData: IJob): Promise<IAndroidCredentials> {\n if (!jobData.credentials) {\n const l = logger.child({ buildPhase: 'generating keystore' });\n const credentials: any = {};\n l.info('Creating keystore');\n const keystoreFilename = `/tmp/keystore-${jobData.id}.tmp.jks`;\n credentials.keystorePassword = uuidv4().replace(/-/g, '');\n credentials.keyPassword = uuidv4().replace(/-/g, '');\n credentials.keystoreAlias = Buffer.from(jobData.experienceName).toString('base64');\n const androidPackage =\n get(jobData, 'manifest.android.package')\n || get(jobData, 'config.androidPackage');\n if (!androidPackage) {\n throw new Error(\n 'Android package name is not set in the app manifest (please update app.json if you\\'re using turtle-cli).',\n );\n }\n\n await AndroidCredentials.createKeystore(\n {\n keystorePath: keystoreFilename,\n keystorePassword: credentials.keystorePassword,\n keyPassword: credentials.keyPassword,\n keyAlias: credentials.keystoreAlias,\n },\n androidPackage,\n );\n\n credentials.keystore = (await fs.readFile(keystoreFilename)).toString('base64');\n l.info('Keystore created successfully');\n if (isOffline()) {\n const projectKeystorePath = path.join(jobData.projectDir, `${jobData.experienceName}.jks`);\n await fs.copy(keystoreFilename, projectKeystorePath);\n l.info(`Saved created keystore to ${projectKeystorePath}`);\n l.info(`Keystore password: ${credentials.keystorePassword}`);\n l.info(`Keystore alias: ${credentials.keystoreAlias}`);\n l.info(`Key password: ${credentials.keyPassword}`);\n l.info(`Please keep these credentials safe`);\n } else {\n await sqs.sendMessage(jobData.id, UPDATE_CREDENTIALS, {\n ...credentials,\n });\n l.info('Keystore sent to storage successfully');\n }\n await fs.unlink(keystoreFilename);\n return credentials;\n }\n\n return jobData.credentials as IAndroidCredentials;\n}\n\nexport default getOrCreateCredentials;\n"]}
@@ -1,17 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const xdl_1 = require("@expo/xdl");
const config_1 = __importDefault(require("../../../config"));
const constants_1 = require("../../../constants");
function formatShellAppDirectory({ sdkVersion }) {
const majorSdkVersion = xdl_1.ExponentTools.parseSdkMajorVersion(sdkVersion);
return config_1.default.builder.useLocalWorkingDir
? path_1.default.join(config_1.default.directories.workingDir, 'local')
: path_1.default.join(config_1.default.directories.workingDir, constants_1.PLATFORMS.ANDROID, `sdk${majorSdkVersion}`);
}
exports.formatShellAppDirectory = formatShellAppDirectory;
//# sourceMappingURL=workingdir.js.map
@@ -1 +0,0 @@
{"version":3,"file":"workingdir.js","sourceRoot":"","sources":["../../../../src/builders/utils/android/workingdir.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,mCAA0C;AAG1C,6DAAmC;AACnC,kDAA6C;AAE7C,SAAgB,uBAAuB,CAAC,EAAE,UAAU,EAA4B;IAC9E,MAAM,eAAe,GAAG,mBAAa,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACvE,OAAO,gBAAM,CAAC,OAAO,CAAC,kBAAkB;QACtC,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,gBAAM,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC;QACnD,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,gBAAM,CAAC,WAAW,CAAC,UAAU,EAAE,qBAAS,CAAC,OAAO,EAAE,MAAM,eAAe,EAAE,CAAC,CAAC;AAC3F,CAAC;AALD,0DAKC","sourcesContent":["import path from 'path';\n\nimport { ExponentTools } from '@expo/xdl';\n\nimport { IShellAppDirectoryConfig } from 'turtle/builders/utils/workingdir';\nimport config from 'turtle/config';\nimport { PLATFORMS } from 'turtle/constants';\n\nexport function formatShellAppDirectory({ sdkVersion }: IShellAppDirectoryConfig) {\n const majorSdkVersion = ExponentTools.parseSdkMajorVersion(sdkVersion);\n return config.builder.useLocalWorkingDir\n ? path.join(config.directories.workingDir, 'local')\n : path.join(config.directories.workingDir, PLATFORMS.ANDROID, `sdk${majorSdkVersion}`);\n}\n"]}
-33
View File
@@ -1,33 +0,0 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const url = __importStar(require("url"));
const config_1 = __importDefault(require("../../config"));
const logger_1 = __importDefault(require("../../logger"));
function getExperienceUrl(experienceName, publicUrl) {
// publicUrl is passed in if user wants to build an externally hosted app
if (publicUrl) {
return publicUrl;
}
const { protocol, hostname, port } = config_1.default.api;
return url.format({ protocol, hostname, port, pathname: `/${experienceName}` });
}
exports.getExperienceUrl = getExperienceUrl;
const alreadyLoggedError = Symbol('alreadyLoggedError');
function logErrorOnce(err) {
if (!err[alreadyLoggedError]) {
logger_1.default.error(err.stack);
err[alreadyLoggedError] = true;
}
}
exports.logErrorOnce = logErrorOnce;
//# sourceMappingURL=common.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/builders/utils/common.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA2B;AAE3B,0DAAmC;AACnC,0DAAmC;AAEnC,SAAgB,gBAAgB,CAAC,cAAsB,EAAE,SAAkB;IACzE,yEAAyE;IACzE,IAAI,SAAS,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,gBAAM,CAAC,GAAG,CAAC;IAChD,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,cAAc,EAAE,EAAE,CAAC,CAAC;AAClF,CAAC;AAPD,4CAOC;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAExD,SAAgB,YAAY,CAAC,GAAQ;IACnC,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;QAC5B,gBAAM,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACxB,GAAG,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;KAChC;AACH,CAAC;AALD,oCAKC","sourcesContent":["import * as url from 'url';\n\nimport config from 'turtle/config';\nimport logger from 'turtle/logger';\n\nexport function getExperienceUrl(experienceName: string, publicUrl?: string) {\n // publicUrl is passed in if user wants to build an externally hosted app\n if (publicUrl) {\n return publicUrl;\n }\n const { protocol, hostname, port } = config.api;\n return url.format({ protocol, hostname, port, pathname: `/${experienceName}` });\n}\n\nconst alreadyLoggedError = Symbol('alreadyLoggedError');\n\nexport function logErrorOnce(err: any) {\n if (!err[alreadyLoggedError]) {\n logger.error(err.stack);\n err[alreadyLoggedError] = true;\n }\n}\n"]}
-12
View File
@@ -1,12 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = __importDefault(require("fs-extra"));
async function writeBase64ToBinaryFile(filename, base64) {
const buffer = Buffer.from(base64, 'base64');
await fs_extra_1.default.writeFile(filename, buffer);
}
exports.writeBase64ToBinaryFile = writeBase64ToBinaryFile;
//# sourceMappingURL=file.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/builders/utils/file.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0B;AAEnB,KAAK,UAAU,uBAAuB,CAAC,QAAgB,EAAE,MAAc;IAC5E,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC;AAHD,0DAGC","sourcesContent":["import fs from 'fs-extra';\n\nexport async function writeBase64ToBinaryFile(filename: string, base64: string) {\n const buffer = Buffer.from(base64, 'base64');\n await fs.writeFile(filename, buffer);\n}\n"]}
-34
View File
@@ -1,34 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const fs_extra_1 = __importDefault(require("fs-extra"));
const sharp_1 = __importDefault(require("sharp"));
async function resizeIconWithSharpAsync(iconSizePx, iconFilename, destinationIconPath) {
const filename = path_1.default.join(destinationIconPath, iconFilename);
// PLEASE DON'T REMOVE THE FOLLOWING LINE (sharp caches files taking path as the cache key)
sharp_1.default.cache(false);
// sharp can't have same input and output filename, so load to buffer then
// write to disk after resize is complete
const buffer = await sharp_1.default(filename)
.resize(iconSizePx, iconSizePx)
.toBuffer();
await fs_extra_1.default.writeFile(filename, buffer);
}
exports.resizeIconWithSharpAsync = resizeIconWithSharpAsync;
async function getImageDimensionsWithSharpAsync(dirname, filename) {
const filepath = path_1.default.join(dirname, filename);
// PLEASE DON'T REMOVE THE FOLLOWING LINE (sharp caches files taking path as the cache key)
sharp_1.default.cache(false);
try {
const { width, height } = await sharp_1.default(filepath).metadata();
return { width, height };
}
catch (e) {
return null;
}
}
exports.getImageDimensionsWithSharpAsync = getImageDimensionsWithSharpAsync;
//# sourceMappingURL=image.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/builders/utils/image.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAC1B,kDAA0B;AAEnB,KAAK,UAAU,wBAAwB,CAAC,UAAkB,EAAE,YAAoB,EAAE,mBAA2B;IAClH,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;IAE9D,2FAA2F;IAC3F,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEnB,0EAA0E;IAC1E,yCAAyC;IACzC,MAAM,MAAM,GAAG,MAAM,eAAK,CAAC,QAAQ,CAAC;SACjC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC;SAC9B,QAAQ,EAAE,CAAC;IAEd,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC;AAbD,4DAaC;AAEM,KAAK,UAAU,gCAAgC,CAAC,OAAe,EAAE,QAAgB;IACtF,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAE9C,2FAA2F;IAC3F,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEnB,IAAI;QACF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,eAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;KAC1B;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAZD,4EAYC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport sharp from 'sharp';\n\nexport async function resizeIconWithSharpAsync(iconSizePx: number, iconFilename: string, destinationIconPath: string) {\n const filename = path.join(destinationIconPath, iconFilename);\n\n // PLEASE DON'T REMOVE THE FOLLOWING LINE (sharp caches files taking path as the cache key)\n sharp.cache(false);\n\n // sharp can't have same input and output filename, so load to buffer then\n // write to disk after resize is complete\n const buffer = await sharp(filename)\n .resize(iconSizePx, iconSizePx)\n .toBuffer();\n\n await fs.writeFile(filename, buffer);\n}\n\nexport async function getImageDimensionsWithSharpAsync(dirname: string, filename: string) {\n const filepath = path.join(dirname, filename);\n\n // PLEASE DON'T REMOVE THE FOLLOWING LINE (sharp caches files taking path as the cache key)\n sharp.cache(false);\n\n try {\n const { width, height } = await sharp(filepath).metadata();\n return { width, height };\n } catch (e) {\n return null;\n }\n}\n"]}
-93
View File
@@ -1,93 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
const xdl_1 = require("@expo/xdl");
const fs_extra_1 = __importDefault(require("fs-extra"));
const sqs = __importStar(require("../../../aws/sqs"));
const BuildError_1 = __importStar(require("../../BuildError"));
const build_1 = require("../../../constants/build");
const logger_1 = __importDefault(require("../../../logger"));
const turtleContext_1 = require("../../../turtleContext");
// tslint:disable-next-line:no-var-requires
const travelingFastlane = process.platform === 'darwin' ? require('@expo/traveling-fastlane-darwin')() : null;
async function prepareAdHocBuildCredentials(job) {
if (process.platform !== 'darwin') {
throw new Error('This function should be called only on macOS!');
}
const { bundleIdentifier } = job.config;
const { certP12, certPassword, teamId, appleSession, udids, provisioningProfileId, } = job.credentials;
const certSerialNumber = xdl_1.IosCodeSigning.findP12CertSerialNumber(certP12, certPassword);
const args = [
...(provisioningProfileId ? ['--profile-id', provisioningProfileId] : []),
teamId,
udids.join(','),
bundleIdentifier,
certSerialNumber || '__last__',
];
try {
if (provisioningProfileId) {
logger_1.default.info(`Using ad hoc provisioning profile id: ${provisioningProfileId}`);
}
const credentials = await runFastlaneAction(travelingFastlane.manageAdHocProvisioningProfile, args, { env: { FASTLANE_SESSION: appleSession } });
logger_1.default.info('New ad hoc provisioning profile successfully created');
job.credentials.provisioningProfile = credentials.provisioningProfile;
if (!credentials.provisioningProfileUpdateTimestamp) {
// dont need to persist profile because nothing changed
return;
}
if (turtleContext_1.isOffline()) {
const provisioningProfilePath = path_1.default.join(job.projectDir, `adhoc.mobileprovision`);
await fs_extra_1.default.writeFile(provisioningProfilePath, Buffer.from(credentials.provisioningProfile, 'base64'));
logger_1.default.info(`Saved provisioning profile to ${provisioningProfilePath}`);
}
else {
await sqs.sendMessage(job.id, build_1.UPDATE_CREDENTIALS, {
provisioningProfileId: credentials.provisioningProfileId,
provisioningProfile: credentials.provisioningProfile,
});
logger_1.default.info('Ad Hoc provisioning profile sent to storage successfully');
}
}
catch (e) {
if (e instanceof BuildError_1.default) {
logger_1.default.error('Apple Session expired! Please authenticate again using expo-cli.');
}
throw e;
}
}
async function runFastlaneAction(action, args, { env }) {
const { stderr } = await spawn_async_1.default(action, args, {
stdio: ['inherit', 'pipe', 'pipe'],
env: { ...process.env, ...env },
});
const { result, ...rest } = JSON.parse(stderr.trim());
if (result === 'failure') {
const { reason, rawDump, type } = rest;
let errorMsg = `Reason: ${reason}`;
if (rawDump) {
errorMsg += `, raw: ${JSON.stringify(rawDump)}`;
}
if (type === 'session-expired') {
throw new BuildError_1.default(BuildError_1.BuildErrorReason.SESSION_EXPIRED, errorMsg);
}
else {
throw new Error(errorMsg);
}
}
else {
return rest;
}
}
exports.default = prepareAdHocBuildCredentials;
//# sourceMappingURL=adhocBuild.js.map
Loaded 100 of 276 files, more files were not shown because too many files have changed in this diff. Show more