Skip to content

Commit

Permalink
added build and nuspec file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Nov 14, 2013
1 parent aca13e8 commit f2d9383
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
[Dd]ebug/
[Rr]elease/
x64/
build/
*/build/
!build
[Bb]in/
[Oo]bj/

Expand Down
73 changes: 73 additions & 0 deletions build/Build.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<SrcDir>$(MSBuildProjectDirectory)\..\src</SrcDir>
<SlnDir>$(MSBuildProjectDirectory)\..</SlnDir>
</PropertyGroup>

<PropertyGroup>
<Version Condition="$(BUILD_NUMBER) != ''">$(BUILD_NUMBER)</Version>
<Version Condition="$(BUILD_NUMBER) == ''">1.0.0.0</Version>
</PropertyGroup>

<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''" >Release</Configuration>
<BuildDir>$(MSBuildProjectDirectory)\tmp</BuildDirSigned>
<SolutionFile>$(SrcDir)\ShellProgressBar.sln</SolutionFile>
</PropertyGroup>

<Target Name="Compile">
<AssemblyInfo CodeLanguage="CS"
OutputFile="$(SrcDir)\ShellProgressBar\Properties\AssemblyInfo.cs"
AssemblyTitle="ShellProgressBar"
AssemblyDescription="ShellProgressBar - a progressbar for your console applications"
AssemblyCompany=""
AssemblyProduct="ShellProgressBar"
AssemblyCopyright="Martijn Laarman MIT LICENSED"
ComVisible="false"
CLSCompliant="true"
Guid="07E5CFA3-CF5F-4D17-874C-8D5CC6FA3E73"

AssemblyVersion="$(Version)"
AssemblyFileVersion="$(Version)"/>
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(Configuration)" />
</Target>

<Target Name="NuGetPackage" DependsOnTargets="Compile">
<ItemGroup>
<MainBinaries Include="$(SrcDir)\**\ShellProgressBar\bin\$(Configuration)\**\*.*" />
</ItemGroup>

<!-- First copy the nuspec template files to the build dir -->
<Copy SourceFiles="..\build\ShellProgressBar.nuspec" DestinationFolder="$(BuildDir)" />
<!-- Copy the source files to the package dir -->
<Copy SourceFiles="@(MainBinaries)" DestinationFolder="$(BuildDir)\lib\NET20\" />

<!-- Get the version number of the main FV assembly to insert into the nuspec files -->
<GetAssemblyIdentity AssemblyFiles="$(BuildDir)\lib\NET20\ShellProgressBar.dll">
<Output TaskParameter="Assemblies" ItemName="AsmInfo" />
</GetAssemblyIdentity>

<!-- Create signed copies -->
<Exec WorkingDirectory="$(BuildDirSigned)"
Command='$(MSBuildProjectDirectory)\tools\ilmerge.exe $(<BuildDirSigned>)\lib\NET20\ShellProgressBar.dll /keyfile:$(MSBuildProjectDirectory)\keys\keypair.snk /out:$(<BuildDirSigned>)\lib\NET20\ShellProgressBar.dll /targetplatform:v4,"%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"' />

<!-- insert the version number into the nuspec files -->
<XmlUpdate
Namespace="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"
Prefix="n"
XmlFileName="$(BuildDir)\ShellProgressBar.nuspec"
XPath="/n:package/n:metadata/n:version"
Value="%(AsmInfo.Version)" />

<Exec WorkingDirectory="$(BuildDir)"
Command="$(MSBuildProjectDirectory)\tools\nuget.exe pack $(BuildDir)\ShellProgressBar.nuspec" />

<ItemGroup>
<Packages Include="$(BuildDir)\*.nupkg" />
</ItemGroup>
<Copy SourceFiles="@(Packages)" DestinationFolder="$(BuildDir)\..\_out" />

<RemoveDir Directories="$(BuildDir)" />
</Target>
</Project>
22 changes: 22 additions & 0 deletions build/ShellProgressBar.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>ShellProgressBar</id>
<version>0.1.0.0</version>
<title>ProgressBar - A progress bar for console applications</title>
<authors>Martijn Laarman</authors>
<owners>Martijn Laarman</owners>
<iconUrl></iconUrl>
<licenseUrl>http://mpdreamz.mit-license.org/</licenseUrl>
<projectUrl>https://github.com/Mpdreamz/NEST</projectUrl>
<summary>A progress bar for console applications</summary>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A progress bar for console applications</description>
<tags>console shell progress progressbar</tags>
</metadata>
<files>
<file src="lib\**\ShellProgressBar.dll" target="lib"/>
<file src="lib\**\ShellProgressBar.pdb" target="lib"/>
<file src="lib\**\ShellProgressBar.XML" target="lib"/>
</files>
</package>
Binary file added build/keys/public.snk
Binary file not shown.

0 comments on commit f2d9383

Please sign in to comment.