Added nuget build target
authorStefanos A <stapostol@gmail.com>
Fri, 13 Dec 2013 09:51:34 +0000 (10:51 +0100)
committerStefanos A <stapostol@gmail.com>
Fri, 13 Dec 2013 09:51:34 +0000 (10:51 +0100)
This will create a nupkg file for OpenTK and copy it to the base
directory. Version information is currently hardcoded to 1.1 (this
should be fixed.)

Installers/Nuget/Build.Installer.Nuget.csproj [new file with mode: 0644]
Installers/Nuget/OpenTK.nuspec [new file with mode: 0644]
Installers/Nuget/logo.png [new file with mode: 0644]

diff --git a/Installers/Nuget/Build.Installer.Nuget.csproj b/Installers/Nuget/Build.Installer.Nuget.csproj
new file mode 100644 (file)
index 0000000..02902de
--- /dev/null
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)' == 'Documentation'">
+    <OutputPath>.\obj\</OutputPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
+    <OutputPath>.\obj\</OutputPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
+    <OutputPath>.\obj\</OutputPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)' == 'Nsis'">
+    <OutputPath>.\obj\</OutputPath>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ProjectGuid>{ADC34399-7613-44D2-90B2-19250F12FE7B}</ProjectGuid>
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+    <OutputPath>.\obj\</OutputPath>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>10.0.0</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <OutputType>Exe</OutputType>
+    <AssemblyName>Build.Installer.Nuget</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Documentation|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>False</Optimize>
+    <OutputPath>obj\</OutputPath>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>False</Optimize>
+    <OutputPath>obj\</OutputPath>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>False</Optimize>
+    <OutputPath>obj\</OutputPath>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Nsis|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>False</Optimize>
+    <OutputPath>obj\</OutputPath>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <Target Name="Build">
+    <!-- Copy built files to the tree format expected by nuget -->
+    <CreateItem Include="../../Binaries/OpenTK/Release/OpenTK*">
+      <Output TaskParameter="Include" ItemName="Binaries" />
+    </CreateItem>
+    <Copy SourceFiles="@(Binaries)" DestinationFolder="./lib/net20" />
+    <!-- Execute nuget script -->
+    <Exec Command="nuget.exe pack OpenTK.nuspec" Condition="$(OS) == 'Windows_NT'" />
+    <Exec Command="mono nuget.exe pack OpenTK.nuspec" Condition="$(OS) != 'Windows_NT'" />
+    <!-- Copy the nuget archive to the root directory and add a date stamp -->
+    <ReadLinesFromFile File="../../Version.txt">
+      <Output TaskParameter="Lines" ItemName="Version" />
+    </ReadLinesFromFile>
+    <Copy SourceFiles=".\OpenTK.1.1.nupkg" DestinationFiles="@(Version-&gt;'..\..\opentk-%(Identity).nupkg')" />
+  </Target>
+  <Target Name="Clean">
+    <CreateItem Include="OpenTK.1.1.nupkg;lib/**">
+      <Output TaskParameter="Include" ItemName="FilesToDelete" />
+    </CreateItem>
+    <Delete Files="@(FilesToDelete)" />
+  </Target>
+  <Target Name="Rebuild">
+    <CallTarget Targets="Clean" />
+    <CallTarget Targets="Build" />
+  </Target>
+  <ItemGroup>
+    <None Include="OpenTK.nuspec" />
+  </ItemGroup>
+</Project>
diff --git a/Installers/Nuget/OpenTK.nuspec b/Installers/Nuget/OpenTK.nuspec
new file mode 100644 (file)
index 0000000..e6820e7
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
+  <metadata>
+    <id>OpenTK</id>
+    <version>1.1</version>
+    <authors>Stefanos Apostolopoulos</authors>
+    <owners>Stefanos Apostolopoulos</owners>
+    <licenseUrl>http://www.opentk.com/project/license</licenseUrl>
+    <projectUrl>http://www.opentk.com</projectUrl>
+    <iconUrl>file:///./logo.png</iconUrl>
+    <requireLicenseAcceptance>false</requireLicenseAcceptance>
+    <description>The Open Toolkit library (OpenTK)</description>
+    <releaseNotes>ars</releaseNotes>
+    <copyright>Copyright 2006-2013</copyright>
+    <tags>OpenTK OpenAL OpenGL C# F# VB OpenTK.dll</tags>
+    <references>
+        <reference file="OpenTK.dll" />
+    </references>
+  </metadata>
+    <files>
+        <file src="lib/net20/OpenTK.dll" target="lib/net20" />
+        <file src="lib/net20/OpenTK.dll.config" target="lib/net20" />
+        <file src="lib/net20/OpenTK.xml" target="lib/net20" />
+    </files>
+</package>
diff --git a/Installers/Nuget/logo.png b/Installers/Nuget/logo.png
new file mode 100644 (file)
index 0000000..43bdc61
Binary files /dev/null and b/Installers/Nuget/logo.png differ