Skip to content

Commit

Permalink
Add Fody to WPF
Browse files Browse the repository at this point in the history
  • Loading branch information
piersdeseilligny committed May 9, 2020
1 parent dfceea3 commit e3a733e
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 48 deletions.
Binary file modified .vs/ProResMetadata/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file modified .vs/ProResMetadata/v16/.suo
Binary file not shown.
3 changes: 2 additions & 1 deletion ProResMetadata/ProResMetadata.Gtk/ProResMetadata.Gtk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
</ItemGroup>

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

</Project>
Binary file not shown.
4 changes: 3 additions & 1 deletion ProResMetadata/ProResMetadata.Mac/ProResMetadata.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net461</TargetFramework>
<AssemblyName>ProRes.Editor</AssemblyName>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ProResMetadata\ProResMetadata.csproj" />
</ItemGroup>

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

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("ProResMetadata.Mac")]
[assembly: System.Reflection.AssemblyCompanyAttribute("ProRes.Editor")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("ProResMetadata.Mac")]
[assembly: System.Reflection.AssemblyTitleAttribute("ProResMetadata.Mac")]
[assembly: System.Reflection.AssemblyProductAttribute("ProRes.Editor")]
[assembly: System.Reflection.AssemblyTitleAttribute("ProRes.Editor")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
851819d6eed0427bcf32bb32ef57c4cb313d1ff6
cc58341551c21f3f0698b5ee8c723f672e9f314b
Binary file not shown.
2 changes: 1 addition & 1 deletion ProResMetadata/ProResMetadata.Mac/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4301,7 +4301,7 @@
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\piers\\source\\repos\\ProResMetadata\\ProResMetadata\\ProResMetadata.Mac\\ProResMetadata.Mac.csproj",
"projectName": "ProResMetadata.Mac",
"projectName": "ProRes.Editor",
"projectPath": "C:\\Users\\piers\\source\\repos\\ProResMetadata\\ProResMetadata\\ProResMetadata.Mac\\ProResMetadata.Mac.csproj",
"packagesPath": "C:\\Users\\piers\\.nuget\\packages\\",
"outputPath": "C:\\Users\\piers\\source\\repos\\ProResMetadata\\ProResMetadata\\ProResMetadata.Mac\\obj\\",
Expand Down
3 changes: 3 additions & 0 deletions ProResMetadata/ProResMetadata.Wpf/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura />
</Weavers>
111 changes: 111 additions & 0 deletions ProResMetadata/ProResMetadata.Wpf/FodyWeavers.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http:https://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCleanup" type="xs:boolean">
<xs:annotation>
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
45 changes: 27 additions & 18 deletions ProResMetadata/ProResMetadata.Wpf/ProResMetadata.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
<FileAlignment>512</FileAlignment>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>true</IsWebBootstrapper>
<PublishUrl>C:\Users\piers\Desktop\publish\</PublishUrl>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Users\piers\source\repos\ProResMetadata\Releases\</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<InstallUrl>https://github.com/piersdeseilligny/</InstallUrl>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<ApplicationRevision>0</ApplicationRevision>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand All @@ -53,6 +53,18 @@
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>50E556BA62BF6BD14972428E663E180B4EB1A8E8</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>ProResMetadata.Wpf_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
Expand All @@ -74,13 +86,17 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="ProResMetadata.Wpf_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Eto.Platform.Wpf">
<Version>2.4.1</Version>
<PackageReference Include="Costura.Fody">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="PresentationTheme.Aero">
<Version>0.5.0</Version>
<PackageReference Include="Eto.Forms">
<Version>2.5.0</Version>
</PackageReference>
<PackageReference Include="Eto.Platform.Wpf">
<Version>2.5.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand All @@ -105,11 +121,4 @@
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterResolveReferences">
<ItemGroup>
<EmbeddedResource Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Extension)' == '.dll'">
<LogicalName>%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup>
</Project>
19 changes: 0 additions & 19 deletions ProResMetadata/ProResMetadata.Wpf/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,8 @@ class MainClass
[STAThread]
public static void Main(string[] args)
{
AppDomain.CurrentDomain.AssemblyResolve += OnResolveAssembly;
new Eto.Forms.Application(Eto.Platforms.Wpf).Run(new MainForm(args, '\\'));

}

private static Assembly OnResolveAssembly(object sender, ResolveEventArgs args)
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
AssemblyName assemblyName = new AssemblyName(args.Name);

var path = assemblyName.Name + ".dll";
if (assemblyName.CultureInfo.Equals(CultureInfo.InvariantCulture) == false) path = String.Format(@"{0}\{1}", assemblyName.CultureInfo, path);

using (Stream stream = executingAssembly.GetManifestResourceStream(path))
{
if (stream == null) return null;

var assemblyRawBytes = new byte[stream.Length];
stream.Read(assemblyRawBytes, 0, assemblyRawBytes.Length);
return Assembly.Load(assemblyRawBytes);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Eto.Forms">
<Version>2.5.0</Version>
</PackageReference>
<PackageReference Include="Eto.Platform.XamMac2">
<Version>2.4.1</Version>
<Version>2.5.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions ProResMetadata/ProResMetadata/ProResMetadata.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Eto.Forms" Version="2.4.1" />
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.1" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Eto.Forms" Version="2.5.0" />
<PackageReference Include="Eto.Serialization.Xaml" Version="2.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit e3a733e

Please sign in to comment.