Skip to content

feat: support only webpack workflow #4550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 156 commits into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
2f8a11c
chore: remove the code related to js prepare as webpack overrides pre…
Fatme Apr 10, 2019
573da91
Merge pull request #4516 from NativeScript/fatme/remove-prepareJS
Apr 10, 2019
6054866
chore: remove platformTemplate logic
Fatme Apr 10, 2019
7fb1752
Merge pull request #4517 from NativeScript/fatme/remove-projectTemplate
Apr 10, 2019
3a61cee
chore: remove the legacy code from android-project-service
Fatme Apr 10, 2019
14ed5f0
Merge pull request #4520 from NativeScript/fatme/remove-android-legac…
Apr 10, 2019
f918e28
chore: delete plugin variables service
Fatme Apr 10, 2019
7a68fa7
Merge pull request #4521 from NativeScript/fatme/plugin-variables
Apr 10, 2019
4eee604
chore: remove legacy code from ios-project-service
Fatme Apr 11, 2019
88bbeeb
Merge pull request #4529 from NativeScript/fatme/remove-legacy-code
Apr 12, 2019
99a5ec8
refactor: refactor gradle related part of android-project-service
Fatme Apr 13, 2019
599eb02
test: add tests and fix existing ones
Fatme Apr 13, 2019
0f8e88e
chore: remove the support for android < 3.4.0
Fatme Apr 13, 2019
ed0343a
chore: fix PR comments
Fatme Apr 16, 2019
f67e079
Merge pull request #4537 from NativeScript/fatme/gradle
Apr 17, 2019
31d9f4c
chore: automate publish of webpack tag
Fatme Apr 19, 2019
204f398
Merge pull request #4549 from NativeScript/fatme/webpack-tag
Apr 19, 2019
535e296
fix: fix the unit tests execution with istanbul
Fatme Apr 22, 2019
a695d94
Merge pull request #4555 from NativeScript/fatme/fix-unit-tests
Apr 22, 2019
7846bce
Merge branch 'master' into feature/webpack-only
Fatme Apr 22, 2019
3786e42
refactor: refactor xcodebuild related part of ios-project-service
Fatme Apr 21, 2019
1232e2b
test: add unit tests
Fatme Apr 21, 2019
d5c9e09
chore: fix PR comments
Fatme Apr 22, 2019
cec7c99
Merge pull request #4554 from NativeScript/fatme/xcode
Apr 23, 2019
89c5f6c
WIP
Fatme Apr 25, 2019
fb47b68
refactor: refactor platform add, platform prepare and platform build …
Fatme Apr 27, 2019
e295df8
feat: introduce initialSync workflow
Fatme Apr 28, 2019
3e44606
feat: introduce workflowDataService in order to handle the creation o…
Fatme May 1, 2019
68187de
chore: remove platform-workflow-service
Fatme May 1, 2019
eb52dd9
chore: add preparePlatformService and remove platformJSService and pl…
Fatme May 3, 2019
faaf337
refactor: refactor refreshApplication service
Fatme May 3, 2019
0e4109b
refactor: refactor bundleWorkflowService to mainController
Fatme May 3, 2019
73ee306
chore: rename deviceInstallAppService and deviceRefreshAppService so …
Fatme May 3, 2019
22f594e
refactor: introduce separate run-on-devices-controller
Fatme May 4, 2019
64427e9
refactor: extract debug specific logic to separate service
Fatme May 4, 2019
f2caa9d
chore: emit runOnDeviceStopperEvent
Fatme May 4, 2019
2b8d62c
feat: add env support to webpackCompilerService
Fatme May 4, 2019
042a043
feat: add support for fallbackFiles + hmr mode
Fatme May 5, 2019
e85daf7
fix: fix deploy command
Fatme May 5, 2019
046d6e9
fix: remove unneeded interfaces
Fatme May 5, 2019
f5f0836
feat: stop webpack and native watchers on stopRunOnDevices()
Fatme May 5, 2019
ed8410a
feat: remove preview-sync hook and integrate preview command to work …
Fatme May 5, 2019
29d7ad9
fix: remove livesyncService
Fatme May 5, 2019
4a9c967
fix: fix typo error in debugggingEnabled
Fatme May 5, 2019
2410493
fix: fix mainController tests, delete test/livesync-service and move …
Fatme May 5, 2019
666044d
refactor: refactor the prepare-platform tests
Fatme May 6, 2019
6ba3274
test: fix unit tests
Fatme May 6, 2019
762fcd6
fix: build the platform when there are native changes on initial sync…
Fatme May 8, 2019
6769a81
chore: fix lint errors
Fatme May 8, 2019
e6c7f98
chore: fix show the log needed from preview tests
Fatme May 9, 2019
66cfacf
fix: fix the initial sync to preview app
Fatme May 9, 2019
40d5b56
feat: introduce controller for each command
Fatme May 14, 2019
4fc6b8e
fix: rename platformsData to platformsDataService
Fatme May 15, 2019
297814e
fix: fix PR comments
Fatme May 17, 2019
d133c8b
Merge pull request #4591 from NativeScript/fatme/bundle-workflow
Fatme May 17, 2019
81efc59
Merge branch 'master' into feature/webpack-only
Fatme May 17, 2019
0341a15
feat: don't leak android debugging session and remove deprecated meth…
Fatme May 17, 2019
da752d0
fix: move buildinfo related logic to buildInfoFileService
Fatme May 18, 2019
44eb3c5
feat: introduce debugController
Fatme May 20, 2019
8fb4330
Merge pull request #4627 from NativeScript/fatme/merge-master-webpack
May 21, 2019
081fe18
fix: set bundle option to webpack
Fatme May 21, 2019
2874b0b
Merge pull request #4634 from NativeScript/fatme/set-bundle-options
Fatme May 21, 2019
f2d1655
feat: expose public API
Fatme May 30, 2019
5cec974
test: fix unit tests
Fatme May 30, 2019
3692d83
fix: respect App_Resources directly from project
Fatme May 31, 2019
cee7487
fix: pass --env.verbose to webpack compiler
Fatme May 31, 2019
39cccad
Merge pull request #4659 from NativeScript/fatme/verbose
Fatme May 31, 2019
ad08b81
Merge pull request #4657 from NativeScript/fatme/app-resources
Fatme May 31, 2019
897b2a4
fix: prepare the project only once per run
Fatme May 31, 2019
707992a
fix: fix "InstallationLookupFailed" error when deploying on iOS device
Fatme May 31, 2019
4350fa1
Merge pull request #4655 from NativeScript/fatme/expose-public-api
Fatme May 31, 2019
c119d3e
Merge pull request #4662 from NativeScript/fatme/fix-installation-loo…
Fatme May 31, 2019
75085a4
Merge pull request #4661 from NativeScript/fatme/fix-build
Fatme May 31, 2019
045df51
feat: set webpack in production mode based on `--release` option
Fatme May 31, 2019
b5dcf44
Merge pull request #4660 from NativeScript/fatme/webpack-production-mode
Fatme May 31, 2019
1937b7a
fix: fix the application crash on device on deploy command
Fatme May 31, 2019
a30bedb
Merge pull request #4663 from NativeScript/fatme/fix-crash-on-deploy
rosen-vladimirov Jun 3, 2019
72d5f6d
fix: fix cloud run command
Fatme Jun 3, 2019
6a28d8f
Merge pull request #4672 from NativeScript/fatme/cloud-run
rosen-vladimirov Jun 4, 2019
8ebfe6c
refactor: remove IAndroidBuildConfig and use IAndroidBuildData instead
Fatme Jun 5, 2019
dcd50ae
fix: pass correct keyStore* args when building in release mode
Fatme Jun 5, 2019
4b653c6
fix: fix run with --justlaunch
Fatme Jun 5, 2019
1ca0cf2
Merge pull request #4678 from NativeScript/fatme/fix-justlaunch
Fatme Jun 5, 2019
ff4ab70
Merge pull request #4677 from NativeScript/fatme/fix-release-run
Fatme Jun 5, 2019
6090362
feat: remove init command
Fatme Jun 5, 2019
86d1858
fix: check only platforms folders of nativescript's plugins on checkF…
Fatme Jun 3, 2019
a698405
refactor: remove modulesChange property
Fatme Jun 3, 2019
ed7b3d5
fix: stop checking for newer files if a plugin with native change is …
Fatme Jun 3, 2019
dbd37f3
refactor: remove fileChangeRequiresBuild function
Fatme Jun 3, 2019
7e79e0b
fix: fix plugin development workflow
Fatme Jun 5, 2019
74a0edb
fix: fix tns preview
Fatme Jun 5, 2019
97d4cb6
Merge pull request #4682 from NativeScript/fatme/fix-preview
Fatme Jun 5, 2019
96c7cd7
fix: handle correctly runtime files
Fatme Jun 5, 2019
5981c2c
Merge pull request #4680 from NativeScript/fatme/remove-init
Fatme Jun 5, 2019
c198956
Merge pull request #4683 from NativeScript/fatme/handle-runtime-files
Fatme Jun 6, 2019
ddf89d8
chore: fix PR comments
Fatme Jun 6, 2019
edd0fae
Merge pull request #4671 from NativeScript/fatme/project-changes
Fatme Jun 6, 2019
311fdf2
Merge branch 'master' into fatme/merge-master
Fatme Jun 6, 2019
aad09a3
Merge pull request #4686 from NativeScript/fatme/merge-master
Jun 6, 2019
bad1fcb
fix: respect `--for-device` option when building for iOS device
Fatme Jun 7, 2019
66fa28b
Merge pull request #4690 from NativeScript/fatme/build-for-device
Fatme Jun 10, 2019
013817b
fix: emit only `bundle.<hash>.hot-update.js` and `<hash>.hot-update.j…
Fatme Jun 7, 2019
6ef6998
fix: enable source maps by default
Fatme Jun 11, 2019
abc74f1
Merge pull request #4703 from NativeScript/fatme/enable-source-maps
Fatme Jun 11, 2019
1d05dae
Merge pull request #4689 from NativeScript/fatme/hot-update-files
Fatme Jun 11, 2019
91415e9
fix: fix cannot read property sourceMap of undefined
Fatme Jun 11, 2019
4cbd349
fix: ensure dependencies are installed before executing webpack
Fatme Jun 11, 2019
e6e0aad
fix: add preview-sync hook as nativescript-kinvey-sdk plugin uses it
Fatme Jun 11, 2019
68246f8
fix: add watchPatterns hook as some plugins relies on it
Fatme Jun 11, 2019
3c2195f
Merge pull request #4708 from NativeScript/fatme/fix-source-of-undefined
Fatme Jun 11, 2019
0b1d6cd
chore: fix tests
Fatme Jun 11, 2019
b30ab1e
Merge pull request #4710 from NativeScript/fatme/hooks
Fatme Jun 11, 2019
b8e4eae
fix: populate correctly prepareData and buildData when they are based…
Fatme Jun 11, 2019
b95b7ca
fix: fix plugin's development workflow
Fatme Jun 11, 2019
4066ecc
chore: fix tests
Fatme Jun 11, 2019
2dc7a81
chore: fix PR comments
Fatme Jun 12, 2019
538179b
Merge pull request #4712 from NativeScript/fatme/populate-options-cor…
Fatme Jun 12, 2019
3531838
Merge pull request #4709 from NativeScript/fatme/ensure-dependencies-…
Fatme Jun 12, 2019
418b72b
Merge pull request #4711 from NativeScript/fatme/fix-plugin-workflow
Jun 12, 2019
2c5abd5
Merge branch 'master' into fatme/mmwo
Fatme Jun 12, 2019
4e34163
Merge pull request #4715 from NativeScript/fatme/mmwo
Jun 13, 2019
1e4415b
fix: increase the max process's size in order to prevent "JavaScript …
Fatme Jun 13, 2019
f7f47a3
Merge pull request #4716 from NativeScript/fatme/max-size
Jun 13, 2019
5f3dd1b
fix: extend process's max size only for `x64` processes
Fatme Jun 13, 2019
f925e24
fix: save correct .nsprepareinfo file from cloud commands
Fatme Jun 13, 2019
9de2c48
chore: fix tests
Fatme Jun 13, 2019
ac38f16
Merge pull request #4719 from NativeScript/fatme/fix-cloud-build
Jun 13, 2019
de7d52c
Merge pull request #4717 from NativeScript/fatme/max-size-2
Fatme Jun 14, 2019
9075b88
fix: fix the way android appResources are processed
Fatme Jun 15, 2019
4b971de
fix: restore application when the broken xml file is fixed
Fatme Jun 15, 2019
dfaf494
fix: build only once when there are more than one android devices
Fatme Jun 15, 2019
bb3486f
fix: fix deploy on iOS devices
Fatme Jun 17, 2019
8de2558
Merge pull request #4728 from NativeScript/fatme/fix-deploy
rosen-vladimirov Jun 17, 2019
88a66ac
Merge pull request #4725 from NativeScript/fatme/fix-xml-restore
rosen-vladimirov Jun 17, 2019
896f959
fix: respect skipWatcher option when setting a value to watch option
Fatme Jun 15, 2019
d68af4a
Merge pull request #4723 from NativeScript/fatme/fix-snapshot
Fatme Jun 17, 2019
e5f9d45
Merge pull request #4727 from NativeScript/fatme/fix-rebuilt
Fatme Jun 17, 2019
23a9fa2
fix: fix platform clean when there is a platform with specific versio…
Fatme Jun 17, 2019
1b21b95
fix: fix platform list command
Fatme Jun 17, 2019
6a565cf
fix: fix the workflow of preview-sync hook
Fatme Jun 18, 2019
fc74281
Merge pull request #4734 from NativeScript/fatme/fix-preview-sync-hook
rosen-vladimirov Jun 18, 2019
127512f
Merge pull request #4733 from NativeScript/fatme/fix-platform-commands
rosen-vladimirov Jun 18, 2019
2f214b6
fix: copy Android App_Resources only once
rosen-vladimirov Jun 18, 2019
76dc9c4
Merge pull request #4724 from NativeScript/fatme/fix-android-app-reso…
Jun 18, 2019
b010e00
fix: show warning when --env.snapshot is provided for debug builds
Fatme Jun 18, 2019
1eb3496
chore: fix PR comments
Fatme Jun 18, 2019
2022717
Merge pull request #4736 from NativeScript/fatme/fix-debug-snapshot
Fatme Jun 18, 2019
22eecad
fix: enable passing iOS codesigning options to LiveSync operations
rosen-vladimirov Jun 18, 2019
065bd14
fix: initialize nativeChanged with true when checking for changes
Fatme Jun 18, 2019
8d95920
Merge pull request #4740 from NativeScript/fatme/default-native-changed
Fatme Jun 18, 2019
4970d21
fix: install app on device when there is native change during livesync
Fatme Jun 19, 2019
745c8cb
fix: fix `tns deploy ios --justlaunch` when there are connected devic…
Fatme Jun 19, 2019
39c54c3
fix: set correct nativePrepare value
rosen-vladimirov Jun 19, 2019
53641b8
fix: add missing await
rosen-vladimirov Jun 19, 2019
b1047af
Merge pull request #4743 from NativeScript/fatme/fix-deploy-2-devices
Fatme Jun 19, 2019
d9241f8
Merge pull request #4738 from NativeScript/vladimirov/fix-provision
Jun 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ branches:
- master
- release
- release-patch
- feature/webpack-only
env:
global:
- DATE=$(date +%Y-%m-%d)
Expand Down
3 changes: 3 additions & 0 deletions .travis/add-publishConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ switch (branch) {
case "master":
packageDef.publishConfig.tag = "next";
break;
case "feature/webpack-only":
packageDef.publishConfig.tag = "webpack";
break;
default:
throw new Error(`Unable to publish as the branch ${branch} does not have corresponding tag. Supported branches are master (next tag), release (rc tag) and release-patch (patch tag)`);
}
Expand Down
5 changes: 0 additions & 5 deletions PublicAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,11 +666,6 @@ interface IDebugData {
*/
applicationIdentifier: string;

/**
* Path to .app built for iOS Simulator.
*/
pathToAppPackage?: string;

/**
* The name of the application, for example `MyProject`.
*/
Expand Down
25 changes: 0 additions & 25 deletions docs/man_pages/project/creation/init.md

This file was deleted.

49 changes: 34 additions & 15 deletions lib/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ $injector.require("performanceService", "./services/performance-service");
$injector.requirePublic("projectService", "./services/project-service");
$injector.require("androidProjectService", "./services/android-project-service");
$injector.require("androidPluginBuildService", "./services/android-plugin-build-service");
$injector.require("gradleCommandService", "./services/android/gradle-command-service");
$injector.require("gradleBuildService", "./services/android/gradle-build-service");
$injector.require("gradleBuildArgsService", "./services/android/gradle-build-args-service");
$injector.require("iOSEntitlementsService", "./services/ios-entitlements-service");
$injector.require("iOSExtensionsService", "./services/ios-extensions-service");
$injector.require("iOSWatchAppService", "./services/ios-watch-app-service");
$injector.require("iOSProjectService", "./services/ios-project-service");
$injector.require("iOSProvisionService", "./services/ios-provision-service");
$injector.require("xcconfigService", "./services/xcconfig-service");
$injector.require("iOSSigningService", "./services/ios/ios-signing-service");
$injector.require("xcodebuildArgsService", "./services/ios/xcodebuild-args-service");
$injector.require("xcodebuildCommandService", "./services/ios/xcodebuild-command-service");
$injector.require("xcodebuildService", "./services/ios/xcodebuild-service");
$injector.require("exportOptionsPlistService", "./services/ios/export-options-plist-service");

$injector.require("cocoapodsService", "./services/cocoapods-service");
$injector.require("cocoaPodsPlatformManager", "./services/cocoapods-platform-manager");
Expand All @@ -25,13 +33,31 @@ $injector.require("projectTemplatesService", "./services/project-templates-servi
$injector.require("projectNameService", "./services/project-name-service");
$injector.require("tnsModulesService", "./services/tns-modules-service");

$injector.require("platformsData", "./platforms-data");
$injector.require("platformService", "./services/platform-service");
$injector.require("preparePlatformJSService", "./services/prepare-platform-js-service");
$injector.require("preparePlatformNativeService", "./services/prepare-platform-native-service");
$injector.require("platformsDataService", "./services/platforms-data-service");
$injector.require("addPlatformService", "./services/platform/add-platform-service");
$injector.require("buildInfoFileService", "./services/build-info-file-service");
$injector.require("prepareNativePlatformService", "./services/platform/prepare-native-platform-service");
$injector.require("platformValidationService", "./services/platform/platform-validation-service");

$injector.require("buildArtefactsService", "./services/build-artefacts-service");

$injector.require("deviceInstallAppService", "./services/device/device-install-app-service");

$injector.require("platformController", "./controllers/platform-controller");
$injector.require("prepareController", "./controllers/prepare-controller");
$injector.require("deployController", "./controllers/deploy-controller");
$injector.requirePublicClass("buildController", "./controllers/build-controller");
$injector.requirePublicClass("runController", "./controllers/run-controller");
$injector.requirePublicClass("debugController", "./controllers/debug-controller");
$injector.requirePublicClass("previewAppController", "./controllers/preview-app-controller");

$injector.require("prepareDataService", "./services/prepare-data-service");
$injector.require("buildDataService", "./services/build-data-service");

$injector.require("liveSyncServiceResolver", "./resolvers/livesync-service-resolver");

$injector.require("liveSyncProcessDataService", "./services/livesync-process-data-service");
$injector.require("debugDataService", "./services/debug-data-service");
$injector.requirePublicClass("debugService", "./services/debug-service");
$injector.require("iOSDeviceDebugService", "./services/ios-device-debug-service");
$injector.require("androidDeviceDebugService", "./services/android-device-debug-service");

Expand All @@ -40,8 +66,6 @@ $injector.requirePublic("analyticsSettingsService", "./services/analytics-settin
$injector.require("analyticsService", "./services/analytics/analytics-service");
$injector.require("googleAnalyticsProvider", "./services/analytics/google-analytics-provider");

$injector.require("emulatorSettingsService", "./services/emulator-settings-service");

$injector.require("platformCommandParameter", "./platform-command-param");
$injector.requireCommand("create", "./commands/create-project");
$injector.requireCommand("generate", "./commands/generate");
Expand All @@ -59,8 +83,6 @@ $injector.requireCommand("debug|ios", "./commands/debug");
$injector.requireCommand("debug|android", "./commands/debug");

$injector.requireCommand("prepare", "./commands/prepare");
$injector.requireCommand("clean-app|ios", "./commands/clean-app");
$injector.requireCommand("clean-app|android", "./commands/clean-app");
$injector.requireCommand("build|ios", "./commands/build");
$injector.requireCommand("build|android", "./commands/build");
$injector.requireCommand("deploy", "./commands/deploy");
Expand Down Expand Up @@ -109,9 +131,6 @@ $injector.require("xcprojService", "./services/xcproj-service");
$injector.require("versionsService", "./services/versions-service");
$injector.requireCommand("install", "./commands/install");

$injector.require("projectInitService", "./services/project-init-service");
$injector.requireCommand("init", "./commands/init");

$injector.require("infoService", "./services/info-service");
$injector.requireCommand("info", "./commands/info");

Expand All @@ -127,17 +146,16 @@ $injector.require("bundleValidatorHelper", "./helpers/bundle-validator-helper");
$injector.require("androidBundleValidatorHelper", "./helpers/android-bundle-validator-helper");
$injector.require("liveSyncCommandHelper", "./helpers/livesync-command-helper");
$injector.require("deployCommandHelper", "./helpers/deploy-command-helper");
$injector.require("platformCommandHelper", "./helpers/platform-command-helper");
$injector.require("optionsTracker", "./helpers/options-track-helper");

$injector.requirePublicClass("localBuildService", "./services/local-build-service");
$injector.requirePublicClass("liveSyncService", "./services/livesync/livesync-service");
$injector.require("LiveSyncSocket", "./services/livesync/livesync-socket");
$injector.requirePublicClass("androidLivesyncTool", "./services/livesync/android-livesync-tool");
$injector.require("androidLiveSyncService", "./services/livesync/android-livesync-service");
$injector.require("iOSLiveSyncService", "./services/livesync/ios-livesync-service");
$injector.require("usbLiveSyncService", "./services/livesync/livesync-service"); // The name is used in https://github.com/NativeScript/nativescript-dev-typescript
$injector.require("previewAppFilesService", "./services/livesync/playground/preview-app-files-service");
$injector.require("previewAppLiveSyncService", "./services/livesync/playground/preview-app-livesync-service");
$injector.require("previewAppLogProvider", "./services/livesync/playground/preview-app-log-provider");
$injector.require("previewAppPluginsService", "./services/livesync/playground/preview-app-plugins-service");
$injector.require("previewSdkService", "./services/livesync/playground/preview-sdk-service");
Expand Down Expand Up @@ -191,11 +209,12 @@ $injector.require("hmrStatusService", "./services/hmr-status-service");
$injector.require("pacoteService", "./services/pacote-service");
$injector.require("qrCodeTerminalService", "./services/qr-code-terminal-service");
$injector.require("testInitializationService", "./services/test-initialization-service");
$injector.require("workflowService", "./services/workflow-service");

$injector.require("networkConnectivityValidator", "./helpers/network-connectivity-validator");
$injector.requirePublic("cleanupService", "./services/cleanup-service");

$injector.require("webpackCompilerService", "./services/webpack/webpack-compiler-service");

$injector.require("applePortalSessionService", "./services/apple-portal/apple-portal-session-service");
$injector.require("applePortalCookieService", "./services/apple-portal/apple-portal-cookie-service");
$injector.require("applePortalApplicationService", "./services/apple-portal/apple-portal-application-service");
Expand Down
13 changes: 7 additions & 6 deletions lib/commands/add-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ export class AddPlatformCommand extends ValidatePlatformCommandBase implements I
public allowedParameters: ICommandParameter[] = [];

constructor($options: IOptions,
$platformService: IPlatformService,
private $platformCommandHelper: IPlatformCommandHelper,
$platformValidationService: IPlatformValidationService,
$projectData: IProjectData,
$platformsData: IPlatformsData,
$platformsDataService: IPlatformsDataService,
private $errors: IErrors) {
super($options, $platformsData, $platformService, $projectData);
super($options, $platformsDataService, $platformValidationService, $projectData);
this.$projectData.initializeProjectData();
}

public async execute(args: string[]): Promise<void> {
await this.$platformService.addPlatforms(args, this.$options.platformTemplate, this.$projectData, this.$options, this.$options.frameworkPath);
await this.$platformCommandHelper.addPlatforms(args, this.$projectData, this.$options.frameworkPath);
}

public async canExecute(args: string[]): Promise<ICanExecuteCommandOutput> {
Expand All @@ -23,9 +24,9 @@ export class AddPlatformCommand extends ValidatePlatformCommandBase implements I

let canExecute = true;
for (const arg of args) {
this.$platformService.validatePlatform(arg, this.$projectData);
this.$platformValidationService.validatePlatform(arg, this.$projectData);

if (!this.$platformService.isPlatformSupportedForOS(arg, this.$projectData)) {
if (!this.$platformValidationService.isPlatformSupportedForOS(arg, this.$projectData)) {
this.$errors.fail(`Applications for platform ${arg} can not be built on this OS`);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/commands/appstore-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export class ListiOSApps implements ICommand {
private $logger: ILogger,
private $projectData: IProjectData,
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
private $platformService: IPlatformService,
private $platformValidationService: IPlatformValidationService,
private $errors: IErrors,
private $prompter: IPrompter) {
this.$projectData.initializeProjectData();
}

public async execute(args: string[]): Promise<void> {
if (!this.$platformService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
if (!this.$platformValidationService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
}

Expand Down
76 changes: 19 additions & 57 deletions lib/commands/appstore-upload.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { StringCommandParameter } from "../common/command-params";
import * as path from "path";
import { IOSProjectService } from "../services/ios-project-service";
import { StringCommandParameter } from "../common/command-params";
import { BuildController } from "../controllers/build-controller";
import { IOSBuildData } from "../data/build-data";

export class PublishIOS implements ICommand {
public allowedParameters: ICommandParameter[] = [new StringCommandParameter(this.$injector), new StringCommandParameter(this.$injector),
Expand All @@ -15,26 +16,18 @@ export class PublishIOS implements ICommand {
private $prompter: IPrompter,
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
private $hostInfo: IHostInfo,
private $errors: IErrors) {
private $errors: IErrors,
private $buildController: BuildController,
private $platformValidationService: IPlatformValidationService
) {
this.$projectData.initializeProjectData();
}

private get $platformsData(): IPlatformsData {
return this.$injector.resolve("platformsData");
}

// This property was introduced due to the fact that the $platformService dependency
// ultimately tries to resolve the current project's dir and fails if not executed from within a project
private get $platformService(): IPlatformService {
return this.$injector.resolve("platformService");
}

public async execute(args: string[]): Promise<void> {
let username = args[0];
let password = args[1];
const mobileProvisionIdentifier = args[2];
const codeSignIdentity = args[3];
const teamID = this.$options.teamId;
let ipaFilePath = this.$options.ipa ? path.resolve(this.$options.ipa) : null;

if (!username) {
Expand All @@ -54,55 +47,24 @@ export class PublishIOS implements ICommand {
}

this.$options.release = true;
const platform = this.$devicePlatformsConstants.iOS.toLowerCase();

if (!ipaFilePath) {
const platform = this.$devicePlatformsConstants.iOS;
// No .ipa path provided, build .ipa on out own.
const appFilesUpdaterOptions: IAppFilesUpdaterOptions = {
bundle: !!this.$options.bundle,
release: this.$options.release,
useHotModuleReload: false
};
const platformInfo: IPreparePlatformInfo = {
platform,
appFilesUpdaterOptions,
platformTemplate: this.$options.platformTemplate,
projectData: this.$projectData,
config: this.$options,
env: this.$options.env
};

if (mobileProvisionIdentifier || codeSignIdentity) {
const iOSBuildConfig: IBuildConfig = {
projectDir: this.$options.path,
release: this.$options.release,
device: this.$options.device,
provision: this.$options.provision,
teamId: this.$options.teamId,
buildForDevice: true,
iCloudContainerEnvironment: this.$options.iCloudContainerEnvironment,
mobileProvisionIdentifier,
codeSignIdentity
};
this.$logger.info("Building .ipa with the selected mobile provision and/or certificate.");
// This is not very correct as if we build multiple targets we will try to sign all of them using the signing identity here.
await this.$platformService.preparePlatform(platformInfo);
await this.$platformService.buildPlatform(platform, iOSBuildConfig, this.$projectData);
ipaFilePath = this.$platformService.lastOutputPath(platform, iOSBuildConfig, this.$projectData);
} else {
this.$logger.info("No .ipa, mobile provision or certificate set. Perfect! Now we'll build .xcarchive and let Xcode pick the distribution certificate and provisioning profile for you when exporting .ipa for AppStore submission.");
await this.$platformService.preparePlatform(platformInfo);

const platformData = this.$platformsData.getPlatformData(platform, this.$projectData);
const iOSProjectService = <IOSProjectService>platformData.platformProjectService;

const archivePath = await iOSProjectService.archive(this.$projectData);
this.$logger.info("Archive at: " + archivePath);
this.$logger.info("Building .ipa with the selected mobile provision and/or certificate.");

const exportPath = await iOSProjectService.exportArchive(this.$projectData, { archivePath, teamID, provision: mobileProvisionIdentifier || this.$options.provision });
this.$logger.info("Export at: " + exportPath);
// As we need to build the package for device
this.$options.forDevice = true;

ipaFilePath = exportPath;
const buildData = new IOSBuildData(this.$projectData.projectDir, platform, this.$options);
ipaFilePath = await this.$buildController.prepareAndBuild(buildData);
} else {
this.$logger.info("No .ipa, mobile provision or certificate set. Perfect! Now we'll build .xcarchive and let Xcode pick the distribution certificate and provisioning profile for you when exporting .ipa for AppStore submission.");
const buildData = new IOSBuildData(this.$projectData.projectDir, platform, { ...this.$options, buildForAppStore: true });
ipaFilePath = await this.$buildController.prepareAndBuild(buildData);
this.$logger.info(`Export at: ${ipaFilePath}`);
}
}

Expand All @@ -120,7 +82,7 @@ export class PublishIOS implements ICommand {
this.$errors.failWithoutHelp("iOS publishing is only available on Mac OS X.");
}

if (!this.$platformService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
if (!this.$platformValidationService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
}

Expand Down
Loading