Permalink
Browse files

Added packaging script.

1 parent bb86807 commit 19298613bbd5912cb0a37f23083ee82f3ee82fe7 @distantcam distantcam committed Oct 10, 2012
Showing with 94 additions and 12 deletions.
  1. +1 −1 .gitignore
  2. +23 −0 artifacts/MarkPad.nuspec
  3. +7 −0 full-clean.cmd
  4. +2 −11 package.cmd
  5. +61 −0 tools/package.proj
View
@@ -104,5 +104,5 @@ packages
*.log
# our output folder for build artifacts
-artifacts
+artifacts/*.nupkg
src/GlobalAssemblyInfo.cs
View
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>MarkPad</id>
+ <version>$version$</version>
+ <title>MarkPad</title>
+ <authors>Code52</authors>
+ <owners>Code52</owners>
+ <licenseUrl>https://github.com/Code52/DownmarkerWPF/blob/master/Licence.md</licenseUrl>
+ <projectUrl>http://code52.org/DownmarkerWPF/</projectUrl>
+ <iconUrl>https://raw.github.com/Code52/DownmarkerWPF/master/src/MarkPad/icon.png</iconUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>A visual Markdown editor (inspired by the Downmarker project)</description>
+ <summary>A visual Markdown editor (inspired by the Downmarker project)</summary>
+ <language>en-AU</language>
+ <tags>MarkDown Editor</tags>
+ </metadata>
+ <files>
+ <file src="..\src\MarkPad\bin\$Configuration$\MarkPad.exe" target="lib\net40" />
+ <file src="..\src\MarkPad\bin\$Configuration$\MarkPad.exe.config" target="lib\net40" />
+ <file src="..\src\MarkPad\bin\$Configuration$\*.dll" target="lib\net40" />
+ </files>
+</package>
View
@@ -0,0 +1,7 @@
+@echo off
+
+call "%VS100COMNTOOLS%vsvars32.bat"
+
+msbuild.exe tools\package.proj /t:FullClean
+
+IF NOT ERRORLEVEL 0 EXIT /B %ERRORLEVEL%
View
@@ -1,16 +1,7 @@
@ECHO OFF
-SET build="%~dp0\build.cmd"
-SET copy="copy"
+call "%VS100COMNTOOLS%vsvars32.bat"
-CALL rmdir "%~dp0artifacts\" /s /q
-
-:: Pass the configuration parameter and all other parameters
-CALL %build% Release "x86"
-
-:: get build output and copy out to root
-CALL xcopy "%~dp0src\MarkPad\bin\Release\*" "%~dp0artifacts\" /s /e /Y
-
-CALL "C:\Program Files\7-Zip\7z.exe" a -tzip "%~dp0artifacts\MarkPad.zip" "%~dp0artifacts\*"
+msbuild.exe tools\package.proj /p:Configuration=Release
IF NOT ERRORLEVEL 0 EXIT /B %ERRORLEVEL%
View
@@ -0,0 +1,61 @@
+<Project DefaultTargets="NuGet" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration>Debug</Configuration>
+ <DownloadNuGetExe>true</DownloadNuGetExe>
+ </PropertyGroup>
+
+ <Import Project="GenerateCommonAssemblyInfo.Targets" />
+
+ <Target Name="FullClean" DependsOnTargets="Clean">
+ <ItemGroup>
+ <OldFiles Include="..\src\GlobalAssemblyInfo.cs" />
+ <OldFiles Include="..\**\*.suo" />
+ <OldFiles Include="..\**\*.user" />
+ <OldFiles Include="..\**\*.cache" />
+ <OldFiles Include="..\**\*.dat" />
+
+ <ProjectFiles Include="..\**\*.*proj" />
+ <OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)bin')" />
+ <OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)obj')" />
+ <OldDirectories Include="..\src\packages\" />
+ </ItemGroup>
+
+ <Delete Files="@(OldFiles)" />
+ <RemoveDir Directories="@(OldDirectories)" />
+ </Target>
+
+ <Target Name="Clean">
+ <ItemGroup>
+ <OldArtifacts Include="..\artifacts\*.nupkg" />
+ </ItemGroup>
+
+ <Delete Files="@(OldArtifacts)" />
+ </Target>
+
+ <Target Name="Compile" DependsOnTargets="Clean">
+ <ItemGroup>
+ <Projects Include="..\src\MarkPad.sln" />
+ </ItemGroup>
+
+ <MSBuild Projects="@(Projects)" Targets="Rebuild" Properties="Configuration=$(Configuration)" />
+ </Target>
+
+ <Target Name="NuGet" DependsOnTargets="Compile">
+ <PropertyGroup>
+ <AssemblyConfig Condition=" '$(AssemblyConfig)' != '' ">-$(AssemblyConfig)</AssemblyConfig>
+ <BuildNumber Condition=" '$(BuildNumber)' == '0' "></BuildNumber>
+ <BuildNumber Condition=" '$(AssemblyConfig)' == '' And $(BuildNumber) != '' ">.$(BuildNumber)</BuildNumber>
+
+ <NuGet>..\src\.nuget\NuGet.exe</NuGet>
+ <OutputDirectory>-OutputDirectory "..\artifacts"</OutputDirectory>
+ <VersionArg>-Version $(CurrentVersion)$(AssemblyConfig)$(BuildNumber)</VersionArg>
+ <ConfigArg>-Prop Configuration=$(Configuration)</ConfigArg>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <NuSpec Include="..\artifacts\*.nuspec" />
+ </ItemGroup>
+
+ <Exec Command='$(NuGet) pack "%(NuSpec.Identity)" $(OutputDirectory) $(VersionArg) $(ConfigArg)' />
+ </Target>
+</Project>

0 comments on commit 1929861

Please sign in to comment.