JsonPoke.MSBuild by Manish Kumar,Toni Arte

<PackageReference Include="JsonPoke.MSBuild" Version="1.0.6" />

Package Files

441,856 bytes

 JsonPoke.MSBuild 1.0.6

JsonPoke and JsonPeek build tasks: Usage : <JsonPoke JsonInputPath="$(MSBuildProjectDirectory)\Project.json" Value="Empty-FromTest" JPath="Project.Name"> </JsonPoke> <JsonPoke JsonInputPath="$(MSBuildProjectDirectory)\Project.json" Value="Empty-FromTest" JPath="Project.IncludedLibraryVariableSetIds[?(@.Name == 'Lib-68')].Value"> </JsonPoke> <JsonPeek JsonInputPath="$(MSBuildProjectDirectory)\Project.json" JPath="Project.IncludedLibraryVariableSetIds[?(@.Name == 'Lib-69')].Value"> <Output TaskParameter="Result" ItemName="Lib69Value" /> </JsonPeek> <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)" />

<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <id>JsonPoke.MSBuild</id>
    <version>1.0.6</version>
    <title>JsonPoke and JsonPeek build tasks</title>
    <authors>Manish Kumar,Toni Arte</authors>
    <owners>Manish Kumar</owners>
    <licenseUrl>https://bitbucket.org/Manishkp/jsonpeek.msbuild/raw/ce89c93089b2b253cc06530ed5e6c39f9e6a6d66/nugetSource/license.txt</licenseUrl>
    <projectUrl>https://bitbucket.org/Manishkp/jsonpeek.msbuild/</projectUrl>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <developmentDependency>true</developmentDependency>
    <description>JsonPoke and JsonPeek build tasks:
Usage :
    &lt;JsonPoke JsonInputPath="$(MSBuildProjectDirectory)\Project.json" Value="Empty-FromTest" JPath="Project.Name"&gt;
    &lt;/JsonPoke&gt;
    &lt;JsonPoke JsonInputPath="$(MSBuildProjectDirectory)\Project.json" Value="Empty-FromTest" JPath="Project.IncludedLibraryVariableSetIds[?(@.Name == 'Lib-68')].Value"&gt;
    &lt;/JsonPoke&gt;
    &lt;JsonPeek JsonInputPath="$(MSBuildProjectDirectory)\Project.json" JPath="Project.IncludedLibraryVariableSetIds[?(@.Name == 'Lib-69')].Value"&gt;
      &lt;Output TaskParameter="Result" ItemName="Lib69Value" /&gt;
    &lt;/JsonPeek&gt;
    &lt;PropertyGroup&gt;
      &lt;JsonContent&gt;
        &lt;![CDATA[{ 
  "Projects":[
 {
    "Name": "P1",
    "OutputFile": "P1.json",    
    "Variables": [    
      "Var1",
      "Var2"      
     ]
 },
 { 
    "Name": "P2",
    "OutputFile": "P2.json",    
    "Variables": [    
      "Var1",
      "Var2"      
     ]
 }
   ]
}
]]&gt;
      &lt;/JsonContent&gt;
    &lt;/PropertyGroup&gt;
    &lt;JsonPeek JPath="$.Projects" JsonContent="$(JsonContent)"&gt;    
      &lt;Output TaskParameter="Result" ItemName="TestProjects" /&gt;
    &lt;/JsonPeek&gt;
    &lt;Message Text="Project.IncludedLibraryVariableSetIds[?(@.Name == 'Lib-69')].Value : @(Lib69Value)" /&gt;
    &lt;Message Text="Project values: %(TestProjects.Name)" /&gt;</description>
    <summary>JsonPoke and JsonPeek build tasks</summary>
    <releaseNotes>1.0.2: Added JPath derived from Newtonsoft.json http://james.newtonking.com/archive/2014/02/01/json-net-6-0-release-1-%E2%80%93-jsonpath-and-f-support
1.0.4 : Fixing JSONPeek to return ITaskItem[] Result as output
Upgrade to this version, Need change from .Value to .Result
1.0.5 : Support for JsonContent and JsonInputPath.
Upgrade to this version needs change from FullFilePath and JsonFile to one JsonInputPath property
1.0.6 : JsonPeek enhancements:
a. Returing Result as array if JPath points to an array.
b. Returning Meaningfull object that simple strings, so support for batching: If the Result Item is an object, then we are exposing all attributes as metadata on the Result item. For Array of simple values like array of strings, "Value" metadata is exposed, so that %(array.Value) will work.</releaseNotes>
    <tags>json jsonpeek jsonpoke</tags>
    <dependencies>
      <dependency id="Newtonsoft.Json" version="6.0.5" />
    </dependencies>
  </metadata>
</package>