-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
32 lines (26 loc) · 1.11 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2015-present 650 Industries. All rights reserved.
'use strict';
const gulp = require('gulp');
const minimist = require('minimist');
const { ImageUtils, IosShellApp } = require('@expo/xdl');
const argv = minimist(process.argv.slice(2));
function createIOSShellAppWithArguments() {
setImageFunctions();
if (argv.action === 'build') {
return IosShellApp.buildAndCopyArtifactAsync(argv);
} else if (argv.action === 'configure') {
return IosShellApp.configureAndCopyArchiveAsync(argv);
} else if (argv.action === 'create-workspace') {
return IosShellApp.createTurtleWorkspaceAsync(argv);
} else {
throw new Error(`Unsupported action '${argv.action}'.`);
}
}
function setImageFunctions() {
const { resizeIconWithSharpAsync, getImageDimensionsWithSharpAsync } = require('./image-helpers');
console.info('ImageUtils: setting image functions to alternative sharp implementations');
ImageUtils.setResizeImageFunction(resizeIconWithSharpAsync);
ImageUtils.setGetImageDimensionsFunction(getImageDimensionsWithSharpAsync);
}
// iOS
gulp.task('ios-shell-app', createIOSShellAppWithArguments);