Skip to content

Commit d563605

Browse files
committed
merge with latest
2 parents 442dede + 4fce88f commit d563605

File tree

12 files changed

+85
-64
lines changed

12 files changed

+85
-64
lines changed
16.8 KB
Loading
19.5 KB
Loading
25.6 KB
Loading
91.9 KB
Loading

Extension/overview.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
# File Patch Build and Release Tasks
1+
# Build and release tasks for File Patch
22

3-
Visual Studio Team Services Build and Release Management extensions that help you to patch your files.
3+
Visual Studio Team Services Build and Release Management extensions that help you update files using JSON patch and similar syntax.
44

5-
## Install the extension to your account
5+
[Learn more](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki) about this extension on the wiki!
66

7-
You can find the latest stable version of the VSTS Extension tasks on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=geeklearningio.gl-vsts-tasks-file-patch).
7+
## Tasks included
88

9-
## Prerelease channel
9+
* **[Patch JSON Files](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-JSON-Files)**: Patch JSON files using JSON patch syntax
10+
* **[Patch XML Files](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-XML-Files)**: Patch XML files using XPath and JSON patch syntaxes
1011

11-
Our tasks are build and published in continuous (thanks to VSTS, of course). If you are interested or want to contribute, you can ask us the access of the private prerelease extension to install it to your account.
12-
By definition, this prerelease extension could introduce breaking changes, or could be very unstable, so it is not recommended to use it for your builds and releases, but only for testing purposes.
12+
## Steps
1313

14-
## Tasks included
14+
After installing the extension, you can add one (or more) of the tasks to a new or existing [build definition](https://www.visualstudio.com/en-us/docs/build/define/create) or [release definition](https://www.visualstudio.com/en-us/docs/release/author-release-definition/more-release-definition)
15+
16+
![add-task](Screenshots/Add-Tasks.png)
1517

16-
* **[Patch Json](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-Json)**: Patches json files using json patch syntax
17-
* **[Patch Xml](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-Xml)**: Patches xml files using xml patch syntax
18+
## Learn more
1819

19-
## Slick syntax mode
20+
The [source](https://github.com/geeklearningio/gl-vsts-tasks-file-patch) for this extension is on GitHub. Take, fork, and extend.
2021

21-
By default tasks will use the default json patch syntax with is a bit verbose.
22-
Xml and Json patch tasks support an enhanced human readable syntax :
22+
## Release Notes
2323

24-
* **[Learn more about Slick syntax mode](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Slick-Syntax)**
24+
> **8-3-2016**
25+
> - Added: Patch JSON File
26+
> - Added: Patch XML File

Extension/vss-extension.json

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"manifestVersion": 1,
33
"id": "gl-vsts-tasks-file-patch",
4-
"name": "File patch Build and Release Tasks",
5-
"version": "0.0.18",
4+
"name": "File Patch Build and Release Tasks",
5+
"version": "0.0.0",
66
"publisher": "geeklearningio",
77
"targets": [
88
{
99
"id": "Microsoft.VisualStudio.Services"
1010
}
1111
],
12-
"description": "Update files using json patch and similar syntax with these Build and Release Management tasks.",
12+
"description": "Update files using JSON patch and similar syntax with these Build and Release Management tasks.",
1313
"categories": [
1414
"Build and release"
1515
],
@@ -23,6 +23,14 @@
2323
"utility",
2424
"file"
2525
],
26+
"screenshots": [
27+
{
28+
"path": "Screenshots/TestBuild.png"
29+
},
30+
{
31+
"path": "Screenshots/Add-Tasks.png"
32+
}
33+
],
2634
"content": {
2735
"details": {
2836
"path": "overview.md"
@@ -52,30 +60,10 @@
5260
"files": [
5361
{
5462
"path": "Tasks"
55-
}
56-
],
57-
"contributions": [
58-
{
59-
"id": "json-patch-task",
60-
"type": "ms.vss-distributed-task.task",
61-
"description": "Applies a json patch to a file",
62-
"targets": [
63-
"ms.vss-distributed-task.tasks"
64-
],
65-
"properties": {
66-
"name": "Tasks/JsonPatch"
67-
}
6863
},
6964
{
70-
"id": "xml-patch-task",
71-
"type": "ms.vss-distributed-task.task",
72-
"description": "Applies a json patch to an xml file",
73-
"targets": [
74-
"ms.vss-distributed-task.tasks"
75-
],
76-
"properties": {
77-
"name": "Tasks/XmlPatch"
78-
}
65+
"path": "Screenshots",
66+
"addressable": true
7967
}
8068
]
8169
}

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1-
# gl-vsts-tasks-file-patch
1+
![Icon](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/blob/master/Extension/extension-icon.png)
22

3-
Build and Release Management extensions that help you update files using json patch and similar syntax.
3+
# File Patch Build and Release Tasks
4+
5+
![cistatus](https://geeklearning.visualstudio.com/_apis/public/build/definitions/f841b266-7595-4d01-9ee1-4864cf65aa73/39/badge)
6+
7+
Visual Studio Team Services Build and Release Management extensions that help you update files using JSON patch and similar syntax.
8+
9+
[Learn more](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki) about this extension on the wiki!
10+
11+
## Tasks included
12+
13+
* **[Patch JSON Files](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-JSON-Files)**: Patch JSON files using JSON patch syntax
14+
* **[Patch XML Files](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-XML-Files)**: Patch XML files using XPath and JSON patch syntaxes
15+
16+
## To contribute
17+
18+
1. Globally install typescript and tfx-cli (to package VSTS extensions): `npm install -g typescript tfx-cli`
19+
2. From the root of the repo run `npm install`. This will pull down the necessary modules for the different tasks and for the build tools.
20+
3. Run `npm run build` to compile the build tasks.
21+
4. Run `npm run package -- --version <version>` to create the .vsix extension packages (supports multiple environments) that includes the build tasks.
22+
23+
## Release Notes
24+
25+
> **8-3-2016**
26+
> - Added: Patch JSON File
27+
> - Added: Patch XML File
28+
29+
## Contributors
30+
31+
This extension was created by [Geek Learning](http://geeklearning.io/), with help from the community.
32+
33+
## Attributions
34+
35+
* [Bandages by Paulo Sá Ferreira from the Noun Project](https://thenounproject.com/term/bandages/437437/)

Tasks/JsonPatch/jsonPatch.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ var outputPatchedFile = tl.getBoolInput("OutputPatchFile");
1515
var syntax = tl.getInput("SyntaxType");
1616

1717
try {
18-
19-
2018
var patches: patch.IPatch[] = syntax == "slick" ?
2119
patchProcess.expandVariablesAndParseSlickPatch(patchContent) :
2220
patchProcess.expandVariablesAndParseJson(patchContent);
2321

2422
patchProcess.apply(new jsonPatcher.JsonPatcher(patches), targetPath, patterns, outputPatchedFile);
2523

2624
tl.setResult(tl.TaskResult.Succeeded, "Files Patched");
25+
2726
} catch (err) {
2827
console.error(String(err));
2928
tl.setResult(tl.TaskResult.Failed, String(err));

Tasks/JsonPatch/task.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"id": "DEEAA603-DA23-43AB-A099-33AEFE358520",
33
"name": "JsonPatch",
4-
"friendlyName": "Patch Json",
5-
"description": "Applies a Json Patch",
6-
"helpMarkDown": "[More Information](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-Json) (Version #{Version}#)",
4+
"friendlyName": "Patch JSON Files",
5+
"description": "Patch JSON files using JSON patch syntax",
6+
"helpMarkDown": "[More Information](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-JSON-Files) (Version #{Version}#)",
77
"category": "Utility",
88
"visibility": [
99
"Build",
@@ -13,13 +13,13 @@
1313
"version": {
1414
"Major": 0,
1515
"Minor": 0,
16-
"Patch": 41
16+
"Patch": 0
1717
},
1818
"demands": [
1919
"npm"
2020
],
2121
"minimumAgentVersion": "1.91.0",
22-
"instanceNameFormat": "Patches files $(JsonTarget)",
22+
"instanceNameFormat": "Patch files $(JsonTargetFilters)",
2323
"inputs": [
2424
{
2525
"name": "SyntaxType",
@@ -39,15 +39,15 @@
3939
"label": "Patch working directory",
4040
"defaultValue": "",
4141
"required": true,
42-
"helpMarkDown": "Patch target file. Example: $(agent.builddirectory)/target.json"
42+
"helpMarkDown": "Working directory. Example: $(Build.SourcesDirectory)"
4343
},
4444
{
4545
"name": "JsonTargetFilters",
4646
"type": "multiLine",
4747
"label": "Target files",
4848
"defaultValue": "",
4949
"required": true,
50-
"helpMarkDown": "Patch target file. Example: $(agent.builddirectory)/target.json"
50+
"helpMarkDown": "Patch target file. Example: appsettings*.json"
5151
},
5252
{
5353
"name": "JsonPatchContent",

Tasks/XmlPatch/task.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"id": "ACEE093C-D84E-456E-B6F3-1D65969291BD",
33
"name": "XmlPatch",
4-
"friendlyName": "Patch Xml",
5-
"description": "Applies a Xml Patch",
6-
"helpMarkDown": "[More Information](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-Xml) (Version #{Version}#)",
4+
"friendlyName": "Patch XML Files",
5+
"description": "Patch XML files using XPath and JSON patch syntaxes",
6+
"helpMarkDown": "[More Information](https://github.com/geeklearningio/gl-vsts-tasks-file-patch/wiki/Patch-XML-Files) (Version #{Version}#)",
77
"category": "Utility",
88
"visibility": [
99
"Build",
@@ -13,13 +13,13 @@
1313
"version": {
1414
"Major": 0,
1515
"Minor": 0,
16-
"Patch": 45
16+
"Patch": 0
1717
},
1818
"demands": [
1919
"npm"
2020
],
2121
"minimumAgentVersion": "1.91.0",
22-
"instanceNameFormat": "Patches files $(JsonTarget)",
22+
"instanceNameFormat": "Patch files $(XmlTargetFilters)",
2323
"inputs": [
2424
{
2525
"name": "SyntaxType",
@@ -34,20 +34,20 @@
3434
}
3535
},
3636
{
37-
"name": "JsonWorkingDir",
37+
"name": "XmlWorkingDir",
3838
"type": "filePath",
3939
"label": "Patch working directory",
4040
"defaultValue": "",
4141
"required": true,
42-
"helpMarkDown": "Patch target file. Example: $(agent.builddirectory)/target.json"
42+
"helpMarkDown": "Working directory. Example: $(Build.SourcesDirectory)"
4343
},
4444
{
45-
"name": "JsonTargetFilters",
45+
"name": "XmlTargetFilters",
4646
"type": "multiLine",
4747
"label": "Target files",
4848
"defaultValue": "",
4949
"required": true,
50-
"helpMarkDown": "Patch target file. Example: $(agent.builddirectory)/target.json"
50+
"helpMarkDown": "Patch target files. Example: config*.xml"
5151
},
5252
{
5353
"name": "Namespaces",

0 commit comments

Comments
 (0)