@getik-public/cli 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ### v1.4.0
2
+ - Parameter `--platform` is now optional, but only when used with `--syncOnly`.
3
+ - Parameter `--syncOnly` now will run `cap sync` for all platforms if `--platform` parameter is missing.
4
+ - Added new parameter for `ios` called `--releaseTesting`. This parameter will look for `${environment}-export-options.testing.plist` file instead of regular one. This file should be configured for external distribution instead of store.
5
+ - Improvement for `ios` build time, exclude `validate-app` if build type is `Debug`.
6
+
7
+
8
+ ### v1.3.3
9
+ Allow version commit to contain extra details, for example version was incremented after a rebase so extra details will be added about rebased commits.
10
+
11
+
12
+ ### v1.3.2
13
+ Fix for windows. `file:\\` in front was getting altered in path normalize function. Changed to simple string concatenation.
14
+
15
+
1
16
  ### v1.3.1
2
17
  Fixed bug on release branch check
3
18
 
package/README.md CHANGED
@@ -20,13 +20,14 @@ Add next line in your `package.json` file under `devDependencies`:
20
20
  Example: `getik-cli mobile-build -p android -e getikDebug --syncOnly`
21
21
  Example: `getik-cli mobile-build --platform ios --environment getik --upload`
22
22
 
23
- | Option | Required | Values | Description |
24
- |-----------------------|----------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
25
- | `-p`, `--platform` | YES | `android`, `ios` | Platform to build for. |
23
+ | Option | Required | Values | Description |
24
+ |---------------------|----------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
25
+ | `-p`, `--platform` | NO | `android`, `ios` | Platform to build for. |
26
26
  | `-e`, `--environment` | YES | `<string>`, `<string>Debug` | While environment can be any name, be consistent and use these: `getik`, `vbox`, `qa`, `prod`. Every environment must have a pair for debug build, so have these environments also defined: `getikDebug`, `vboxDebug`, `qaDebug`, `prodDebug` |
27
- | `--syncOnly` | NO | `-` | For development only, if you need to apply javascript build, or a new plugin was added. This will not go further to trigger an build script. |
28
- | `--aab` | NO | `-` | For `--platform android` only. Build `aab` file instead of `apk` file. |
29
- | `--upload` | NO | `-` | For `--platform ios` only. Instant upload to store after build, if successful. |
27
+ | `--syncOnly` | NO | `-` | For development only, if you need to apply javascript build, or a new plugin was added. This will not go further to trigger an android or ios build script. If `--platform` missing it will run `cap sync` for all platforms. |
28
+ | `--aab` | NO | `-` | For `--platform android` only. Build `aab` file instead of `apk` file. |
29
+ | `--upload` | NO | `-` | For `--platform ios` only. Instant upload to store after build, if successful. |
30
+ | `--releaseTesting` | NO | `-` | For `--platform ios` only. Will apply `*-export-options.testing.plist` file instead of `*-export-options.plist`. |
30
31
 
31
32
 
32
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getik-public/cli",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -200,28 +200,30 @@ function createCommandsForIos(options) {
200
200
  const config = (debugMode ? 'Debug' : 'Release');
201
201
  const environment = (options.environment.split('Debug')[0]);
202
202
  const archive = `./build/archive/${environment}.xcarchive`;
203
- const exportPlist = `./${environment}-export-options.plist`;
203
+ const exportPlist = `./${environment}-export-options${options.releaseTesting ? '.testing' : ''}.plist`;
204
204
  const build = `./build/exported`;
205
205
  const removeBuildFolderCommand = 'rm -rf ./build';
206
206
  const archiveCommand = `xcodebuild -workspace ${workspace} -scheme ${environment} -sdk iphoneos -configuration ${config} archive -archivePath ${archive} -allowProvisioningUpdates -quiet`;
207
207
  const exportCommand = `xcodebuild -exportArchive -archivePath ${archive} -exportPath ${build} -exportOptionsPlist ${exportPlist} -allowProvisioningUpdates -quiet`;
208
208
  const commands = [removeBuildFolderCommand, archiveCommand, exportCommand];
209
209
 
210
- try {
211
- const sensitiveDataBuffer = fs.readFileSync(path.join('ios', 'sensitive-data.json'));
212
- const sensitiveData = JSON.parse(sensitiveDataBuffer);
213
- const username = sensitiveData[environment].username;
214
- const password = sensitiveData[environment].password;
215
- const validateIpaCommand = `xcrun altool --validate-app -t ios -f ${build}/${environment}.ipa -u ${username} -p ${password}`;
216
- commands.push(validateIpaCommand);
217
-
218
- if (options.upload) {
219
- const uploadAppCommand = `xcrun altool --upload-app -t ios -f ${build}/${environment}.ipa -u ${username} -p ${password}`;
220
- commands.push(uploadAppCommand);
210
+ if (!debugMode) {
211
+ try {
212
+ const sensitiveDataBuffer = fs.readFileSync(path.join('ios', 'sensitive-data.json'));
213
+ const sensitiveData = JSON.parse(sensitiveDataBuffer);
214
+ const username = sensitiveData[environment].username;
215
+ const password = sensitiveData[environment].password;
216
+ const validateIpaCommand = `xcrun altool --validate-app -t ios -f ${build}/${environment}.ipa -u ${username} -p ${password}`;
217
+ commands.push(validateIpaCommand);
218
+
219
+ if (options.upload) {
220
+ const uploadAppCommand = `xcrun altool --upload-app -t ios -f ${build}/${environment}.ipa -u ${username} -p ${password}`;
221
+ commands.push(uploadAppCommand);
222
+ }
223
+ } catch(error) {
224
+ const message = `File "./ios/sensitive-data.json" not found or has an invalid JSON structure.`;
225
+ throw new Error(message);
221
226
  }
222
- } catch(error) {
223
- const message = `File "./ios/sensitive-data.json" not found or has an invalid JSON structure.`;
224
- throw new Error(message);
225
227
  }
226
228
 
227
229
  return commands;
@@ -300,7 +302,11 @@ function createCliCommands(options) {
300
302
  const capacitorSync = () => {
301
303
  process.env.NODE_ENV = options.environment;
302
304
 
303
- return `cap sync ${options.platform}`;
305
+ if(options.platform) {
306
+ return `cap sync ${options.platform}`;
307
+ } else {
308
+ return 'cap sync';
309
+ }
304
310
  };
305
311
  const cliCommands = {
306
312
  buildAngular: buildAngular,
@@ -536,7 +542,7 @@ function checkVersionInCommit(versions, callback) {
536
542
  checkFailed = true;
537
543
  } else {
538
544
  const expectedMessage = `APP VERSION UPDATE: versionName: ${versions.versionName}`;
539
- if (commitMessage === expectedMessage) {
545
+ if (commitMessage && commitMessage.indexOf(expectedMessage) === 0) {
540
546
  console.log('\x1b[32m PASSED! \x1b[0m');
541
547
  checkFailed = false;
542
548
  } else {
@@ -576,11 +582,12 @@ function checkLintErrors(callback) {
576
582
  export const mobileBuild = () => {
577
583
  program
578
584
  .command('mobile-build')
579
- .requiredOption('-p, --platform <type>', 'Platform: android, ios')
580
585
  .requiredOption('-e, --environment <type>', 'Environment: getik, getikDebug')
586
+ .option('-p, --platform <type>', 'Platform: android, ios. Can be empty is --syncOnly is used')
581
587
  .option('--syncOnly', 'Apply capacitor sync only, without platform build')
582
588
  .option('--aab', 'Android platform only, final build as AAB')
583
589
  .option('--upload', 'iOS platform only, upload directly to AppStore')
590
+ .option('--releaseTesting', 'iOS platform only, will apply "*-export-options.testing.plist" file instead of "*-export-options.plist"')
584
591
  .option('--force', 'Skip all checks for builds of type release')
585
592
  .action((options) => {
586
593
  console.log('INPUT OPTIONS: ', options);
@@ -596,8 +603,8 @@ export const mobileBuild = () => {
596
603
  applyVersionForIos(versions);
597
604
  }
598
605
  applyPatchersForExternalNpmPackages().then(() => {
599
- runCliCommand(cliCommands.buildAngular, function () {
600
- runCliCommand(cliCommands.capacitorSync(), function () {
606
+ runCliCommand(cliCommands.buildAngular, function() {
607
+ runCliCommand(cliCommands.capacitorSync(), function() {
601
608
  runCliCommandList(cliCommands.buildApp, options.platform, () => {
602
609
  setTimeout(() => {
603
610
  copyFinalBuildToRootFolder(options);