Skip to content

Commit

Permalink
Prepare artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
rms81 committed Mar 22, 2015
1 parent dd0351e commit 6fc718f
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 52 deletions.
138 changes: 87 additions & 51 deletions src/BuildScripts/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,113 @@

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="ci" ToolsVersion="12.0">

<Import Project="common.props"/>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.targets"/>
<Import Project="common.props"/>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.targets"/>


<Target Name="ci" DependsOnTargets="clean;nugetRestore;version;build;unittest;publish;archive"/>
<Target Name="ci" DependsOnTargets="clean;nugetRestore;version;build;unittest;publish;archive"/>

<!--Restore Nuget Packages-->
<Target Name="nugetRestore">
<NuGetRestore Solution ="$(SolutionPath)" />
</Target>
<!--Restore Nuget Packages-->
<Target Name="nugetRestore">
<NuGetRestore Solution ="$(SolutionPath)" />
</Target>

<!--Target to clean output folder if exists-->
<Target Name="clean">
<RemoveDir Directories="$(OutputPath)" Condition="Exists($(OutputPath))" />
</Target>
<!--Target to clean output folder if exists-->
<Target Name="clean">
<RemoveDir Directories="$(BuildPath)" Condition="Exists($(BuildPath))" />
</Target>

<!--Target to create assembly version info-->
<Target Name="version">
<Time>
<Output TaskParameter="Year" PropertyName="Year" />
</Time>
<!--Target to create assembly version info-->
<Target Name="version">
<Time>
<Output TaskParameter="Year" PropertyName="Year" />
</Time>

<Message Text="Version: $(Version)"/>
<Message Text="Version: $(Version)"/>

<Attrib Files="$(SolutionPath)\Common\GlobalAssemblyInfo.cs" ReadOnly="False" />
<Attrib Files="$(SolutionPath)\Common\GlobalAssemblyInfo.cs" ReadOnly="False" />

<AssemblyInfo CodeLanguage="CS"
OutputFile="$(SolutionPath)\Common\GlobalAssemblyInfo.cs"
GenerateClass="true"
AssemblyCompany="http://www.bugnetproject.com"
AssemblyCopyright="Copyright (C) 2006-$(Year) BugNET Project"
AssemblyProduct="BugNET Open Source Issue Tracker"
AssemblyConfiguration="$(BuildConfiguration)"
AssemblyVersion="$(Version)"
AssemblyFileVersion="$(FileVersion)"
AssemblyInformationalVersion="$(InformationalVersion)" />
<AssemblyInfo CodeLanguage="CS"
OutputFile="$(SolutionPath)\Common\GlobalAssemblyInfo.cs"
GenerateClass="true"
AssemblyCompany="http://www.bugnetproject.com"
AssemblyCopyright="Copyright (C) 2006-$(Year) BugNET Project"
AssemblyProduct="BugNET Open Source Issue Tracker"
AssemblyConfiguration="$(BuildConfiguration)"
AssemblyVersion="$(Version)"
AssemblyFileVersion="$(FileVersion)"
AssemblyInformationalVersion="$(InformationalVersion)" />

</Target>
</Target>

<!--Target to build solution using the sln file-->
<Target Name="build" DependsOnTargets="clean">
<Message Text="Building $(SolutionFileName)"/>
<!--Target to build solution using the sln file-->
<Target Name="build" DependsOnTargets="clean">
<Message Text="Building $(SolutionFileName)"/>

<MSBuild Projects="$(SolutionFileName)" Properties="Configuration=$(BuildConfiguration);OutputPath=$(OutputPath)"/>
<MSBuild
Projects="$(SolutionPath)BugNET_WAP/BugNET_WAP.csproj" Targets="Package"
Properties="Configuration=$(BuildConfiguration);
OutputPath=$(OutputPath);
PackageLocation=$(BuildPath)\DeployPackage\BugNET_WAP_Package.zip;
PackageAsSingleFile=True"
/>

</Target>
</Target>


<ItemGroup>
<UnitTestAssemblies Include="$(OutputPath)\BugNET.Tests.dll"/>
</ItemGroup>
<ItemGroup>
<UnitTestAssemblies Include="$(OutputPath)\BugNET.Tests.dll"/>
</ItemGroup>

<Target Name="unittest" Condition="'$(UnitTest)'" DependsOnTargets="build">
<Message Text="Running Unit Tests..."/>
<Message Text="Dlls in $(OutputPath): @(UnitTestAssemblies->'%(FullPath)',' ')"/>
<Target Name="unittest" Condition="'$(UnitTest)'" DependsOnTargets="build">
<Message Text="Running Unit Tests..."/>
<Message Text="Dlls in $(OutputPath): @(UnitTestAssemblies->'%(FullPath)',' ')"/>

<Exec Command="nunit-console @(UnitTestAssemblies->'%(FullPath)',' ') /nologo /framework:net-4.5"/>
<Exec Command="nunit-console @(UnitTestAssemblies->'%(FullPath)',' ') /nologo /framework:net-4.5"/>

<Message Text="Unit Tests Done."/>
</Target>
<Message Text="Unit Tests Done."/>
</Target>

<Target Name="publish" Condition="'$(Publish)'" DependsOnTargets="unittest">
<Message Text="Publishing..."/>


<Target Name="publish" Condition="'$(Publish)'" DependsOnTargets="unittest">
<Message Text="Publishing..."/>

</Target>
<!-- copy install-->
<ItemGroup>
<InstallFiles
Include="$(BuildPath)\DeployPackage\*.*"
Exclude="**\Latest.SqlDataProvider.sql;**\App_Data\**"/>
</ItemGroup>

<Target Name="archive" Condition="'$(Archive)'" DependsOnTargets="publish">
<Message Text="Archiving..."/>
<Copy SourceFiles="@(InstallFiles)" DestinationFolder="$(BuildPath)\dist\BugNet"/>

</Target>
<!--Copy Latest.SqlDataProvider.sql-->
<PropertyGroup>
<LatestSqlDataProviderSql>$(OutputPath)\_PublishedWebsites\BugNET_WAP\Providers\DataProviders\SqlDataProvider\Latest.SqlDataProvider.sql</LatestSqlDataProviderSql>
<LatestSqlDataProviderSqlDest>$(BuildPath)\dist\BugNet\Providers\DataProviders\SqlDataProvider\$(Version)_Latest.SqlDataProvider.sql</LatestSqlDataProviderSqlDest>

</PropertyGroup>

<Copy Condition="Exists('$(LatestSqlDataProviderSql)')"
SourceFiles="$(LatestSqlDataProviderSql)"
DestinationFiles="$(LatestSqlDataProviderSqlDest)"/>

<!--Copy Latest Release Notes-->
<PropertyGroup>
<LatestReleaseNotes>$(OutputPath)\_PublishedWebsites\BugNET_WAP\Install\LatestReleaseNotes.htm</LatestReleaseNotes>
<LatestReleaseNotesDest>$(BuildPath)\dist\BugNET\Install\$(Version).htm</LatestReleaseNotesDest>

</PropertyGroup>

<Copy Condition="Exists('$(LatestReleaseNotes)')"
SourceFiles="$(LatestReleaseNotes)"
DestinationFiles="$(LatestReleaseNotesDest)"/>


</Target>

<Target Name="archive" Condition="'$(Archive)'" DependsOnTargets="publish">
<Message Text="Archiving..."/>

</Target>

</Project>
5 changes: 4 additions & 1 deletion src/BuildScripts/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<PropertyGroup>
<SolutionPath>..\</SolutionPath>
<SolutionFileName>$(SolutionPath)BugNET.sln</SolutionFileName>
<OutputPath>$(SolutionPath)\output</OutputPath>
<MainProjectPath>$(SolutionPath)\build</MainProjectPath>
<BuildPath>$(SolutionPath)\build</BuildPath>
<PublishPath>$(BuildPath)\publish</PublishPath>
<OutputPath>$(BuildPath)\output</OutputPath>
<MSBuildCommunityTasksPath>$(SolutionPath).build</MSBuildCommunityTasksPath>

</PropertyGroup>
Expand Down

0 comments on commit 6fc718f

Please sign in to comment.