Skip to content

Commit

Permalink
Update build to attempt to allow mono to package nupkg, still not the…
Browse files Browse the repository at this point in the history
…re yet (can't clean and build without errors).

Add ability to patch AssemblyInformationalVersion of GlobalAssemblyInfo.cs when building
  • Loading branch information
cwensley committed Sep 23, 2014
1 parent 1ad3e89 commit 4d3b864
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Source/packages
Source/Components
AppPackages
Tutorials/packages
Resources/packages
40 changes: 31 additions & 9 deletions Resources/Publish.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,48 @@
<TargetDir Condition="$(TargetDir) == ''">..\BuildOutput\Nuget\$(Configuration)</TargetDir>
<PackageTargets Condition="$(PackageTargets) == ''">Clean;Build</PackageTargets>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
<Platform Condition="$(Platform) == ''">Windows</Platform>
<MSBuildCommunityVersion>1.4.0.78</MSBuildCommunityVersion>
<MSBuildCommunityTasksPath>$(MSBuildThisFileDirectory)\packages\MSBuildTasks.$(MSBuildCommunityVersion)\tools</MSBuildCommunityTasksPath>
<MSBuildCommunityTasksLib>$([MSBUILD]::Unescape($(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll))</MSBuildCommunityTasksLib>
<BuildVersion Condition="$(BuildVersion) == ''"></BuildVersion>
</PropertyGroup>
<Import Project="$(BaseDir)\.nuget\NuGet.targets" Condition="Exists('$(BaseDir)\.nuget\NuGet.targets')" />
<Target Name="PrepareMac">
<UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.FileUpdate" />

<Target Name="UpdateAssemblyInfo" Condition="$(BuildVersion) != ''">
<Exec Command="nuget install MSBuildTasks -Version $(MSBuildCommunityVersion) -OutputDirectory packages"
Condition="! Exists('$(MSBuildCommunityTasksPath)')" />

<FileUpdate Files="$(BaseDir)\Shared\GlobalAssemblyInfo.cs"
Regex='AssemblyInformationalVersion[(]&quot;.*&quot;[)]'
ReplacementText='AssemblyInformationalVersion(&quot;$(BuildVersion)&quot;)' />
</Target>

<Target Name="PrepareMac" DependsOnTargets="UpdateAssemblyInfo">
<PropertyGroup>
<mdtool Condition="$(mdtool) == ''">"/Applications/Xamarin Studio.app/Contents/MacOS/mdtool"</mdtool>
</PropertyGroup>


<Exec Command="$(mdtool) build -t:Clean -p:Eto.XamMac -c:'$(Configuration)' $(BaseDir)\Eto.sln" />
<Exec Command="$(mdtool) build -t:Clean -p:Eto -c:'$(Configuration)' $(BaseDir)\Eto.sln" />
<Exec Command="$(mdtool) build -p:Eto.XamMac -c:'$(Configuration)|Mac' $(BaseDir)\Eto.sln" />

<!-- need to clean between non-pcl and pcl otherwise xbuild gets confused -->
<Exec Command="$(mdtool) build -t:Clean -p:'Eto.XamMac - Pcl' -c:'$(Configuration)' '$(BaseDir)\Eto - Pcl.sln'" />
<Exec Command="$(mdtool) build -t:Clean -p:'Eto - Pcl' -c:'$(Configuration)' '$(BaseDir)\Eto - Pcl.sln'" />
<Exec Command="$(mdtool) build -p:'Eto.XamMac - Pcl' -c:'$(Configuration)|Mac' '$(BaseDir)\Eto - Pcl.sln'" />
<Exec Command="$(mdtool) build -p:'Eto.XamMac2 - Pcl' -c:'$(Configuration)|Mac' '$(BaseDir)\Eto - Pcl.sln'" />
<Exec Command="$(mdtool) build -p:'Eto.iOS' -c:'$(Configuration)|iPhoneSimulator' '$(BaseDir)\Eto - iOS.sln'" />
</Target>
<Target Name="Package">
<MSBuild Projects="$(BaseDir)\Eto.sln" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);Platform=Windows" />
<MSBuild Projects="$(BaseDir)\Eto - Pcl.sln" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);Platform=Windows" />

<Target Name="Package" DependsOnTargets="UpdateAssemblyInfo">
<MSBuild Projects="$(BaseDir)\Eto.sln" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);Platform=$(Platform)" />
<MSBuild Projects="$(BaseDir)\Eto - Pcl.sln" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);Platform=$(Platform)" />
<!--MSBuild Projects="$(BaseDir)\Eto - WinRT.sln" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);Platform=Any CPU" /-->
<MSBuild Projects="$(BaseDir)\Eto.WinRT\Eto.WinRT.csproj" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);BuildProjectReferences=false" />
<MSBuild Projects="$(BaseDir)\Eto.Test\Eto.Test.WinRT\Eto.Test.WinRT.csproj" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);BuildProjectReferences=false" />
<MSBuild Projects="$(BaseDir)\Eto.WinRT\Eto.WinRT.csproj" Properties="Configuration=$(Configuration);BuildProjectReferences=false" Condition="$(Platform) == 'Windows'" />
<MSBuild Projects="$(BaseDir)\Eto.Test\Eto.Test.WinRT\Eto.Test.WinRT.csproj" Properties="Configuration=$(Configuration);BuildProjectReferences=false" Condition="$(Platform) == 'Windows'" />

<!-- build XamMac separately if it hasn't been built on mac -->
<MSBuild Projects="$(BaseDir)\Eto.Mac\Eto.XamMac.csproj" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);BuildProjectReferences=false" Condition="! Exists('$(SourceDir)\Eto.XamMac.dll')" />
Expand All @@ -48,14 +68,15 @@
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.Mac.nuspec;NuspecInfoAssembly=$(SourceDir)\Eto.Mac.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.Mac64.nuspec;NuspecInfoAssembly=$(SourceDir)\Eto.Mac64.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.Windows.nuspec;NuspecInfoAssembly=$(SourceDir)\Eto.WinForms.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.Wpf.nuspec;NuspecInfoAssembly=$(SourceDir)\Eto.Wpf.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.Wpf.nuspec;NuspecInfoAssembly=$(SourceDir)\Eto.Wpf.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)" Condition="Exists('$(SourceDir)\Eto.Wpf.dll')"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.XamMac.nuspec;NuspecInfoAssembly=$(SourceDir)\Eto.XamMac.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.XamMac2.nuspec;NuspecInfoAssembly=$(SourcePclDir)\Eto.XamMac2.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)" Condition="Exists('$(SourcePclDir)\Eto.XamMac2.dll')"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.WinRT.nuspec;NuspecInfoAssembly=$(SourcePclDir)\Eto.WinRT.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.WinRT.nuspec;NuspecInfoAssembly=$(SourcePclDir)\Eto.WinRT.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)" Condition="Exists('$(SourcePclDir)\Eto.WinRT.dll')"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Serialization.Json.nuspec;NuspecInfoAssembly=$(SourceDir)\Eto.Serialization.Json.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Serialization.Xaml.nuspec;NuspecInfoAssembly=$(SourceDir)\Eto.Serialization.Xaml.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.MacAppTemplate\Eto.Platform.Mac.Template.nuspec;NugetBuildOptions=-Version $(AssemblyVersion);TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Forms.Sample\Eto.Forms.Sample.nuspec;NugetBuildOptions=-Version $(AssemblyVersion);TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="BuildPackage" Properties="ProjectPath=nuspec\Eto.Platform.iOS.nuspec;NuspecInfoAssembly=$(SourcePclDir)\Eto.iOS.dll;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)" Condition="Exists('$(SourcePclDir)\Eto.iOS.dll')"/>
</Target>
<Target Name="Publish">
<GetAssemblyInformationVersion AssemblyFileName="$(SourceDir)\Eto.dll">
Expand All @@ -76,5 +97,6 @@
<MSBuild Targets="PublishPackage" Properties="NupkgName=Eto.Serialization.Xaml.$(AssemblyVersion).nupkg;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="PublishPackage" Properties="NupkgName=Eto.Platform.Mac.Template.$(AssemblyVersion).nupkg;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="PublishPackage" Properties="NupkgName=Eto.Forms.Sample.$(AssemblyVersion).nupkg;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
<MSBuild Targets="PublishPackage" Properties="NupkgName=Eto.Platform.iOS.$(AssemblyVersion).nupkg;TargetDir=$(TargetDir)" Projects="$(MSBuildProjectFile)"/>
</Target>
</Project>
32 changes: 32 additions & 0 deletions Resources/nuspec/Eto.Platform.iOS.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>Eto.Platform.iOS</id>
<version>$version$</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
<licenseUrl>https://github.com/picoe/Eto/raw/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/picoe/Eto</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>$description$</summary>
<description>
This is the iOS mobile platform for Eto.Forms UI Framework.

Include this along with your Eto.Forms application to provide an iOS interface for iPhone/iPad/iPod touch users using Xamarin.iOS.

You do not need to use any of the classes of this assembly (unless customizing the iOS functionality of the platform), and should just use the UI controls from the Eto assembly.
</description>
<copyright>$copyright$</copyright>
<tags>cross platform gui ui framework desktop ios eto.forms</tags>
<dependencies>
<group>
<dependency id="Eto.Forms" version="$version$" />
</group>
</dependencies>
</metadata>
<files>
<file src="..\..\BuildOutput\Pcl\$configuration$\Eto.iOS.dll" target="lib\monotouch\" />
<file src="..\..\BuildOutput\$configuration$\LICENSE.txt" target="LICENSE.txt" />
</files>
</package>
2 changes: 1 addition & 1 deletion Resources/package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ echo off

set MSBUILD=c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

%MSBUILD% -t:Package Publish.targets
%MSBUILD% -t:Package -p:BuildVersion=%1 Publish.targets

pause
3 changes: 3 additions & 0 deletions Resources/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

xbuild /t:Package /p:BuildVersion=$1 /p:Platform=Mac Publish.targets
2 changes: 1 addition & 1 deletion Resources/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

xbuild /t:PrepareMac Publish.targets
xbuild /t:PrepareMac /p:BuildVersion=$1 Publish.targets
2 changes: 1 addition & 1 deletion Source/Eto.Test/Eto.Test.Mac/Eto.Test.Mac - Pcl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<None Include="Info.plist" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" Condition="Exists('$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets')" />
<ItemGroup>
<Content Include="TestIcon.icns" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Source/Eto.Test/Eto.Test.Mac/Eto.Test.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<None Include="Info.plist" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" Condition="Exists('$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets')" />
<ItemGroup>
<ProjectReference Include="..\Eto.Test\Eto.Test.csproj">
<Project>{F8F400B8-A2F6-4342-82F6-D6D8B544A7E5}</Project>
Expand Down
2 changes: 1 addition & 1 deletion Source/Eto.Test/Eto.Test.Mac/Eto.Test.XamMac - Pcl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" Condition="Exists('$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets')" />
<ItemGroup>
<Content Include="TestIcon.icns" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Source/Eto.Test/Eto.Test.Mac/Eto.Test.XamMac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" Condition="Exists('$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets')" />
<ItemGroup>
<ProjectReference Include="..\Eto.Test\Eto.Test.csproj">
<Project>{F8F400B8-A2F6-4342-82F6-D6D8B544A7E5}</Project>
Expand Down

0 comments on commit 4d3b864

Please sign in to comment.