Skip to content

Cherry-pick fixes from master #3263

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 4 commits into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions PublicAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ const liveSyncData = {
projectDir,
skipWatcher: false,
watchAllFiles: false,
bundle: false,
release: false,
useLiveEdit: false
};

Expand Down
8 changes: 0 additions & 8 deletions lib/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,6 @@ interface IInfoService {
printComponentsInfo(): Promise<void>;
}

/**
* Describes standard username/password type credentials.
*/
interface ICredentials {
username: string;
password: string;
}

/**
* Describes properties needed for uploading a package to iTunes Connect
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/definitions/livesync.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ interface ILiveSyncDeviceInfo extends IOptionalOutputPath, IOptionalDebuggingOpt
/**
* Describes a LiveSync operation.
*/
interface ILiveSyncInfo extends IProjectDir, IEnvOptions {
interface ILiveSyncInfo extends IProjectDir, IEnvOptions, IBundle, IRelease {
/**
* Defines if the watcher should be skipped. If not passed, fs.Watcher will be started.
*/
Expand Down Expand Up @@ -152,7 +152,7 @@ interface IProjectDataComposition {
/**
* Desribes object that can be passed to ensureLatestAppPackageIsInstalledOnDevice method.
*/
interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions {
interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions, IBundle, IRelease {
device: Mobile.IDevice;
preparedPlatforms: string[];
rebuiltInformation: ILiveSyncBuildInfo[];
Expand Down
8 changes: 7 additions & 1 deletion lib/services/analytics/google-analytics-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
constructor(private clientId: string,
private $staticConfig: IStaticConfig,
private $analyticsSettingsService: IAnalyticsSettingsService,
private $logger: ILogger) {
private $logger: ILogger,
private $proxyService: IProxyService) {
}

public async trackHit(trackInfo: IGoogleAnalyticsData): Promise<void> {
Expand All @@ -27,11 +28,16 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
}

private async track(gaTrackingId: string, trackInfo: IGoogleAnalyticsData, sessionId: string): Promise<void> {
const proxySettings = await this.$proxyService.getCache();
const proxy = proxySettings && proxySettings.proxy;
const visitor = ua({
tid: gaTrackingId,
cid: this.clientId,
headers: {
["User-Agent"]: this.$analyticsSettingsService.getUserAgentString(`tnsCli/${this.$staticConfig.version}`)
},
requestOptions: {
proxy
}
});

Expand Down
5 changes: 3 additions & 2 deletions lib/services/livesync/livesync-command-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
this.$iosDeviceOperations.setShouldDispose(false);
}

if (this.$options.release || this.$options.bundle) {
if (this.$options.release) {
await this.runInReleaseMode(platform);
return;
}
Expand Down Expand Up @@ -75,11 +75,12 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
skipWatcher: !this.$options.watch,
watchAllFiles: this.$options.syncAllFiles,
clean: this.$options.clean,
bundle: !!this.$options.bundle,
release: this.$options.release,
env: this.$options.env
};

await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo);

}

private async runInReleaseMode(platform: string): Promise<void> {
Expand Down
8 changes: 6 additions & 2 deletions lib/services/livesync/livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
const prepareInfo: IPreparePlatformInfo = {
platform,
appFilesUpdaterOptions: {
bundle: false,
release: false,
bundle: options.bundle,
release: options.release,
},
projectData: options.projectData,
env: options.env,
Expand Down Expand Up @@ -459,6 +459,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
deviceBuildInfoDescriptor,
liveSyncData,
settings,
bundle: liveSyncData.bundle,
release: liveSyncData.release,
env: liveSyncData.env
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });

Expand Down Expand Up @@ -564,6 +566,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
deviceBuildInfoDescriptor,
settings: latestAppPackageInstalledSettings,
modifiedFiles: allModifiedFiles,
bundle: liveSyncData.bundle,
release: liveSyncData.release,
env: liveSyncData.env
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });

Expand Down
4 changes: 4 additions & 0 deletions lib/services/test-execution-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ class TestExecutionService implements ITestExecutionService {
projectDir: projectData.projectDir,
skipWatcher: !this.$options.watch || this.$options.justlaunch,
watchAllFiles: this.$options.syncAllFiles,
bundle: !!this.$options.bundle,
release: this.$options.release,
env: this.$options.env
};

Expand Down Expand Up @@ -248,6 +250,8 @@ class TestExecutionService implements ITestExecutionService {
projectDir: projectData.projectDir,
skipWatcher: !this.$options.watch || this.$options.justlaunch,
watchAllFiles: this.$options.syncAllFiles,
bundle: !!this.$options.bundle,
release: this.$options.release,
env: this.$options.env
};

Expand Down
145 changes: 140 additions & 5 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"marked-terminal": "2.0.0",
"minimatch": "3.0.2",
"mkdirp": "0.5.1",
"moment": "2.10.6",
"mute-stream": "0.0.5",
"open": "0.0.5",
"osenv": "0.1.3",
Expand All @@ -64,6 +63,7 @@
"plistlib": "0.2.1",
"progress-stream": "1.1.1",
"properties-parser": "0.2.3",
"proxy-lib": "0.2.0",
"qr-image": "3.2.0",
"request": "2.81.0",
"semver": "5.3.0",
Expand Down Expand Up @@ -113,6 +113,6 @@
},
"license": "Apache-2.0",
"engines": {
"node": ">=6.0.0 <9.0.0"
"node": ">=6.0.0 <10.0.0"
}
}