Compare commits

...
Author SHA1 Message Date
Quinlan Jung ca3a118d43 debug msg 2019-07-01 14:21:37 -07:00
Quinlan Jung 1fca07d58b schema change 2019-07-01 14:21:36 -07:00
Quinlan Jung 30274bfd7e [turtle] use provisioiningProfileId if specified (#88)
* [turtle] use provisioiningProfileId if specified

* make ts happy

* update changelog
2019-07-01 13:21:51 -07:00
Dominik Sokal 8ef99f2eae remove redundant import 2019-06-27 13:03:51 +02:00
Dominik Sokal 855e4bb962 send turtle metadata to different redis 2019-06-27 12:53:30 +02:00
Dominik Sokal df789b2de7 add registering supported sdk versions in redis (#103) 2019-06-25 17:22:36 +02:00
Wojciech Kozyra eff0556291 Update CHANGELOG.md 2019-06-25 17:06:07 +02:00
Wojciech Kozyra db74843ae0 Release 0.8.6 2019-06-25 17:05:13 +02:00
Wojciech KozyraandDominik Sokal a0e1382531 update xdl (fix support for binary plist) (#101)
* update xdl (fix support for binary plist)

* Update CHANGELOG.md

* Apply suggestions from code review

Co-Authored-By: Dominik Sokal <[email protected]>
2019-06-25 16:33:15 +02:00
Wojciech Kozyra 952dcd0cd3 fix schema for android buildModes(ts error) 2019-06-19 17:16:35 +02:00
Wojciech Kozyra 0cd4e2953a fix schema for android buildModes 2019-06-19 16:42:48 +02:00
Wojciech Kozyra a03d93cb27 Revert "Release 0.8.5"
This reverts commit 75316b5f07.
2019-06-19 16:42:01 +02:00
Wojciech Kozyra 010e92472b Update CHANGELOG.md 2019-06-19 16:11:18 +02:00
Wojciech Kozyra 75316b5f07 Release 0.8.5 2019-06-19 16:07:40 +02:00
Stanisław Chmiela 4baa49e8fe [android] Support buildMode = debug | release (#99)
* [android] Support buildMode = debug | release

* Upgrade XDL to include buildMode feature
2019-06-19 16:05:17 +02:00
Nick Novitski edb167e6b1 xdl: 54.1.4 -> 55.0.0 (#98) 2019-06-18 10:03:49 +02:00
13 changed files with 347 additions and 576 deletions

No files matched your search

+10 -1
View File
@@ -5,9 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Adhoc Builds: use provisioningProfileId if specified.
- Registering supported SDK versions in Redis.
## [0.8.6] - 2019-06-25
### Added
- Added support for Android build modes: debug or release.
### Fixed
- Upgrading the shell app for a given SDK version when the previous version is already downloaded (bug in `turtle-cli`).
- Updated Android shell app for SDK33 to include `[email protected]` which fixes crashes on Android 9.0 when showing some Lottie animations.
- Schema for `buildModes`.
- Updated @expo/xdl to 55.0.7 (fixed reading from binary plist).
## [0.8.4] - 2019-06-13
### Changed
@@ -120,7 +129,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.5.10] - 2019-02-19
### Added
- Register Turtle version in Redis.
- Registering Turtle version in Redis.
### Changed
- Update Android shell app for SDK 32 to fix [update](https://github.com/expo/expo/issues/3504) and [back button](https://github.com/expo/expo/issues/1786) issues.
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "turtle-cli",
"version": "0.8.4",
"version": "0.8.6",
"description": "The command-line tool for building standalone Expo apps",
"preferGlobal": true,
"scripts": {
@@ -111,7 +111,7 @@
},
"dependencies": {
"@expo/spawn-async": "^1.4.2",
"@expo/xdl": "54.1.4",
"@expo/xdl": "55.0.7",
"@google-cloud/logging-bunyan": "^0.9.5",
"async-retry": "^1.2.1",
"aws-sdk": "^2.226.1",
+8 -2
View File
@@ -23,9 +23,15 @@ export default (program: any, setCommonCommandOptions: any) => {
/^(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, signed and ready for submission to the Google Play'
+ ' Store.',
'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(
createBuilderAction({
+3 -1
View File
@@ -57,6 +57,7 @@ export function createBuilderAction({
const args = {
releaseChannel: cmd.releaseChannel || 'default',
buildType: cmd.type,
buildMode: cmd.mode,
username: userData.username || 'anonymous',
projectDir: ProjectUtils.resolveAbsoluteDir(projectDirArg),
publicUrl: cmd.publicUrl,
@@ -88,13 +89,14 @@ export function createBuilderAction({
const buildJobObject = async (
platform: 'android' | 'ios',
appJSON: any,
{ releaseChannel, buildType, username, publicUrl, projectDir }: any,
{ releaseChannel, buildType, buildMode, username, publicUrl, projectDir }: any,
credentials: any,
) => {
const job = {
config: {
..._.get(appJSON, 'expo.ios.config', {}),
buildType,
...(platform === 'android' ? { buildMode } : {}),
releaseChannel,
...(platform === 'ios' ? { bundleIdentifier: _.get(appJSON, 'expo.ios.bundleIdentifier') } : {}),
...(platform === 'android' ? { androidPackage: _.get(appJSON, 'expo.android.package') } : {}),
+1
View File
@@ -93,6 +93,7 @@ async function runShellAppBuilder(
outputFile: outputFilePath,
modules: enabledModules,
buildType: jobData.config.buildType,
buildMode: jobData.config.buildMode,
});
} catch (err) {
commonUtils.logErrorOnce(err);
+20 -12
View File
@@ -3,7 +3,6 @@ import path from 'path';
import spawnAsync from '@expo/spawn-async';
import { IosCodeSigning } from '@expo/xdl';
import fs from 'fs-extra';
import isEmpty from 'lodash/isEmpty';
import * as sqs from 'turtle/aws/sqs';
import BuildError, { BuildErrorReason } from 'turtle/builders/BuildError';
@@ -21,10 +20,18 @@ async function prepareAdHocBuildCredentials(job: IJob) {
}
const { bundleIdentifier } = job.config;
const { certP12, certPassword, teamId, appleSession, udids } = job.credentials;
const {
certP12,
certPassword,
teamId,
appleSession,
udids,
provisioningProfileId,
} = job.credentials;
const certSerialNumber = IosCodeSigning.findP12CertSerialNumber(certP12, certPassword);
const args = [
...(provisioningProfileId ? ['--profile-id', provisioningProfileId] : []),
teamId,
udids!.join(','),
bundleIdentifier,
@@ -32,25 +39,26 @@ async function prepareAdHocBuildCredentials(job: IJob) {
];
try {
if (provisioningProfileId) {
logger.info(
`Using ad hoc provisioning profile id: ${provisioningProfileId}`,
);
}
const credentials = await runFastlaneAction(
travelingFastlane.manageAdHocProvisioningProfile,
args,
{ env: { FASTLANE_SESSION: appleSession } },
);
if (isEmpty(credentials)) {
if (!job.credentials.provisioningProfile) {
// a user has generated the provisioning profile for his app, but he probably deleted it from Expo servers, ...
throw new BuildError(
BuildErrorReason.PROVISIONING_PROFILE_MISSING,
`Provisioning profile is missing on Expo servers.`,
);
}
return;
}
logger.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 (isOffline()) {
const provisioningProfilePath = path.join(job.projectDir, `adhoc.mobileprovision`);
await fs.writeFile(provisioningProfilePath, Buffer.from(credentials.provisioningProfile, 'base64'));
+17 -11
View File
@@ -5,26 +5,32 @@ import path from 'path';
import config from 'turtle/config';
import { IJob } from 'turtle/job';
let SUPPORTED_SDK_VERSIONS: number[];
interface IVersionsMap {
[platform: string]: number[];
}
const versions: IVersionsMap = {};
export async function ensureCanBuildSdkVersion(job: IJob) {
if (config.builder.useLocalWorkingDir) {
return;
}
if (!SUPPORTED_SDK_VERSIONS) {
SUPPORTED_SDK_VERSIONS = await findSupportedSdkVersions(job.platform);
}
const platformVersions = await findSupportedSdkVersions(job.platform);
const targetMajorSdkVersion = ExponentTools.parseSdkMajorVersion(job.sdkVersion || job.manifest.sdkVersion);
if (!SUPPORTED_SDK_VERSIONS.includes(targetMajorSdkVersion)) {
if (!platformVersions.includes(targetMajorSdkVersion)) {
throw new Error(`Unsupported SDK Version!`);
}
}
async function findSupportedSdkVersions(platform: 'android' | 'ios'): Promise<number[]> {
const SDK_DIR_PREFIX = 'sdk';
const files = await fs.readdir(path.join(config.directories.workingDir, platform));
const sdks = files.filter((file) => file.startsWith(SDK_DIR_PREFIX));
return sdks.map((sdk) => parseInt(sdk.substr(SDK_DIR_PREFIX.length), 10));
export async function findSupportedSdkVersions(platform: 'android' | 'ios'): Promise<number[]> {
if (versions[platform]) {
return versions[platform];
} else {
const SDK_DIR_PREFIX = 'sdk';
const files = await fs.readdir(path.join(config.directories.workingDir, platform));
const sdks = files.filter((file) => file.startsWith(SDK_DIR_PREFIX));
versions[platform] = sdks.map((sdk) => parseInt(sdk.substr(SDK_DIR_PREFIX.length), 10));
return versions[platform];
}
}
+5
View File
@@ -16,4 +16,9 @@ export enum ANDROID_BUILD_TYPES {
APP_BUNDLE = 'app-bundle',
}
export enum ANDROID_BUILD_MODES {
DEBUG = 'debug',
RELEASE = 'release',
}
export { BUILD };
+3 -1
View File
@@ -1,4 +1,4 @@
import { ANDROID_BUILD_TYPES, IOS_BUILD_TYPES } from 'turtle/constants';
import { ANDROID_BUILD_MODES, ANDROID_BUILD_TYPES, IOS_BUILD_TYPES } from 'turtle/constants';
export interface IJob {
platform: 'android' | 'ios';
@@ -14,6 +14,7 @@ export interface IJob {
bundleIdentifier?: string;
// android
androidPackage?: string;
buildMode?: ANDROID_BUILD_MODES;
};
credentials: {
// android
@@ -25,6 +26,7 @@ export interface IJob {
certP12?: string;
certPassword?: string;
provisioningProfile?: string;
provisioningProfileId?: string;
teamId?: string;
appleSession?: string;
udids?: string[];
+5 -1
View File
@@ -1,6 +1,6 @@
import Joi from 'joi';
import { PLATFORMS } from 'turtle/constants';
import { ANDROID_BUILD_MODES, ANDROID_BUILD_TYPES, PLATFORMS } from 'turtle/constants';
import baseJobSchema from 'turtle/jobsSchemas/base';
export default baseJobSchema.concat(
@@ -12,5 +12,9 @@ export default baseJobSchema.concat(
keystoreAlias: Joi.string(),
keystore: Joi.string(),
}),
config: Joi.object().keys({
buildMode: Joi.string().valid(Object.values(ANDROID_BUILD_MODES)).default(ANDROID_BUILD_MODES.RELEASE),
buildType: Joi.string().valid(Object.values(ANDROID_BUILD_TYPES)).default(ANDROID_BUILD_TYPES.APK),
}),
}),
);
+1
View File
@@ -17,6 +17,7 @@ export default baseJobSchema.concat(
teamId: Joi.string().required(),
// it's not required for adhoc Expo Client builds
provisioningProfile: Joi.string(),
provisioningProfileId: Joi.string(),
appleSession: Joi.string(),
udids: Joi.array().items(Joi.string()),
})
+9 -4
View File
@@ -1,13 +1,15 @@
import { LoggerDetach } from '@expo/xdl';
import { findSupportedSdkVersions } from 'turtle/builders/utils/version';
import config from 'turtle/config';
import { doJob } from 'turtle/jobManager';
import logger from 'turtle/logger';
import setup from 'turtle/setup';
import { checkShouldExit, setShouldExit, turtleVersion } from 'turtle/turtleContext';
import { getRedisClient, RedisClient } from 'turtle/utils/redis';
import { getRedisClient } from 'turtle/utils/redis';
const REDIS_TURTLE_VERSION_KEY = 'turtle:version';
const REDIS_TURTLE_SUPPORTED_SDK_VERSIONS_KEY = `turtle:${config.platform}:sdkVersions`;
process.on('unhandledRejection', (err) => logger.error({ err }, 'Unhandled promise rejection'));
@@ -35,11 +37,14 @@ async function main() {
}
try {
const redis = await getRedisClient(RedisClient.Configuration);
const redis = await getRedisClient();
await redis.set(REDIS_TURTLE_VERSION_KEY, turtleVersion);
logger.info(`Register Turtle version ${turtleVersion} in Redis`);
logger.info(`Registered Turtle version (${turtleVersion}) in Redis`);
const sdkVersions = (await findSupportedSdkVersions(config.platform)).join(',');
await redis.set(REDIS_TURTLE_SUPPORTED_SDK_VERSIONS_KEY, sdkVersions);
logger.info(`Registered supported SDK versions (${sdkVersions}) in Redis`);
} catch (err) {
logger.error({ err }, 'Failed to register Turtle version in Redis');
logger.error({ err }, 'Failed to set versions in Redis');
}
while (true) {
+263 -541
View File
File diff suppressed because it is too large. Load diff