Skip to content

Commit

Permalink
unfortunately I can't get the zip task to work
Browse files Browse the repository at this point in the history
  • Loading branch information
bodewig committed Nov 15, 2015
1 parent be0ec91 commit c5cb4aa
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions .nuget/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit.Runners" version="2.6.4" />
<package id="MSBuildTasks" version="1.4.0.128" />
</packages>
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ nuget:
disable_publish_on_pr: true

build:
project: XMLUnit.NET.sln
publish_nuget: true
publish_nuget_symbols: true
73 changes: 73 additions & 0 deletions xmlunit-dist.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is licensed to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!--
This is a failed attempt for automating the build of the ZIP
files but I get "An element with the same key already exists in the
dictionary." errors that indicate I must be doing something wrong
(there certainly are no duplicate files, most likely the directory
structure is flattened even though I tell it not to)
-->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">.\</SolutionDir>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<RestorePackages>true</RestorePackages>
<MSBuildCommunityTasksLib>$(SolutionDir)\packages\MSBuildTasks.1.4.0.128\tools\MSBuild.Community.Tasks.dll</MSBuildCommunityTasksLib>


<SrcDistDir>$(SolutionDir)\build\src-dist\xmlunit-$(Version)</SrcDistDir>
<BinDistDir>$(SolutionDir)\build\bin-dist\xmlunit-$(Version)</BinDistDir>
</PropertyGroup>

<UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Zip" />

<Target Name="SetUp">
<MakeDir Directories="$(SrcDistDir);$(BinDistDir)"/>
<ItemGroup>
<SourceFiles
Include="**\*.*"
Exclude=".git\**\*.*;**\*.*~;*.yml;.git*;build\**\*.*;packages\**\*.*;.nuget\**\*.*"
/>
</ItemGroup>
<Copy SourceFiles="@(SourceFiles)"
DestinationFiles="@(SourceFiles->'$(SrcDistDir)\%(RecursiveDir)%(Filename)%(Extension)')"
/>
<ItemGroup>
<BinFiles Include="README.md"/>
<BinFiles Include="LICENSE"/>
<BinFiles Include="build/bin/$(Configuration)/xmlunit-*.dll"/>
</ItemGroup>
<ItemGroup>
<DocFiles Include="build\html\**\*.*"/>
</ItemGroup>
<Copy SourceFiles="@(BinFiles)"
DestinationFolder="$(BinDistDir)"
/>
<Copy SourceFiles="@(DocFiles)"
DestinationFiles="@(DocFiles->'$(BinDistDir)\apidocs\%(RecursiveDir)%(Filename)%(Extension)')"
/>
</Target>

<Target Name="Build" DependsOnTargets="SetUp">
<ItemGroup>
<BinZipFiles Include="$(SolutionDir)\build\bin-dist\**\*.*"/>
</ItemGroup>
<Zip Files="@(BinZipFiles)"
Flatten="False"
ZipFileName="$(SolutionDir)\build\xmlunit-$(Version)-bin.zip"
/>
</Target>
</Project>

0 comments on commit c5cb4aa

Please sign in to comment.