Skip to content

Commit

Permalink
Move more things
Browse files Browse the repository at this point in the history
- Use NuGet.config to specify a specific directory for packages (for XamMac)
- Updates to MacTemplate to deal with a custom icon and Info.plist at the root
- App icons should use Eto's icon.
  • Loading branch information
cwensley committed Jan 12, 2018
1 parent 7524083 commit a4ee40b
Show file tree
Hide file tree
Showing 69 changed files with 261 additions and 276 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
*.suo
bin/
obj/
/BuildOutput
*.shfbproj_*
UpgradeLog*.htm
Source/Components
/src/Components
AppPackages
packages/
.vs/
[Tt]humbs.db
artifacts
/artifacts

2 changes: 1 addition & 1 deletion test/Directory.Build.props → Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<XamarinMacLibPath>$(XamarinMacPath)/lib/mono</XamarinMacLibPath>
<!-- Prevent VS2015 from copying files from the GAC to the output folder -->
<DoNotCopyLocalIfInGac>true</DoNotCopyLocalIfInGac>
<BasePath>$(MSBuildThisFileDirectory)..\</BasePath>
<BasePath>$(MSBuildThisFileDirectory)</BasePath>
<BaseIntermediateOutputPath>$(BasePath)artifacts\obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Deterministic>False</Deterministic>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.targets → Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
</ItemGroup>
<Message Importance="high" Text="Embedding: @(FilesToEmbed->'%(Filename)%(Extension)', ', ')" />
</Target>
<Import Project="$(BasePath)build\nuspec\Eto.Platform.MacAppTemplate\Eto.Platform.Mac.Template.targets" Condition="$(UseMacTemplate) == 'True'" />
<Import Project="$(BasePath)build\nuspec\MacTemplate\MacTemplate.targets" Condition="$(UseMacTemplate) == 'True'" />
<Import Condition="Exists('$(BasePath)..\Eto.Common.targets')" Project="$(BasePath)..\Eto.Common.targets" />
</Project>
9 changes: 9 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<configuration>
<config>
<!--
Used for projects using packages.config (e.g. XamMac)
Remove when XamMac is removed as everything else we're using <PackageReference>
-->
<add key="repositoryPath" value="artifacts/packages" />
</config>
</configuration>
2 changes: 1 addition & 1 deletion Samples/Gtk/EmbedEtoInGtk/gtk-gui/gui.stetic
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</configuration>
<import>
<widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<widget-library name="../../../../artifacts/Debug/net45/Eto.Gtk2.dll" />
<widget-library name="../../../../artifacts/core/Debug/net45/Eto.Gtk2.dll" />
<widget-library name="../bin/Debug/EmbedEtoInGtk.exe" internal="true" />
</import>
<widget class="Gtk.Window" id="EmbedEtoInGtk.MainWindow" design-size="423 312">
Expand Down
2 changes: 1 addition & 1 deletion Samples/Gtk/EmbedGtkInEto/gtk-gui/gui.stetic
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<target-gtk-version>2.12</target-gtk-version>
</configuration>
<import>
<widget-library name="../../../../artifacts/Debug/net45/Eto.Gtk2.dll" />
<widget-library name="../../../../artifacts/core/Debug/net45/Eto.Gtk2.dll" />
<widget-library name="../bin/Debug/EmbedGtkInEto.exe" internal="true" />
</import>
<widget class="Gtk.Bin" id="EmbedGtkInEto.MyNativeWidget" design-size="422 183">
Expand Down
2 changes: 1 addition & 1 deletion Samples/MonoMac/EmbedEtoInMonoMac/EmbedEtoInMonoMac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="MonoMac">
<HintPath>..\..\..\Libraries\MonoMac\MonoMac.dll</HintPath>
<HintPath>..\..\..\lib\MonoMac\MonoMac.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/MonoMac/EmbedMonoMacInEto/EmbedMonoMacInEto.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="MonoMac">
<HintPath>..\..\..\Libraries\MonoMac\MonoMac.dll</HintPath>
<HintPath>..\..\..\lib\MonoMac\MonoMac.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<RootNamespace>Tutorial1</RootNamespace>
<AssemblyName>Tutorial1</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<UseMacTemplate>True</UseMacTemplate>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -54,5 +55,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\Tutorial.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<RootNamespace>Tutorial2</RootNamespace>
<AssemblyName>Tutorial2</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<UseMacTemplate>True</UseMacTemplate>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -54,5 +55,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\Tutorial.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<RootNamespace>Tutorial3</RootNamespace>
<AssemblyName>Tutorial3</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<UseMacTemplate>True</UseMacTemplate>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -54,5 +55,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\Tutorial.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<RootNamespace>Tutorial4</RootNamespace>
<AssemblyName>Tutorial4</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<UseMacTemplate>True</UseMacTemplate>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -56,5 +57,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\Tutorial.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<Name>Tutorial1 - Hello World</Name>
<UseMacTemplate>True</UseMacTemplate>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -84,7 +85,6 @@
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<Import Project="..\..\Tutorial.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<Name>Tutorial2 - Menus and Toolbars</Name>
<UseMacTemplate>True</UseMacTemplate>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -84,7 +85,6 @@
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<Import Project="..\..\Tutorial.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<Name>Tutorial2 - Menus and Toolbars</Name>
<UseMacTemplate>True</UseMacTemplate>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -84,7 +85,6 @@
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<Import Project="..\..\Tutorial.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<Name>Tutorial2 - Menus and Toolbars</Name>
<UseMacTemplate>True</UseMacTemplate>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -84,7 +85,6 @@
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<Import Project="..\..\Tutorial.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
4 changes: 0 additions & 4 deletions Samples/Tutorials/Tutorial.targets

This file was deleted.

4 changes: 2 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ echo off
WHERE msbuild
IF %ERRORLEVEL% NEQ 0 ECHO msbuild not found. Run in the Developer Command Prompt for VS 2017

cd %~dp0\build
msbuild -t:Package -p:BuildVersion=%1 Build.proj
set BUILD_DIR=%~dp0\build
msbuild -t:Package -p:BuildVersion=%1 "%BUILD_DIR%\Build.proj"

pause
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

cd build
xbuild /t:Package /p:BuildVersion=$1 Build.proj
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
msbuild /t:Package /p:BuildVersion=$1 $DIR/build/Build.proj
15 changes: 8 additions & 7 deletions build/Build.proj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" DefaultTargets="Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
<BaseDir Condition="$(BaseDir) == ''">..</BaseDir>
<SourceDir Condition="$(SourceDir) == ''">$(BaseDir)\src</SourceDir>
<NugetDir Condition="$(NugetDir) == ''">$(SourceDir)</NugetDir>
<ArtifactsDir Condition="$(BuildOutoutDir) == ''">$(BaseDir)\artifacts</ArtifactsDir>
<ArtifactsNet45Dir Condition="$(ArtifactsNet45Dir) == ''">$(ArtifactsDir)\$(Configuration)\net45</ArtifactsNet45Dir>
<ArtifactsNetStandard13Dir Condition="$(ArtifactsNetStandard13Dir) == ''">$(ArtifactsDir)\$(Configuration)\netstandard1.3</ArtifactsNetStandard13Dir>
<ArtifactsModernDir Condition="$(ArtifactsModernDir) == ''">$(ArtifactsDir)\$(Configuration)\modern</ArtifactsModernDir>
<ArtifactsNet45Dir Condition="$(ArtifactsNet45Dir) == ''">$(ArtifactsDir)\core\$(Configuration)\net45</ArtifactsNet45Dir>
<ArtifactsNetStandard13Dir Condition="$(ArtifactsNetStandard13Dir) == ''">$(ArtifactsDir)\core\$(Configuration)\netstandard1.3</ArtifactsNetStandard13Dir>
<ArtifactsModernDir Condition="$(ArtifactsModernDir) == ''">$(ArtifactsDir)\core\$(Configuration)\modern</ArtifactsModernDir>
<PackageTargets Condition="$(PackageTargets) == ''">Build</PackageTargets>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(ArtifactsDir)\nuget\$(Configuration.Trim('\\'))</PackageOutputDir>
<Platform Condition="$(Platform) == '' and '$(OS)' == 'Unix' and !Exists('/Library/Frameworks')">Linux</Platform>
Expand All @@ -20,8 +20,8 @@
<mdtool Condition="$(mdtool) == '' and $(Platform) == 'Linux'">"mdtool"</mdtool>
<mdtool Condition="$(mdtool) == '' and $(Platform) == 'Mac'">"/Applications/Xamarin Studio.app/Contents/MacOS/mdtool"</mdtool>
<mdtool Condition="$(mdtool) == '' and $(Platform) == 'Windows'">"c:\Program Files (x86)\Xamarin Studio\bin\mdtool.exe"</mdtool>
<IncludeXamMac Condition="$(IncludeXamMac) == '' and (Exists('/Library/Frameworks/Xamarin.Mac.framework') or Exists('$(ArtifactsNet45Dir)/XamMac.dll'))">true</IncludeXamMac>
<IncludeXamiOS Condition="$(IncludeXamiOS) == '' and $(Platform) == 'Mac' and Exists('/Library/Frameworks/Xamarin.iOS.framework')">true</IncludeXamiOS>
<XamarinMacPath>\Library\Frameworks\Xamarin.Mac.framework\Versions\Current</XamarinMacPath>
<ReferencePath Condition="$(ReferencePath) == '' and Exists('$(XamarinMacPath)')">$(XamarinMacPath)\lib\mono</ReferencePath>
<UtilitiesBasePath>$(ArtifactsDir)\obj</UtilitiesBasePath>
</PropertyGroup>
<Import Project="Utilities.targets" Condition="$(UtilitiesImported) == ''" />
Expand Down Expand Up @@ -116,7 +116,8 @@
</Target>

<Target Name="Build" DependsOnTargets="UpdateVersion">
<MSBuild Projects="$(SourceDir)\Eto.sln" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);Platform=$(Platform)"/>
<Exec Command="nuget restore $(SourceDir)\Eto.sln" /> <!-- msbuild restore target doesn't use package.config (needed only for XamMac currently) -->
<MSBuild Projects="$(SourceDir)\Eto.sln" Targets="$(PackageTargets)" Properties="Configuration=$(Configuration);Platform=$(Platform);ReferencePath=$(ReferencePath)"/>
</Target>


Expand Down
Binary file modified build/nuget.exe
Binary file not shown.
5 changes: 3 additions & 2 deletions build/nuspec/Eto.Platform.Mac.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ You do not need to use any of the classes of this assembly (unless customizing t
</dependencies>
</metadata>
<files>
<file src="Libraries/MonoMac/MonoMac.dll" target="lib\net45" />
<file src="Libraries/MonoMac/MonoMac-License.txt" target="MonoMac-License.txt" />
<file src="lib/MonoMac/MonoMac.dll" target="lib\net45" />
<file src="lib/MonoMac/MonoMac-License.txt" target="MonoMac-License.txt" />
<file src="artifacts/$configuration$/net45/Eto.Mac.dll" target="lib\net45" />
<file src="artifacts/$configuration$/net45/LICENSE.txt" target="LICENSE.txt" />
<file src="build/MacTemplate/*.*" target="build\" />
</files>
</package>
5 changes: 3 additions & 2 deletions build/nuspec/Eto.Platform.Mac64.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ You do not need to use any of the classes of this assembly (unless customizing t
</dependencies>
</metadata>
<files>
<file src="Libraries/MonoMac64/MonoMac.dll" target="lib\net45" />
<file src="Libraries/MonoMac64/MonoMac-License.txt" target="MonoMac-License.txt" />
<file src="lib/MonoMac64/MonoMac.dll" target="lib\net45" />
<file src="lib/MonoMac64/MonoMac-License.txt" target="MonoMac-License.txt" />
<file src="artifacts/$configuration$/net45/Eto.Mac64.dll" target="lib\net45" />
<file src="artifacts/$configuration$/net45/LICENSE.txt" target="LICENSE.txt" />
<file src="build/MacTemplate/*.*" target="build\" />
</files>
</package>
Binary file removed build/nuspec/Eto.Platform.MacAppTemplate/Icon.icns
Binary file not shown.
Binary file added build/nuspec/MacTemplate/Icon.icns
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a4ee40b

Please sign in to comment.