Info
Version: | 1.0.1 |
Author(s): | Manish Kumar, Olivier Lefebvre |
Last Update: | Saturday, March 18, 2017 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://bitbucket.org/Aguacongas/jsonpeek.msbuild/ |
NuGet Url: | https://www.nuget.org/packages/JsonPoke.Core.MSBuild |
Install
Install-Package JsonPoke.Core.MSBuild
dotnet add package JsonPoke.Core.MSBuild
paket add JsonPoke.Core.MSBuild
JsonPoke.Core.MSBuild Download (Unzip the "nupkg" after downloading)
Dependencies
- Microsoft.Build.Tasks.Core(>= 15.1.548)
- Newtonsoft.Json(>= 9.0.1)
Tags
Usage :
JSON Poke:
1.
<JsonPoke JsonInputPath="$(MSBuildProjectDirectory)\Project.json" JValue="Empty-FromTest1" JPath="Project.Name">
</JsonPoke>
2 a. <JsonPoke JsonInputPath="$(MSBuildProjectDirectory)\Project.json" JArray="@(TestArray1)" JPath="Project.TestArray" Metadata="MyProp;Identity">
</JsonPoke>
2 b.
<JsonPoke JsonInputPath="$(MSBuildProjectDirectory)\Project.json" JArray="t11.txt;t22.txt" JPath="Project.TestArray1">
</JsonPoke>
3. <JsonPoke JsonInputPath="$(MSBuildProjectDirectory)\Project.json" JObject="@(BuildNumber)" JPath="Project.TestObject" Metadata="Major;Minor;Build">
<PropertyGroup>
<JsonContent>
<![CDATA[{
"Projects":[
{ "Name": "P1", "OutputFile": "P1.json", "Variables": [ "Var1", "Var2" ]},
{ "Name": "P2", "OutputFile": "P2.json", "Variables": [ "Var1", "Var2" ] } ] }
]]>
</JsonContent>
</PropertyGroup>
<JsonPeek JPath="$.Projects" JsonContent="$(JsonContent)">
<Output TaskParameter="Result" ItemName="TestProjects" />
</JsonPeek>
<Message Text="Project.IncludedLibraryVariableSetIds[?(@.Name == 'Lib-69')].Value : @(Lib69Value)" />
<Message Text="Project values: %(TestProjects.Name)" />.