From 3c72614895725d4cd817295fd7e81e593c3dda6b Mon Sep 17 00:00:00 2001 From: Cyprien Autexier Date: Sat, 5 Aug 2017 09:54:46 +0200 Subject: [PATCH 1/4] update dependencies --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d68140c..ad69f92 100644 --- a/package.json +++ b/package.json @@ -10,18 +10,18 @@ "vsts-build-tools-prebuild": "./run/vsts-build-tools-prebuild" }, "devDependencies": { - "async": "^2.0.1", - "fs-extra": "0.30.0", + "async": "^2.5.0", + "fs-extra": "4.0.1", "minimist": "1.2.0", - "lodash": "4.14.1", + "lodash": "4.17.4", "tsconfig-glob": "^0.4.3", - "tslint": "^3.6.0", - "typescript": "^1.8.10", - "typings": "1.3.2", - "jasmine": "2.4.1", - "semver": "5.3.0", - "tfx-cli": "0.3.23", - "glob": "7.0.5", + "tslint": "^5.5.0", + "typescript": "^2.4.2", + "typings": "2.1.1", + "jasmine": "2.7.0", + "semver": "5.4.1", + "tfx-cli": "0.4.9", + "glob": "7.1.2", "modclean": "2.1.0" } } \ No newline at end of file From 0e6812ec806482943f21eb814060f0cf29d861b9 Mon Sep 17 00:00:00 2001 From: Cyprien Autexier Date: Wed, 11 Oct 2017 12:56:43 +0200 Subject: [PATCH 2/4] add support for loc file --- package.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/package.js b/package.js index 293dd84..633d186 100644 --- a/package.js +++ b/package.js @@ -52,6 +52,36 @@ var createExtensionTasks = configuration.environments.map((env) => { fs.writeJsonSync(taskFilePath, task); + var taskLocFilePath = path.join(taskDirectory.directory, 'task.json'); + if (fs.existsSync(taskLocFilePath)) { + var taskLoc = fs.readJsonSync(taskLocFilePath); + taskLoc.id = env.TaskIds[taskDirectory.name]; + taskLoc.friendlyName += env.DisplayNamesSuffix; + + taskLoc.version.Major = version.major; + taskLoc.version.Minor = version.minor; + taskLoc.version.Patch = version.patch; + if (taskLoc.helpMarkDown) { + taskLoc.helpMarkDown = taskLoc.helpMarkDown.replace('#{Version}#', version.getVersionString()); + } + + var locfilesDirectory = path.join(taskDirectory.directory, 'Strings/resources.resjson'); + if (fs.existsSync(locfilesDirectory)) { + var langs = fs.readdirSync(locfilesDirectory); + for (var index = 0; index < langs.length; index++) { + var element = langs[index]; + var resourceFile = path.join(locfilesDirectory, element, "resources.resjson"); + if (fs.existsSync(resourceFile)){ + var resource = fs.readJsonSync(resourceFile); + resource["loc.helpMarkDown"] = resource["loc.helpMarkDown"].replace('#{Version}#', version.getVersionString()); + fs.writeJsonSync(resourceFile, resource); + } + } + } + } + + + var taskId = taskDirectory.name.replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^[-]+/, ""); extension.contributions.push({ id: taskId + "-task", From 2d67513998c474f61c605d6d2e99277c099ddb54 Mon Sep 17 00:00:00 2001 From: Cyprien Autexier Date: Wed, 11 Oct 2017 13:40:02 +0200 Subject: [PATCH 3/4] file save task loc --- package.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.js b/package.js index 633d186..f53302a 100644 --- a/package.js +++ b/package.js @@ -65,6 +65,8 @@ var createExtensionTasks = configuration.environments.map((env) => { taskLoc.helpMarkDown = taskLoc.helpMarkDown.replace('#{Version}#', version.getVersionString()); } + fs.writeJsonSync(taskLocFilePath, taskLoc); + var locfilesDirectory = path.join(taskDirectory.directory, 'Strings/resources.resjson'); if (fs.existsSync(locfilesDirectory)) { var langs = fs.readdirSync(locfilesDirectory); From 5b39c112311892cff3d42499f50e416862def595 Mon Sep 17 00:00:00 2001 From: Cyprien Autexier Date: Wed, 11 Oct 2017 13:46:35 +0200 Subject: [PATCH 4/4] fix loc file detection --- package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.js b/package.js index f53302a..3808005 100644 --- a/package.js +++ b/package.js @@ -52,7 +52,7 @@ var createExtensionTasks = configuration.environments.map((env) => { fs.writeJsonSync(taskFilePath, task); - var taskLocFilePath = path.join(taskDirectory.directory, 'task.json'); + var taskLocFilePath = path.join(taskDirectory.directory, 'task.loc.json'); if (fs.existsSync(taskLocFilePath)) { var taskLoc = fs.readJsonSync(taskLocFilePath); taskLoc.id = env.TaskIds[taskDirectory.name];