diff --git a/Gruntfile.js b/Gruntfile.js index 536061fcab..bf5c061ae4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -39,17 +39,17 @@ module.exports = function(grunt) { }, devlib: { - src: ["lib/**/*.ts", "!lib/common/node_modules/**/*.ts"], + src: ["lib/**/*.ts", "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts"], reference: "lib/.d.ts" }, devall: { - src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "lib/common/test/unit-tests/**/*.ts", "definitions/**/*.ts", "!lib/common/test/.d.ts"], + src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts", "lib/common/test/unit-tests/**/*.ts", "definitions/**/*.ts", "!lib/common/test/.d.ts"], reference: "lib/.d.ts" }, release_build: { - src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts"], + src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts"], reference: "lib/.d.ts", options: { sourceMap: false, @@ -61,7 +61,7 @@ module.exports = function(grunt) { tslint: { build: { files: { - src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "lib/common/test/unit-tests/**/*.ts", "definitions/**/*.ts", "!**/*.d.ts"] + src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts", "lib/common/test/unit-tests/**/*.ts", "definitions/**/*.ts", "!**/*.d.ts"] }, options: { configuration: grunt.file.readJSON("./tslint.json") @@ -71,7 +71,7 @@ module.exports = function(grunt) { watch: { devall: { - files: ["lib/**/*.ts", 'test/**/*.ts', "!lib/common/node_modules/**/*.ts"], + files: ["lib/**/*.ts", 'test/**/*.ts', "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts"], tasks: [ 'ts:devall', 'shell:npm_test' diff --git a/lib/common b/lib/common index e8426828e3..a756232d06 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit e8426828e3569571ddde07441e99591cdcfccb92 +Subproject commit a756232d06f3b500dcac456486d5c2c8899c3bd0 diff --git a/lib/messages.d.ts b/lib/messages.d.ts new file mode 100644 index 0000000000..4d4e59f425 --- /dev/null +++ b/lib/messages.d.ts @@ -0,0 +1,13 @@ +/// +// +// automatically generated code; do not edit manually! +// +interface IMessages{ + Devices : { + NotFoundDeviceByIdentifierErrorMessage: string; + NotFoundDeviceByIdentifierErrorMessageWithIdentifier: string; + NotFoundDeviceByIndexErrorMessage: string; + }; + +} + diff --git a/lib/messages.ts b/lib/messages.ts new file mode 100644 index 0000000000..b7dc279a2f --- /dev/null +++ b/lib/messages.ts @@ -0,0 +1,16 @@ +/// +"use strict"; +// +// automatically generated code; do not edit manually! +// + +export class Messages implements IMessages{ + Devices = { + NotFoundDeviceByIdentifierErrorMessage: "Devices.NotFoundDeviceByIdentifierErrorMessage", + NotFoundDeviceByIdentifierErrorMessageWithIdentifier: "Devices.NotFoundDeviceByIdentifierErrorMessageWithIdentifier", + NotFoundDeviceByIndexErrorMessage: "Devices.NotFoundDeviceByIndexErrorMessage", + }; + +} +$injector.register('messages', Messages); + diff --git a/lib/nativescript-cli.ts b/lib/nativescript-cli.ts index eca0d38dd3..352f519c7f 100644 --- a/lib/nativescript-cli.ts +++ b/lib/nativescript-cli.ts @@ -17,6 +17,9 @@ fiber(() => { let commandDispatcher: ICommandDispatcher = $injector.resolve("commandDispatcher"); + let messages: IMessagesService = $injector.resolve("$messagesService"); + messages.pathsToMessageJsonFiles = [/* Place client-specific json message file paths here */]; + if (process.argv[2] === "completion") { commandDispatcher.completeCommand().wait(); } else { diff --git a/test/plugin-variables-service.ts b/test/plugin-variables-service.ts index 800250d4f9..39e8a20bc4 100644 --- a/test/plugin-variables-service.ts +++ b/test/plugin-variables-service.ts @@ -13,6 +13,7 @@ import {ProjectData} from "../lib/project-data"; import {ProjectDataService} from "../lib/services/project-data-service"; import {ProjectHelper} from "../lib/common/project-helper"; import {StaticConfig} from "../lib/config"; +import {MessagesService} from "../lib/common/services/messages-service"; import {Yok} from '../lib/common/yok'; import * as stubs from './stubs'; import * as path from "path"; @@ -22,6 +23,7 @@ temp.track(); function createTestInjector(): IInjector { let testInjector = new Yok(); + testInjector.register("messagesService", MessagesService); testInjector.register("errors", Errors); testInjector.register("fs", FileSystem); testInjector.register("hostInfo", HostInfo); diff --git a/test/plugins-service.ts b/test/plugins-service.ts index aade26ae7a..c0c3959801 100644 --- a/test/plugins-service.ts +++ b/test/plugins-service.ts @@ -24,6 +24,7 @@ import {ResourceLoader} from "../lib/common/resource-loader"; import {EOL} from "os"; import {PluginsService} from "../lib/services/plugins-service"; import {AddPluginCommand} from "../lib/commands/plugin/add-plugin"; +import {MessagesService} from "../lib/common/services/messages-service"; import {Builder} from "../lib/tools/broccoli/builder"; import {AndroidProjectService} from "../lib/services/android-project-service"; import {AndroidToolsInfo} from "../lib/android-tools-info"; @@ -37,7 +38,7 @@ let isErrorThrown = false; function createTestInjector() { let testInjector = new Yok(); - + testInjector.register("messagesService", MessagesService); testInjector.register("npm", NodePackageManager); testInjector.register("fs", FileSystem); testInjector.register("projectData", ProjectData);