Made several fixes/improvements
28
README.md
|
@ -22,7 +22,9 @@ There are several possible scenarios this extension solves:
|
|||
* After logging in click the App Center status bar to show possible menu options
|
||||
|
||||
![AppCenter Menu](images/appcenter-start-new-idea.png)
|
||||
* You will be prompted to enter a new for your project and select user or organization where you would like to create app in App Center
|
||||
* You will be prompted to enter a new name for your project and select user or organization where you would like to create app in App Center
|
||||
|
||||
![Enter New Name](images/appcenter-enter-new-name.png)
|
||||
* App Center sample app will be cloned into the repository you have provided (it will also have preconfigured for App Center Analytics/Crashes/CodePush SDK's)
|
||||
* Two React Native apps (for iOS and Android) will be created in App Center (`project-name-ios` and `project-name-android`)
|
||||
* CodePush deployments will be created for both apps
|
||||
|
@ -30,25 +32,34 @@ There are several possible scenarios this extension solves:
|
|||
* Changes will be pushed to your remote repository
|
||||
* New Testers Distribution Group will be created for every new app in App Center
|
||||
* App will be connected to your GH repository `master` branch and new build will be started
|
||||
* You will be notified when finished and also we will automatically run `npm install` for you
|
||||
* You will be notified when finished and also we will automatically run `npm install` and `pod update` for you
|
||||
|
||||
2. Link an existing react-native application to App Center.
|
||||
You will see a "Set Current App" option, when logged in.
|
||||
|
||||
![Set current app](images/appcenter-set-current-app.png)
|
||||
|
||||
You can either choose an app from App Center or choose it to be created for you.
|
||||
When you pick "Create an App Center app" option, several options are available:
|
||||
* Create an app for Android
|
||||
* Create an app for iOS
|
||||
* Create apps for both platforms
|
||||
|
||||
If you choose one of the first two, the app will be created and automatically set as current. If you choose to create two apps, you will have to pick one of them as current when a prompt is shown.
|
||||
|
||||
![Choose app](images/appcenter-choose-app.png)
|
||||
|
||||
When the app is linked to App Center, several new options appear in the menu:
|
||||
* Build
|
||||
* Test
|
||||
* Distribute
|
||||
* Crashes
|
||||
* Analytics
|
||||
|
||||
They all open the corresponding App Center tabs for the application. "Distribute" also contains CodePush stuff.
|
||||
|
||||
![App Center portal](images/appcenter-portal.png)
|
||||
|
||||
3. You would like to open already existing react-native application with CodePush installed. When logged in, the following App Center Menu options should be avaliable under "Distribute > CodePush":
|
||||
* Set current app for CodePush
|
||||
* Change current Deployment
|
||||
|
@ -56,6 +67,8 @@ There are several possible scenarios this extension solves:
|
|||
* Change if release should be mandatory
|
||||
* Make new CodePush release
|
||||
|
||||
![Code Push](images/appcenter-code-push.png)
|
||||
|
||||
## Test
|
||||
|
||||
If your React Native application has UI tests you can run it in the App Center cloud using the extension.
|
||||
|
@ -65,27 +78,24 @@ If your React Native application has UI tests you can run it in the App Center c
|
|||
In order to run the tests in App Center cloud you need [App Center CLI](https://github.com/Microsoft/appcenter-cli). To install it run `npm install -g appcenter-cli` in terminal.
|
||||
|
||||
#### iOS
|
||||
Currently, extension supports running of XCUI tests only. Please, follow [the instructions for App Center portal docs](https://docs.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/xcuitest) to prepare tests for uploading to the App Center cloud.
|
||||
Currently, extension supports running XCUI tests only. Please, follow [the instructions for App Center portal docs](https://docs.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/xcuitest) to prepare tests for uploading to the App Center cloud.
|
||||
|
||||
|
||||
### Running tests
|
||||
|
||||
1. Open **App Center menu** and then click **Test** button.
|
||||
|
||||
TODO image
|
||||
|
||||
2. To run tests you can use two options: `Run UI tests` and `Run UI tests asynchronously`. Command `Run UI tests` will start to build your application for testing, upload it together with tests to App Center cloud and then run it there waiting for tests to be done. Command `Run UI tests asynchronously` does the same thing except it exits the command when tests are uploaded, without waiting for test results. Choose the one you prefer the most. Also, you can track progress of command below in status bar.
|
||||
|
||||
TODO image
|
||||
![Test options](images/appcenter-test-options.png)
|
||||
|
||||
3. Select device configuration for tests.
|
||||
|
||||
TODO image
|
||||
![Test devices](images/appcenter-test-devices.png)
|
||||
|
||||
4. After that, `Output->React Native` window will be opened where you can monitor the progress of the build, upload and run the tests.
|
||||
|
||||
|
||||
TODO image
|
||||
![Test output](images/appcenter-test-output.png)
|
||||
|
||||
## Contributing
|
||||
There are a couple of ways you can contribute to this repo:
|
||||
|
|
После Ширина: | Высота: | Размер: 3.9 KiB |
После Ширина: | Высота: | Размер: 4.4 KiB |
После Ширина: | Высота: | Размер: 2.3 KiB |
После Ширина: | Высота: | Размер: 5.3 KiB |
После Ширина: | Высота: | Размер: 2.5 KiB |
После Ширина: | Высота: | Размер: 80 KiB |
После Ширина: | Высота: | Размер: 16 KiB |
После Ширина: | Высота: | Размер: 58 KiB |
После Ширина: | Высота: | Размер: 8.8 KiB |
|
@ -19,6 +19,9 @@ export default class AppCenterPortalMenu extends ReactNativeAppCommand {
|
|||
}
|
||||
|
||||
public async run(): Promise<void> {
|
||||
|
||||
// Disabling the check whether project has react-native package installed cause it's kinda useless here.
|
||||
this.checkForReact = false;
|
||||
if (!await super.run()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -120,6 +120,8 @@ export class Command {
|
|||
profile.currentApp = currentApp;
|
||||
return this.appCenterAuth.updateProfile(profile).then(() => {
|
||||
return currentApp;
|
||||
}).then(() => {
|
||||
this.manager.setupAppCenterStatusBar(profile);
|
||||
});
|
||||
} else {
|
||||
// No profile - not logged in?
|
||||
|
|
|
@ -13,6 +13,7 @@ export class ReactNativeAppCommand extends Command {
|
|||
protected currentAppMenuTarget: string = "MenuCurrentApp";
|
||||
protected static cachedApps: models.AppResponse[];
|
||||
protected userAlreadySelectedApp: boolean;
|
||||
protected checkForReact: boolean = true;
|
||||
|
||||
public get CachedApps(): models.AppResponse[] | null {
|
||||
if (ReactNativeAppCommand.cachedApps && ReactNativeAppCommand.cachedApps.length > 0) {
|
||||
|
@ -26,7 +27,7 @@ export class ReactNativeAppCommand extends Command {
|
|||
if (!await super.runNoClient()) {
|
||||
return false;
|
||||
}
|
||||
if (!Utils.isReactNativeProject(this.rootPath, true)) {
|
||||
if (this.checkForReact && !Utils.isReactNativeProject(this.rootPath, true)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -36,7 +37,7 @@ export class ReactNativeAppCommand extends Command {
|
|||
if (!await super.run()) {
|
||||
return false;
|
||||
}
|
||||
if (!Utils.isReactNativeProject(this.rootPath, true)) {
|
||||
if (this.checkForReact && !Utils.isReactNativeProject(this.rootPath, true)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { GitUtils } from '../../helpers/gitUtils';
|
|||
import { CommandParams, CreatedAppFromAppCenter, Deployment, QuickPickAppItem, VstsProfile } from '../../helpers/interfaces';
|
||||
import { SettingsHelper } from '../../helpers/settingsHelper';
|
||||
import { Validators } from '../../helpers/validators';
|
||||
import { VsCodeUtils } from '../../helpers/vsCodeUtils';
|
||||
import { VsCodeUtils, IButtonMessageItem } from '../../helpers/vsCodeUtils';
|
||||
import { Strings } from '../../strings';
|
||||
import { VSTSGitRepository, VSTSProject } from '../../vsts/types';
|
||||
import { VSTSProvider } from '../../vsts/vstsProvider';
|
||||
|
@ -161,6 +161,7 @@ export default class Start extends CreateAppCommand {
|
|||
|
||||
// We can run npm install in parralel while doing other stuff for appcenter
|
||||
this.runNPMInstall();
|
||||
this.runPodUpdate();
|
||||
const done = await appCenterAppBuilder.startProcess();
|
||||
if (!done) {
|
||||
VsCodeUtils.ShowErrorMessage(Strings.FailedToCreateAppInAppCenter);
|
||||
|
@ -175,6 +176,26 @@ export default class Start extends CreateAppCommand {
|
|||
}
|
||||
}
|
||||
|
||||
private async runPodUpdate(): Promise<boolean> {
|
||||
try {
|
||||
const podUpdateCmd: string = "cd ios && pod install";
|
||||
this.logger.debug("Installing pods for ios...");
|
||||
await cpUtils.executeCommand(this.logger, true, this.rootPath, podUpdateCmd);
|
||||
this.logger.debug(Strings.PodsInstalledMessage);
|
||||
return true;
|
||||
} catch (error) {
|
||||
this.logger.error("Failed to run pod update");
|
||||
|
||||
const messageItems: IButtonMessageItem[] = [];
|
||||
messageItems.push({
|
||||
title: Strings.PodInstallBtnLabel,
|
||||
url: "https://cocoapods.org"
|
||||
});
|
||||
VsCodeUtils.ShowInfoMessage(Strings.PodsNotInstalledMessage, ...messageItems);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private async runNPMInstall(): Promise<boolean> {
|
||||
try {
|
||||
const installNodeModulesCmd: string = "npm i";
|
||||
|
|
|
@ -8,6 +8,7 @@ import { VsCodeUtils } from './helpers/vsCodeUtils';
|
|||
import { ConsoleLogger } from './log/consoleLogger';
|
||||
import { ILogger } from './log/logHelper';
|
||||
import { Strings } from './strings';
|
||||
import { Utils } from './helpers/utils';
|
||||
|
||||
class CommandHandlersContainer {
|
||||
private _appCenterCommandHandler: CommandHandlers.AppCenter;
|
||||
|
@ -91,7 +92,7 @@ export class ExtensionManager implements Disposable {
|
|||
if (profile && profile.userName) {
|
||||
return VsCodeUtils.setStatusBar(this._appCenterStatusBarItem,
|
||||
profile.currentApp && profile.currentApp.appName
|
||||
? `App Center: ${profile.currentApp.appName}`
|
||||
? `App Center: ${Utils.FormatAppName(profile.currentApp.appName)}`
|
||||
: `App Center: ${profile.userName}`,
|
||||
Strings.YouAreLoggedInMsg(AuthProvider.AppCenter, profile.userName),
|
||||
`${CommandNames.ShowMenu}`
|
||||
|
|
|
@ -20,6 +20,21 @@ export class Utils {
|
|||
return message;
|
||||
}
|
||||
|
||||
public static FormatAppName(name: string): string {
|
||||
const ELLIPSIZE_LENGTH_WO_HINT = 15;
|
||||
const ELLIPSIZE_LENGTH_WITH_HINT = 10;
|
||||
if (name.length < ELLIPSIZE_LENGTH_WO_HINT) {
|
||||
return name;
|
||||
}
|
||||
let hint: string = "";
|
||||
if (name.endsWith("-ios")) {
|
||||
hint = " (iOS)";
|
||||
} else if (name.endsWith("-android")) {
|
||||
hint = " (android)";
|
||||
}
|
||||
return name.substr(0, hint.length ? ELLIPSIZE_LENGTH_WITH_HINT : ELLIPSIZE_LENGTH_WO_HINT) + "..." + hint;
|
||||
}
|
||||
|
||||
public static Delay<T>(millis: number, value?: T): Promise<T> {
|
||||
return new Promise((resolve) => setTimeout(() => resolve(value), millis));
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ export class Strings {
|
|||
public static CreatingCodePushDeploymentsStatusBarMessage: string = "Creating CodePush deployments for hotfixing...";
|
||||
public static RunNPMInstallStatusBarMessage: string = "Installing package dependencies...";
|
||||
public static NodeModulesInstalledMessage: string = "Dependencies have been successfully installed";
|
||||
public static PodsInstalledMessage: string = "Pods have been successfully installed";
|
||||
public static FinishedConfigMsg: string = "Your project has been successfully configured locally and in the cloud.";
|
||||
public static GitIsNotInstalledMsg: string = "It looks like you don't have a local git client installed. ";
|
||||
public static FailedToCreateRNProjectMsg: string = "An unexpected error occurred while fetching the project template.";
|
||||
|
@ -121,6 +122,7 @@ export class Strings {
|
|||
public static CodePushInstallHint: string = "Make sure you ran \"npm install\" and that you are inside a React Native Code Push project.";
|
||||
public static ReleasingUpdateContentsMessage: string = "Sending update to CodePush...";
|
||||
public static RepoManualConnectBtnLabel: string = "Connect";
|
||||
public static PodInstallBtnLabel: string = "Install Pod";
|
||||
public static BuildManualConfigureBtnLabel: string = "Configure build";
|
||||
public static OnlyIOSError: string = "Running UI tests is supported only for iOS.";
|
||||
public static AppCreatedBtnLabel: string = "Check it out";
|
||||
|
@ -136,6 +138,7 @@ export class Strings {
|
|||
public static CrashesSimulated: string = "The crash has been successfully generated and sent to App Center!";
|
||||
public static CrashesSimulatedHint: string = "Check it out";
|
||||
|
||||
public static PodsNotInstalledMessage: string = "It looks like you haven't installed CocoaPods. You need it to run the application on iOS. After the installation, run 'cd ios && pod update'.";
|
||||
public static RepoManualConnectMessage(appName: string): string {
|
||||
return `Could not connect ${appName} to the repository. Please try to do it manually.`;
|
||||
}
|
||||
|
|