forked from AlbedoOrg/Albedo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated build script files to use the same system
as also used by Exude, Hyprlinkr, and ZeroToNine.
- Loading branch information
Showing
4 changed files
with
122 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function Get-VsVersion () | ||
{ | ||
if ($env:VS120COMNTOOLS -ne $null) | ||
{ | ||
" /property:VisualStudioVersion=12.0" | ||
} | ||
} | ||
|
||
Start-Process -NoNewWindow -Wait -FilePath $env:windir\Microsoft.NET\Framework\v4.0.30319\MSBuild -ArgumentList ('BuildRelease.msbuild', '/property:Configuration=Release', (Get-VsVersion)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | ||
<PropertyGroup> | ||
<XUnitPath>Src\packages\xunit.runners.1.9.2\tools</XUnitPath> | ||
<NuGetPath>Src\packages\NuGet.CommandLine.2.7.1\tools</NuGetPath> | ||
<NuGetPackageDependencyRoot>albedo</NuGetPackageDependencyRoot> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<BuildOutput Include="Src\Albedo\bin\Release\Ploeh.Albedo.dll" /> | ||
<BuildOutput Include="Src\Albedo\bin\Release\Ploeh.Albedo.XML" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectToBuild Include="Src\*.sln" /> | ||
</ItemGroup> | ||
<!-- Expand build output files AFTER the build has run. | ||
Note that the Build Task MUST BE defined by the file that includes this file. --> | ||
<Target Name="GetTestAssemblies" DependsOnTargets="Build"> | ||
<ItemGroup> | ||
<TestAssemblies Include="**\bin\Release\*UnitTests*.dll" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,87 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="CompleteBuild" ToolsVersion="4.0"> | ||
<!--Project configuration--> | ||
<Import Project="Build.config" /> | ||
|
||
<UsingTask TaskName="xunit" AssemblyFile="$(XUnitPath)\xunit.runner.msbuild.dll" /> | ||
|
||
<!--Clean--> | ||
<Target Name="CleanAll" DependsOnTargets="CleanDebug;CleanVerify;CleanRelease" /> | ||
<Target Name="CleanDebug"> | ||
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Debug" /> | ||
</Target> | ||
<Target Name="CleanVerify"> | ||
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Verify" /> | ||
</Target> | ||
<Target Name="CleanRelease"> | ||
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Release" /> | ||
</Target> | ||
|
||
<!--Compile--> | ||
<Target Name="Build" DependsOnTargets="CleanAll"> | ||
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Verify" /> | ||
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Release" /> | ||
</Target> | ||
|
||
<!--Test. Note that the GetTestAssemblies Task MUST BE defined in the Build.config file. --> | ||
<Target Name="Test" DependsOnTargets="GetTestAssemblies"> | ||
<xunit Assemblies="@(TestAssemblies)" /> | ||
</Target> | ||
|
||
<!--Release--> | ||
<PropertyGroup> | ||
<ReleaseFolder>Release</ReleaseFolder> | ||
</PropertyGroup> | ||
<Target Name="DeleteReleaseFolder"> | ||
<RemoveDir Directories="$(ReleaseFolder)" /> | ||
</Target> | ||
<Target Name="MakeReleaseFolder" DependsOnTargets="DeleteReleaseFolder"> | ||
<MakeDir Directories="$(ReleaseFolder)" Condition="!Exists($(ReleaseFolder))" /> | ||
</Target> | ||
<Target Name="CopyToReleaseFolder" DependsOnTargets="Test"> | ||
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(ReleaseFolder)" /> | ||
</Target> | ||
|
||
<!--NuGet--> | ||
<ItemGroup> | ||
<NuSpecFiles Include="NuGetSpecs\*.nuspec" /> | ||
</ItemGroup> | ||
<Target Name="CreateTemporaryNuGetSpecFiles"> | ||
<PropertyGroup> | ||
<XUnitPath>Src\packages\xunit.runners.1.9.2\tools</XUnitPath> | ||
<NuGetOutputFolder>NuGetPackages</NuGetOutputFolder> | ||
</PropertyGroup> | ||
<UsingTask TaskName="xunitproject" AssemblyFile="$(XUnitPath)\xunit.runner.msbuild.dll" /> | ||
<ItemGroup> | ||
<ProjectToBuild Include="Src\*.sln" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<BuildOutput Include="Src\Albedo\bin\Release\Ploeh.Albedo.dll" /> | ||
<BuildOutput Include="Src\Albedo\bin\Release\Ploeh.Albedo.XML" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<NuSpecFiles Include="NuGetSpecs\*.nuspec" /> | ||
</ItemGroup> | ||
<RemoveDir Directories="$(NuGetOutputFolder)" /> | ||
<Copy SourceFiles="@(NuSpecFiles)" DestinationFolder="$(NuGetOutputFolder)"> | ||
<Output TaskParameter="CopiedFiles" ItemName="TempNuspecFiles" /> | ||
</Copy> | ||
</Target> | ||
<Target Name="NuGetPrepare" DependsOnTargets="CreateTemporaryNuGetSpecFiles;CopyToReleaseFolder" Outputs="%(TempNuspecFiles.Identity)"> | ||
<PropertyGroup> | ||
<ReleaseFolder>Release</ReleaseFolder> | ||
<TempNuspecFilePath>%(TempNuspecFiles.FullPath)</TempNuspecFilePath> | ||
<AssemblyFile Condition="Exists('$(ReleaseFolder)\%(TempNuspecFiles.Filename).dll')">$(ReleaseFolder)\%(TempNuspecFiles.Filename).dll</AssemblyFile> | ||
<AssemblyFile Condition="Exists('$(ReleaseFolder)\%(TempNuspecFiles.Filename).exe')">$(ReleaseFolder)\%(TempNuspecFiles.Filename).exe</AssemblyFile> | ||
</PropertyGroup> | ||
<!--Clean all--> | ||
<Target Name="CleanAll" DependsOnTargets="CleanDebug;CleanVerify;CleanRelease" /> | ||
<Target Name="CleanDebug"> | ||
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Debug" /> | ||
</Target> | ||
<Target Name="CleanVerify"> | ||
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Verify" /> | ||
</Target> | ||
<Target Name="CleanRelease"> | ||
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Release" /> | ||
</Target> | ||
<!--Build tasks--> | ||
<Target Name="DeleteReleaseFolder"> | ||
<RemoveDir Directories="$(ReleaseFolder)" /> | ||
</Target> | ||
<Target Name="MakeReleaseFolder" DependsOnTargets="DeleteReleaseFolder"> | ||
<MakeDir Directories="$(ReleaseFolder)" Condition="!Exists($(ReleaseFolder))" /> | ||
</Target> | ||
<Target Name="Verify" DependsOnTargets="MakeReleaseFolder;CleanAll"> | ||
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Verify" /> | ||
</Target> | ||
<Target Name="Build" DependsOnTargets="Verify;CleanAll"> | ||
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Release" /> | ||
</Target> | ||
<Target Name="Test" DependsOnTargets="Build"> | ||
<xunitproject ProjectFile="Src\All.xunit" /> | ||
</Target> | ||
<Target Name="CopyToReleaseFolder" DependsOnTargets="Test"> | ||
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(ReleaseFolder)" /> | ||
<Copy SourceFiles="@(NuGetPackageScripts)" DestinationFolder="$(ReleaseFolder)" /> | ||
</Target> | ||
<Target Name="CreateTemporaryNuGetSpecFiles"> | ||
<PropertyGroup> | ||
<NuGetOutputFolder>NuGetPackages</NuGetOutputFolder> | ||
</PropertyGroup> | ||
<RemoveDir Directories="$(NuGetOutputFolder)" /> | ||
<Copy SourceFiles="@(NuSpecFiles)" DestinationFolder="$(NuGetOutputFolder)"> | ||
<Output TaskParameter="CopiedFiles" ItemName="TempNuspecFiles" /> | ||
</Copy> | ||
</Target> | ||
<Target Name="NuGetPrepare" DependsOnTargets="CreateTemporaryNuGetSpecFiles;CopyToReleaseFolder" Outputs="%(TempNuspecFiles.Identity)"> | ||
<PropertyGroup> | ||
<TempNuspecFilePath>%(TempNuspecFiles.FullPath)</TempNuspecFilePath> | ||
<AssemblyFile>$(ReleaseFolder)\%(TempNuspecFiles.Filename).dll</AssemblyFile> | ||
</PropertyGroup> | ||
<GetAssemblyIdentity AssemblyFiles="$(AssemblyFile)"> | ||
<Output TaskParameter="Assemblies" ItemName="AssemblyInfo" /> | ||
</GetAssemblyIdentity> | ||
<PropertyGroup> | ||
<Version>%(AssemblyInfo.Version)</Version> | ||
<SemanticVersion>$(Version.Substring(0, $(Version.LastIndexOf('.'))))</SemanticVersion> | ||
</PropertyGroup> | ||
<XmlPoke XmlInputPath="$(TempNuspecFilePath)" | ||
Query="//metadata/version" | ||
Value="$(SemanticVersion)" /> | ||
<XmlPoke XmlInputPath="$(TempNuspecFilePath)" | ||
Query="//metadata/dependencies/dependency/Albedo/@version" | ||
Value="$(SemanticVersion)" /> | ||
</Target> | ||
<Target Name="NuGetPack" DependsOnTargets="NuGetPrepare"> | ||
<Exec Command="Src\packages\NuGet.CommandLine.2.7.1\tools\NuGet.exe pack %(TempNuspecFiles.FullPath) -BasePath $(ReleaseFolder) -OutputDirectory $(NuGetOutputFolder)" /> | ||
</Target> | ||
<Target Name="CleanTemporaryNuGetSpecFiles" DependsOnTargets="NuGetPack"> | ||
<Delete Files="@(TempNuspecFiles)" /> | ||
</Target> | ||
<Target Name="CompleteBuild" DependsOnTargets="CopyToReleaseFolder;CleanTemporaryNuGetSpecFiles" /> | ||
<GetAssemblyIdentity AssemblyFiles="$(AssemblyFile)"> | ||
<Output TaskParameter="Assemblies" ItemName="AssemblyInfo" /> | ||
</GetAssemblyIdentity> | ||
<PropertyGroup> | ||
<Version>%(AssemblyInfo.Version)</Version> | ||
<SemanticVersion>$(Version.Substring(0, $(Version.LastIndexOf('.'))))</SemanticVersion> | ||
</PropertyGroup> | ||
<XmlPoke XmlInputPath="$(TempNuspecFilePath)" | ||
Query="//metadata/version" | ||
Value="$(SemanticVersion)" /> | ||
<XmlPoke XmlInputPath="$(TempNuspecFilePath)" | ||
Query="//metadata/dependencies/dependency[contains(@id, '$(NuGetPackageDependencyRoot)')]/@version" | ||
Value="$(SemanticVersion)" /> | ||
</Target> | ||
<Target Name="NuGetPack" DependsOnTargets="NuGetPrepare"> | ||
<Exec Command="$(NuGetPath)\nuget.exe pack %(TempNuspecFiles.FullPath) -BasePath $(ReleaseFolder) -OutputDirectory $(NuGetOutputFolder)" /> | ||
</Target> | ||
<Target Name="CleanTemporaryNuGetSpecFiles" DependsOnTargets="NuGetPack"> | ||
<Delete Files="@(TempNuspecFiles)" /> | ||
</Target> | ||
|
||
<!--Done--> | ||
<Target Name="CompleteBuild" DependsOnTargets="CleanTemporaryNuGetSpecFiles" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters