Permalink
Fetching contributors…
Cannot retrieve contributors at this time
101 lines (97 sloc) 5.54 KB
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="all" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
<PropertyGroup>
<BuildFolder>$(MSBuildProjectDirectory)\Build</BuildFolder>
<PackagesFolder>$(MSBuildProjectDirectory)\.nuget\packages</PackagesFolder>
<SourceFolder>$(MSBuildProjectDirectory)\Source</SourceFolder>
<MSBuildCommunityTasksPath>$(PackagesFolder)\MSBuildTasks.1.5.0.214\tools</MSBuildCommunityTasksPath>
<NUnitConsoleRunnerPath>$(PackagesFolder)\NUnit.ConsoleRunner.3.5.0\tools</NUnitConsoleRunnerPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets"/>
<Import Project="Version.proj"/>
<PropertyGroup Condition="'$(Configuration)'==''">
<Configuration>Release</Configuration>
</PropertyGroup>
<PropertyGroup>
<ReleaseDir>target\$(Configuration)\Waffle</ReleaseDir>
<MSBuild_4_0_ExeFilePath>%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe</MSBuild_4_0_ExeFilePath>
</PropertyGroup>
<Target Name="configurations">
<CreateItem Include="$(Configuration)">
<Output TaskParameter="Include" ItemName="Configuration" />
</CreateItem>
</Target>
<PropertyGroup>
<ProductName>WAFFLE</ProductName>
<CompanyName>Application Security Inc.</CompanyName>
<Copyright>Copyright (c) Application Security Inc. &amp; Contributors</Copyright>
<Trademark>All Rights Reserved</Trademark>
<MajorVersion>1</MajorVersion>
<MinorVersion>8</MinorVersion>
<RevisionVersion>3</RevisionVersion>
</PropertyGroup>
<Target Name="all" DependsOnTargets="configurations" Inputs="@(Configuration)" Outputs="target\%(Configuration.FileName)">
<CallTarget Targets="clean" />
<CallTarget Targets="version" />
<CallTarget Targets="build" />
<CallTarget Targets="test" />
<CallTarget Targets="drop" />
<CallTarget Targets="jar" Condition="'%(Configuration.Identity)'=='Release'" />
<CallTarget Targets="zip" />
</Target>
<Target Name="clean" DependsOnTargets="configurations" Inputs="@(Configuration)" Outputs="target\%(Configuration.FileName)">
<Message Importance="high" Text="Cleaning project, %(Configuration.Identity) ..." />
<DeleteTree Directories="target" Recursive="true" />
<DeleteTree Directories="Source\**\bin" Recursive="true" />
<DeleteTree Directories="Source\**\obj" Recursive="true" />
<DeleteTree Directories="Source\**\target" Recursive="true" />
<MSBuild Projects="Waffle.sln" Targets="Clean" Properties="Configuration=%(Configuration.Identity)" />
<!-- This directory is getting recreated from MSBuild above, Delete it again -->
<DeleteTree Directories="Source\**\obj" Recursive="true" />
<Delete Files="Source\Common\GlobalAssemblyInfo.cs" />
<Delete Files="Source\Version\Version.properties" />
<Delete Files="Source\Version\Version.wxi" />
</Target>
<Target Name="build" DependsOnTargets="version;configurations" Inputs="@(Configuration)" Outputs="target\%(Configuration.FileName)">
<Message Importance="high" Text="Compiling and linking project, %(Configuration.Identity) ..." />
<MSBuild Projects="Waffle.sln" Targets="Build" Properties="Configuration=%(Configuration.Identity)" />
</Target>
<Target Name="test" DependsOnTargets="configurations" Inputs="@(Configuration)" Outputs="target\%(Configuration.FileName)">
<Message Importance="high" Text="Running tests, %(Configuration.Identity) ..." />
<CreateItem Include="Source\**\bin\%(Configuration.Identity)\Waffle.*UnitTests.dll">
<Output TaskParameter="Include" ItemName="UnitTestAssemblies"/>
</CreateItem>
<Message Text="@(UnitTestAssemblies)" />
<exec Command="$(NUnitConsoleRunnerPath)\nunit3-console.exe &quot;@(UnitTestAssemblies)&quot;"/>
</Target>
<Target Name="drop" DependsOnTargets="version;configurations" Inputs="@(Configuration)" Outputs="target\%(Configuration.FileName)">
<CreateItem Include="Source\**\%(Configuration.Identity)/Waffle.*.dll" Exclude="Source\**\%(Configuration.Identity)/Waffle.*UnitTests.dll">
<Output TaskParameter="Include" ItemName="BinaryFiles" />
</CreateItem>
<CreateItem Include="Source\**\%(Configuration.Identity)/Waffle.*.msm">
<Output TaskParameter="Include" ItemName="BinaryFiles" />
</CreateItem>
<Copy SourceFiles="@(BinaryFiles)" DestinationFolder="$(ReleaseDir)\Bin" />
<CreateItem Include="Source\**\*.vbs">
<Output TaskParameter="Include" ItemName="SampleFiles" />
</CreateItem>
<Copy SourceFiles="@(SampleFiles)" DestinationFolder="$(ReleaseDir)\Samples" />
</Target>
<Target Name="jar" DependsOnTargets="version">
<exec Condition=" '$(APPVEYOR)' != '' "
WorkingDirectory="Source\JNA" Command="mvn clean install -DskipTests" />
<exec Condition=" '$(APPVEYOR)' == '' "
WorkingDirectory="Source\JNA" Command="mvn clean install" />
<CreateItem Include="Source\JNA\waffle-distro\target\waffle-distro\**\*.*">
<Output TaskParameter="Include" ItemName="JnaFiles"/>
</CreateItem>
<Copy SourceFiles="@(JnaFiles)" DestinationFolder="$(ReleaseDir)\%(RecursiveDir)" />
</Target>
<Target Name="zip" DependsOnTargets="version">
<CreateItem Include="target\$(Configuration)\**\*" Exclude="target\$(Configuration)\*.zip">
<Output TaskParameter="Include" ItemName="PackageFiles" />
</CreateItem>
<Zip WorkingDirectory="target\$(Configuration)" ZipFileName="target\$(Configuration)\Waffle.$(Major).$(Minor).$(Revision).zip" Files="@(PackageFiles)" />
<Message Text="Version: $(Major).$(Minor).$(Build).$(Revision)"/>
</Target>
</Project>