Skip to content

Commit

Permalink
Merge pull request #1025 from picoe/hotfix/fix-getcallingassembly
Browse files Browse the repository at this point in the history
Hotfix/fix getcallingassembly
  • Loading branch information
cwensley authored Feb 21, 2018
2 parents 112e394 + d84a31e commit 4d08b74
Show file tree
Hide file tree
Showing 29 changed files with 69 additions and 55 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: 2.4.0.{build}
version: 2.4.1.{build}
image: Visual Studio 2017
install:
- cinst gtksharp -y
build_script:
- set BASE=%APPVEYOR_BUILD_FOLDER%
- set BUILD_VERSION=000%APPVEYOR_BUILD_NUMBER%
- set BUILD_VERSION=2.4.0-build%BUILD_VERSION:~-4%
- set BUILD_VERSION=2.4.1-build%BUILD_VERSION:~-4%
- msbuild -t:Package -p:BuildVersion=%BUILD_VERSION% build\Build.proj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /consoleloggerparameters:NoSummary
- msbuild -t:BuildAddins build\Build.proj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /consoleloggerparameters:NoSummary
test: off
Expand Down
15 changes: 8 additions & 7 deletions build/Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
-->
<Package Include="Eto.Serialization.Json" Assembly="$(ArtifactsNetStandard10Dir)\Eto.Serialization.Json.dll" />
<Package Include="Eto.Serialization.Xaml" Assembly="$(ArtifactsNetStandard10Dir)\publish\Eto.Serialization.Xaml.dll" />

<StandalonePackage Include="Eto.Forms.Sample" Folder="Eto.Forms.Sample\"/>
<StandalonePackage Include="Eto.Platform.Mac.Template"/>
</ItemGroup>

<!-- Build all source code -->
Expand All @@ -196,12 +199,7 @@
<Target Name="Package" DependsOnTargets="Build;GetMainAssemblyVersion">
<MSBuild Targets="BuildPackage" Properties="Configuration=$(Configuration);AssemblyPath=%(Package.Assembly);NuspecPath=nuspec\%(Package.Identity).nuspec;BasePath=$(BaseDir);NupkgOutputDir=$(NugetOutputDir)" Projects="nuget.targets" Condition="Exists('%(Package.Assembly)')" />

<ItemGroup>
<StandalonePackage Include="Eto.Forms.Sample\Eto.Forms.Sample"/>
<StandalonePackage Include="Eto.Platform.Mac.Template"/>
</ItemGroup>

<MSBuild Targets="BuildPackage" Properties="Configuration=$(Configuration);AssemblyPath=;NuspecPath=nuspec\%(StandalonePackage.Identity).nuspec;NupkgOutputDir=$(NugetOutputDir);NugetBuildOptions=-Version $(AssemblyVersion)" Projects="nuget.targets" />
<MSBuild Targets="BuildPackage" Properties="Configuration=$(Configuration);AssemblyPath=;NuspecPath=nuspec\%(StandalonePackage.Folder)%(StandalonePackage.Identity).nuspec;NupkgOutputDir=$(NugetOutputDir);NugetBuildOptions=-Version $(AssemblyVersion)" Projects="nuget.targets" />

<!-- build dotnet template -->
<MSBuild Targets="RestorePackages" Properties="PackageSource=$(AddinDir)Eto.Forms.Templates\Eto.Forms.Templates.csproj" Projects="NuGet.targets" />
Expand Down Expand Up @@ -260,6 +258,7 @@
<!-- build the MD/VS for Mac and/or the VS addin, depending on your platform -->
<Target Name="BuildAddins">
<!-- monodevelop/VS for Mac -->
<MSBuild Targets="RestorePackages" Properties="PackageSource=$(AddinDir)Eto.Addin.MonoDevelop.sln" Projects="NuGet.targets" Condition="$(Platform) != 'Windows'" />
<MSBuild Projects="$(AddinDir)Eto.Addin.MonoDevelop.sln" Targets="Restore;Build" Properties="Configuration=$(Configuration)" Condition="$(Platform) != 'Windows'" />
<MSBuild Projects="$(AddinDir)Eto.Addin.MonoDevelop\Eto.Addin.MonoDevelop.csproj" Targets="PackageAddin" Properties="Configuration=$(Configuration)" Condition="$(Platform) != 'Windows'" />

Expand All @@ -270,6 +269,8 @@
<!-- publish nuget packages to nuget.org -->
<Target Name="Publish" DependsOnTargets="GetMainAssemblyVersion">
<MSBuild Targets="PublishPackage" Properties="NupkgName=%(Package.Identity).$(AssemblyVersion).nupkg;TargetDir=$(NugetOutputDir)" Projects="$(MSBuildProjectFile)"/>

<MSBuild Targets="PublishPackage" Properties="NupkgName=%(StandalonePackage.Identity).$(AssemblyVersion).nupkg;PackageOutputDir=$(NugetOutputDir)" Projects="NuGet.targets"/>
</Target>

<Target Name="Clean">
Expand All @@ -279,7 +280,7 @@
<RemoveDir Directories="$(SourceDir)\Addins\packages"/>
</Target>

<Target Name="GetMainAssemblyVersion" DependsOnTargets="Build">
<Target Name="GetMainAssemblyVersion">
<GetAssemblyInfo AssemblyFileName="$(ArtifactsNet45Dir)\Eto.dll">
<Output TaskParameter="AssemblyInformationalVersion" PropertyName="AssemblyVersion" />
</GetAssemblyInfo>
Expand Down
2 changes: 1 addition & 1 deletion build/NuGet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

<PropertyGroup>
<NupkgName Condition="$(NupkgName) == ''">$(AssemblyName).$(AssemblyInformationalVersion).nupkg</NupkgName>
<PublishCommand>$(NugetCommand) push $(NonInteractiveSwitch) "$(PackageOutputDir)\$(NupkgName)"</PublishCommand>
<PublishCommand>$(NugetCommand) push $(NonInteractiveSwitch) "$(PackageOutputDir)\$(NupkgName)" -src "https://nuget.org"</PublishCommand>
</PropertyGroup>

<Exec Command="$(PublishCommand)" />
Expand Down
2 changes: 1 addition & 1 deletion build/help/Help.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</Filter>
</ApiFilter>
<WorkingPath>%temp%\shfbworking\</WorkingPath>
<HelpFileVersion>2.4.0.0</HelpFileVersion>
<HelpFileVersion>2.4.1.0</HelpFileVersion>
<SaveComponentCacheCapacity>100</SaveComponentCacheCapacity>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in
Expand Down
4 changes: 2 additions & 2 deletions src/Addins/Eto.Addin.MonoDevelop/Eto.Addin.MonoDevelop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
</ItemGroup>
<ItemGroup>
<AddinFile Include="Templates\Files\**\*" />
<AddinFile Include="..\..\..\artifacts\nuget\MD$(Configuration)\Eto.Forms.Templates.2.4.0.nupkg">
<Link>Packages\Eto.Forms.Templates.2.4.0.nupkg</Link>
<AddinFile Include="..\..\..\artifacts\nuget\MD$(Configuration)\Eto.Forms.Templates.2.4.1.nupkg">
<Link>Packages\Eto.Forms.Templates.2.4.1.nupkg</Link>
</AddinFile>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Addins/Eto.Addin.MonoDevelop/Properties/AddinInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[assembly:Addin(
"MonoDevelop",
Namespace = "Eto.Addin",
Version = "2.4.0.0"
Version = "2.4.1.0"
)]

[assembly:AddinName("Eto.Forms Support Addin")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
<Extension path="/MonoDevelop/Ide/Templates">
<Template
id="Eto.App.CSharp"
path="Packages/Eto.Forms.Templates.2.4.0.nupkg"
path="Packages/Eto.Forms.Templates.2.4.1.nupkg"
imageId="eto-project"
wizard="Eto.Addin.MonoDevelop.ProjectWizard"
category="multiplat/app/eto"
supportedParameters="AppName,Separated,Xeto,Preview,Jeto,XamMac,NoDash"
/>
<Template
id="Eto.App.FSharp"
path="Packages/Eto.Forms.Templates.2.4.0.nupkg"
path="Packages/Eto.Forms.Templates.2.4.1.nupkg"
imageId="eto-project"
wizard="Eto.Addin.MonoDevelop.ProjectWizard"
category="multiplat/app/eto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
<Content Include="template.pkgdef">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\..\..\artifacts\nuget\$(Configuration)\Eto.Forms.Templates.2.4.0.nupkg">
<Link>Eto.Forms.Templates.2.4.0.nupkg</Link>
<Content Include="..\..\..\artifacts\nuget\$(Configuration)\Eto.Forms.Templates.2.4.1.nupkg">
<Link>Eto.Forms.Templates.2.4.1.nupkg</Link>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Resource Include="Templates\File-FSharp\File.ico" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Eto.Addin.VisualStudio" Version="2.4.0.0" Language="en-US" Publisher="Curtis Wensley" />
<Identity Id="Eto.Addin.VisualStudio" Version="2.4.1.0" Language="en-US" Publisher="Curtis Wensley" />
<DisplayName>Eto.Forms Visual Studio Addin</DisplayName>
<Description xml:space="preserve">Eto.Forms Support for Visual Studio. Eto.Forms is a cross platform GUI framework for desktop and mobile applications in .NET that can target Wpf, WinForms, Direct2D, MonoMac, Xamarin.Mac, Gtk2, Gtk3, and iOS with a single codebase.</Description>
<MoreInfo>https://github.com/picoe/Eto</MoreInfo>
Expand Down
2 changes: 1 addition & 1 deletion src/Addins/Eto.Forms.Templates/Eto.Forms.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<PackageType>Template</PackageType>
<PackageId>Eto.Forms.Templates</PackageId>
<PackageVersion>2.4.0</PackageVersion>
<PackageVersion>2.4.1</PackageVersion>
<Authors>Curtis Wensley</Authors>
<Description>Project and File templates for Eto.Forms</Description>
<Tags>cross-platform;gui;ui-framework;desktop;winforms;wpf;mac;osx;gtk;eto;eto.forms;dotnet-new</Tags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Eto.Platform.Windows" Version="2.4.0" Condition="$(IncludeWinForms) == 'True'" />
<PackageReference Include="Eto.Platform.Wpf" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Gtk" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Windows" Version="2.4.1" Condition="$(IncludeWinForms) == 'True'" />
<PackageReference Include="Eto.Platform.Wpf" Version="2.4.1" />
<PackageReference Include="Eto.Platform.Gtk" Version="2.4.1" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.4.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net461</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>

<PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
Expand All @@ -17,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Eto.Platform.Gtk" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Gtk" Version="2.4.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Eto.Platform.Mac64" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.4.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Eto.Platform.Windows" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Windows" Version="2.4.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Eto.Platform.Wpf">
<Version>2.4.0</Version>
<Version>2.4.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Eto.Platform.XamMac2">
<Version>2.4.0</Version>
<Version>2.4.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Eto.Forms" Version="2.4.0" />
<PackageReference Include="Eto.Serialization.Json" Version="2.4.0" Condition="$(UseJeto) == 'True'" />
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.0" Condition="$(UseXeto) == 'True'" />
<PackageReference Include="Eto.Forms" Version="2.4.1" />
<PackageReference Include="Eto.Serialization.Json" Version="2.4.1" Condition="$(UseJeto) == 'True'" />
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.1" Condition="$(UseXeto) == 'True'" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<ItemGroup>
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="FSharp.Core" Version="4.3.2" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Wpf" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Gtk2" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Gtk3" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.4.1" />
<PackageReference Include="Eto.Platform.Wpf" Version="2.4.1" />
<PackageReference Include="Eto.Platform.Gtk2" Version="2.4.1" />
<PackageReference Include="Eto.Platform.Gtk3" Version="2.4.1" />
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<ItemGroup>
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="FSharp.Core" Version="4.3.2" />
<PackageReference Include="Eto.Platform.Gtk2" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Gtk3" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Gtk2" Version="2.4.1" />
<PackageReference Include="Eto.Platform.Gtk3" Version="2.4.1" />
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<packages>
<package id="AtkSharp" version="3.22.24.29" targetFramework="net461" />
<package id="CairoSharp" version="3.22.24.29" targetFramework="net461" />
<package id="Eto.Forms" version="2.4.0" targetFramework="net461" />
<package id="Eto.Platform.Gtk" version="2.4.0" targetFramework="net461" />
<package id="Eto.Forms" version="2.4.1" targetFramework="net461" />
<package id="Eto.Platform.Gtk" version="2.4.1" targetFramework="net461" />
<package id="GdkSharp" version="3.22.24.29" targetFramework="net461" />
<package id="GioSharp" version="3.22.24.29" targetFramework="net461" />
<package id="GLibSharp" version="3.22.24.29" targetFramework="net461" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="FSharp.Core" Version="4.3.2" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.4.1" />
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ItemGroup>
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="FSharp.Core" Version="4.3.2" />
<PackageReference Include="Eto.Platform.Windows" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Windows" Version="2.4.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ItemGroup>
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="FSharp.Core" Version="4.3.2" />
<PackageReference Include="Eto.Platform.Wpf" Version="2.4.0" />
<PackageReference Include="Eto.Platform.Wpf" Version="2.4.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
<Reference Include="FSharp.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="Eto">
<HintPath>..\packages\Eto.Forms.2.4.0\lib\netstandard1.0\Eto.dll</HintPath>
<HintPath>..\packages\Eto.Forms.2.4.1\lib\netstandard1.0\Eto.dll</HintPath>
</Reference>
<Reference Include="Eto.XamMac2">
<HintPath>..\packages\Eto.Platform.XamMac2.2.4.0\lib\net45\Eto.XamMac2.dll</HintPath>
<HintPath>..\packages\Eto.Platform.XamMac2.2.4.1\lib\net45\Eto.XamMac2.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -91,6 +91,6 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.FSharp.targets" />
<Import Project="..\packages\Eto.Forms.2.4.0\build\Eto.Forms.targets" Condition="Exists('..\packages\Eto.Forms.2.4.0\build\Eto.Forms.targets')" />
<Import Project="..\packages\Eto.Platform.XamMac2.2.4.0\build\Eto.Platform.XamMac2.targets" Condition="Exists('..\packages\Eto.Platform.XamMac2.2.4.0\build\Eto.Platform.XamMac2.targets')" />
<Import Project="..\packages\Eto.Forms.2.4.1\build\Eto.Forms.targets" Condition="Exists('..\packages\Eto.Forms.2.4.1\build\Eto.Forms.targets')" />
<Import Project="..\packages\Eto.Platform.XamMac2.2.4.1\build\Eto.Platform.XamMac2.targets" Condition="Exists('..\packages\Eto.Platform.XamMac2.2.4.1\build\Eto.Platform.XamMac2.targets')" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Eto.Forms" version="2.4.0" targetFramework="net45" />
<package id="Eto.Platform.XamMac2" version="2.4.0" targetFramework="net45" />
<package id="Eto.Forms" version="2.4.1" targetFramework="net45" />
<package id="Eto.Platform.XamMac2" version="2.4.1" targetFramework="net45" />
<package id="System.ComponentModel" version="4.3.0" targetFramework="net45" />
<package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net45" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<ItemGroup>
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="FSharp.Core" Version="4.3.2" />
<PackageReference Include="Eto.Forms" Version="2.4.0" />
<PackageReference Include="Eto.Serialization.Json" Version="2.4.0" Condition="$(UseJeto) == 'True'" />
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.0" Condition="$(UseXeto) == 'True'" />
<PackageReference Include="Eto.Forms" Version="2.4.1" />
<PackageReference Include="Eto.Serialization.Json" Version="2.4.1" Condition="$(UseJeto) == 'True'" />
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.1" Condition="$(UseXeto) == 'True'" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/Eto.Gtk/Forms/Controls/SplitterHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ void Create()
void Control_Realized(object sender, EventArgs e)
{
HookEvents();

#if !GTK2
EnsurePosition();
#endif
}

void HookEvents()
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("2.4.0.0")]
[assembly: AssemblyInformationalVersion("2.4.0")]
[assembly: AssemblyInformationalVersion("2.4.1")]
12 changes: 11 additions & 1 deletion src/Shared/PlatformDetect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,19 @@ public static string GetUnixType()
}

#if GTK3
private static Assembly _etoassembly = typeof(Eto.Forms.Button).Assembly;

public static Assembly GetCallingAssembly()
{
return (new StackTrace()).GetFrame(4).GetMethod().DeclaringType.Assembly;
var s = new StackTrace();

for (int i = 0; i < s.FrameCount; i++)
{
if (_etoassembly.Equals(s.GetFrame(i).GetMethod().DeclaringType.Assembly))
return s.GetFrame(i + 1).GetMethod().DeclaringType.Assembly;
}

throw new Exception("Failed to get executing assembly.");
}
#endif
}
Expand Down

0 comments on commit 4d08b74

Please sign in to comment.