nativescript-cloud
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -140,3 +140,3 @@ "use strict"; | ||
// we need the .js file in the tests, so we can require them, for example in order to create a new instance of injector. | ||
childProcess.execSync("grunt ts:devall", { cwd: pathToModule, stdio: "ignore" }); | ||
childProcess.execSync("grunt", { cwd: pathToModule, stdio: "ignore" }); | ||
} catch (err) { | ||
@@ -143,0 +143,0 @@ |
@@ -8,1 +8,2 @@ "use strict"; | ||
$injector.requireCommand("build|cloud", path.join(__dirname, "commands", "cloud-build")); | ||
//# sourceMappingURL=bootstrap.js.map |
@@ -57,1 +57,2 @@ "use strict"; | ||
$injector.registerCommand("build|cloud", CloudBuild); | ||
//# sourceMappingURL=cloud-build.js.map |
@@ -13,1 +13,2 @@ "use strict"; | ||
exports.APPLE_INC = "Apple Inc."; | ||
//# sourceMappingURL=constants.js.map |
"use strict"; | ||
const path = require("path"); | ||
class ServerConfiguration { | ||
/*don't require logger and everything that has logger as dependency in config.js due to cyclic dependency*/ | ||
constructor($fs, $options) { | ||
@@ -55,1 +56,38 @@ this.$fs = $fs; | ||
$injector.register("serverConfig", ServerConfiguration); | ||
// export class StaticConfig implements IStaticConfig { | ||
// constructor($injector: IInjector) { | ||
// this.RESOURCE_DIR_PATH = path.join(this.RESOURCE_DIR_PATH, "../../resources"); | ||
// } | ||
// public RESOURCE_DIR_PATH: string = ""; | ||
// private static TOKEN_FILENAME = ".abgithub"; | ||
// public PROJECT_FILE_NAME = ".abproject"; | ||
// public CLIENT_NAME = "AppBuilder"; | ||
// public ANALYTICS_API_KEY = "13eaa7db90224aa1861937fc71863ab8"; | ||
// public ANALYTICS_FEATURE_USAGE_TRACKING_API_KEY = "13eaa7db90224aa1861937fc71863ab8"; | ||
// public TRACK_FEATURE_USAGE_SETTING_NAME = "AnalyticsSettings.TrackFeatureUsage"; | ||
// public ERROR_REPORT_SETTING_NAME = "AnalyticsSettings.TrackExceptions"; | ||
// public ANALYTICS_INSTALLATION_ID_SETTING_NAME = "AnalyticsInstallationID"; | ||
// public SYS_REQUIREMENTS_LINK = "http://docs.telerik.com/platform/appbuilder/running-appbuilder/running-the-cli/system-requirements-cli"; | ||
// public SOLUTION_SPACE_NAME = "Private_Build_Folder"; | ||
// public FULL_CLIENT_NAME = "Telerik AppBuilder CLI by Progress"; | ||
// public QR_SIZE = 300; | ||
// public get GITHUB_ACCESS_TOKEN_FILEPATH(): string { | ||
// return path.join(osenv.home(), StaticConfig.TOKEN_FILENAME); | ||
// } | ||
// public version = require("../package.json").version; | ||
// public triggerJsonSchemaValidation = true; | ||
// public get helpTextPath() { | ||
// return path.join(__dirname, "../resources/help.txt"); | ||
// } | ||
// public get HTML_CLI_HELPERS_DIR(): string { | ||
// return path.join(__dirname, "../docs/helpers"); | ||
// } | ||
// public get pathToPackageJson(): string { | ||
// return path.join(__dirname, "..", "package.json"); | ||
// } | ||
// public get PATH_TO_BOOTSTRAP(): string { | ||
// return path.join(__dirname, "bootstrap"); | ||
// } | ||
// } | ||
// $injector.register("staticConfig", StaticConfig); | ||
//# sourceMappingURL=server-config.js.map |
@@ -18,3 +18,3 @@ "use strict"; | ||
class CloudBuildService { | ||
constructor($fs, $httpClient, $projectFilesManager, $errors, $server, $mobileHelper, $projectHelper) { | ||
constructor($fs, $httpClient, $projectFilesManager, $errors, $server, $mobileHelper, $projectHelper, $logger) { | ||
this.$fs = $fs; | ||
@@ -27,7 +27,13 @@ this.$httpClient = $httpClient; | ||
this.$projectHelper = $projectHelper; | ||
this.$logger = $logger; | ||
} | ||
// We should decorate this method... hacks are needed!!! | ||
build(projectSettings, platform, buildConfiguration, androidBuildData, iOSBuildData) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const buildInformationString = `cloud build of '${projectSettings.projectDir}', platform: '${platform}', configuration: '${buildConfiguration}' `; | ||
this.$logger.info(`Starting ${buildInformationString}.`); | ||
// TODO: Add validation for all options before uploading the package to S3. | ||
yield this.validateBuildProperties(platform, buildConfiguration, projectSettings.projectId, androidBuildData, iOSBuildData); | ||
let buildProps = yield this.prepareBuildRequest(projectSettings, platform, buildConfiguration); | ||
// TODO: Check with Nadya why we do not receive this information. | ||
let outputFileName = projectSettings.projectName; | ||
@@ -49,5 +55,9 @@ if (this.$mobileHelper.isAndroidPlatform(platform)) { | ||
if (!buildResult.BuildItems || !buildResult.BuildItems.length) { | ||
// Something failed | ||
// Fail with combination of Errors and Output: | ||
this.$errors.failWithoutHelp(`Build failed. Reason is: ${buildResult.Errors}. Additional information: ${buildResult.Output}.`); | ||
} | ||
this.$logger.info(`Finished ${buildInformationString} successfully. Downloading result...`); | ||
const localBuildResult = yield this.downloadBuildResult(buildResult, projectSettings.projectDir, outputFileName); | ||
this.$logger.info(`The result of ${buildInformationString} successfully downloaded. Log from cloud build is:${os_1.EOL}* stderr: ${buildResult.Error}${os_1.EOL}* stdout: ${buildResult.Output}${os_1.EOL}* outputFilePath: ${localBuildResult}`); | ||
return { | ||
@@ -127,2 +137,4 @@ stderr: buildResult.Error, | ||
const buildPreSignedUrlData = yield this.uploadFileToS3(projectSettings.projectId, projectZipFile); | ||
// HACK just for this version. After that we'll have UI for getting runtime version. | ||
// Until then, use the coreModulesVersion. | ||
const coreModulesVersion = this.$fs.readJson(path.join(projectSettings.projectDir, "package.json")).dependencies["tns-core-modules"]; | ||
@@ -198,2 +210,19 @@ const runtimeVersion = this.getRuntimeVersion(platform, projectSettings.nativescriptData, coreModulesVersion); | ||
const provisonS3Data = yield this.uploadFileToS3(projectSettings.projectId, iOSBuildData.pathToProvision, ".mobileprovision"); | ||
// Add to buildProps.Properties some of these. | ||
// "Simulator": "False", | ||
// "BuildForiOSSimulator": false, | ||
// "iOSCodesigningIdentity": certificateS3Data.fileNameInS3, | ||
// "CodeSigningIdentity": "iPhone Developer: Dragon Telrrikov (J45P439R9U)", | ||
// "TempKeychainName": uuid.v4(), | ||
// "TempKeychainPassword": iOSBuildData.certificatePassword, | ||
// "MobileProvisionIdentifiers": [{ | ||
// "SuffixId": "", | ||
// "TemplateName": "PROVISION_", | ||
// "Identifier": provisonS3Data.fileNameInS3, | ||
// "IsDefault": true, | ||
// "FileName": provisonS3Data.fileNameInS3, | ||
// "AppGroups": [], | ||
// "ProvisionType": "Development", | ||
// "Name": provisonS3Data.fileNameInS3 | ||
// }], | ||
buildProps.BuildFiles.push({ | ||
@@ -229,2 +258,3 @@ sourceUri: certificateS3Data.S3Url, | ||
getProvisionType(provisionData) { | ||
// TODO: Discuss whether this code should be moved to the Tooling | ||
let result = ""; | ||
@@ -254,2 +284,3 @@ if (provisionData.Entitlements['get-task-allow']) { | ||
const targetFile = this.$fs.createWriteStream(targetFileName); | ||
// Download the output file. | ||
yield this.$httpClient.httpRequest({ | ||
@@ -284,2 +315,3 @@ url: buildResultUrl, | ||
if (!runtimeVersion && coreModulesVersion && semver.valid(coreModulesVersion)) { | ||
// no runtime added. Let's find out which one we need based on the tns-core-modules. | ||
runtimeVersion = `${semver.major(coreModulesVersion)}.${semver.minor(coreModulesVersion)}.*`; | ||
@@ -345,1 +377,2 @@ } | ||
$injector.register("cloudBuildService", CloudBuildService); | ||
//# sourceMappingURL=cloud-build-service.js.map |
@@ -23,1 +23,2 @@ "use strict"; | ||
$injector.register("server", ServiceContainer); | ||
//# sourceMappingURL=cloud-service.js.map |
@@ -59,1 +59,2 @@ "use strict"; | ||
$injector.register("serviceProxy", ServiceProxy); | ||
//# sourceMappingURL=service-proxy.js.map |
{ | ||
"name": "nativescript-cloud", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Used for cloud support in NativeScript CLI", | ||
@@ -5,0 +5,0 @@ "main": "lib/bootstrap.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
56488
949
1