Create App MacOS

This commit is contained in:
Joseph Moreno
2021-10-11 19:34:26 -05:00
parent 225a954bb3
commit c127d73752
4 changed files with 24 additions and 2 deletions

1
.gitignore vendored
View File

@ -348,3 +348,4 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
.DS_Store

View File

@ -4,6 +4,7 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
<ApplicationIcon>app.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
@ -36,6 +37,7 @@
<PackageReference Include="Avalonia" Version="0.10.7" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.7" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.7" />
<PackageReference Include="Dotnet.Bundle" Version="*" Condition="$(RuntimeIdentifier.StartsWith('osx'))" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="7.0.0-*" />
</ItemGroup>
<ItemGroup>
@ -45,11 +47,29 @@
<ItemGroup>
<None Update="avalonia.png" CopyToPublishDirectory="PreserveNewest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
<None Update="dotnet.png" CopyToPublishDirectory="PreserveNewest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="app.icns" CopyToPublishDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('osx'))">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<PropertyGroup Condition="$(RuntimeIdentifier.StartsWith('osx'))" >
<CFBundleName>$(AssemblyName)</CFBundleName>
<CFBundleDisplayName>$(AssemblyName)</CFBundleDisplayName>
<CFBundleIdentifier>com.$(username).$(AssemblyName)</CFBundleIdentifier>
<CFBundleVersion>1.0.0</CFBundleVersion>
<CFBundlePackageType>APPL</CFBundlePackageType>
<!--<CFBundleSignature>????</CFBundleSignature>-->
<CFBundleExecutable>$(AssemblyName)</CFBundleExecutable>
<CFBundleIconFile>app.icns</CFBundleIconFile>
<NSPrincipalClass>NSApplication</NSPrincipalClass>
<NSHighResolutionCapable>true</NSHighResolutionCapable>
<CFBundleShortVersionString>1.0</CFBundleShortVersionString>
<!-- Optional -->
<NSRequiresAquaSystemAppearance>true</NSRequiresAquaSystemAppearance>
</PropertyGroup>
<Target Name="ConfigureTrimming" BeforeTargets="PrepareForILLink">
<ItemGroup>
<ManagedAssemblyToLink>

BIN
src/app.icns Normal file

Binary file not shown.

View File

@ -4,4 +4,5 @@ if [ -d "$dir" ]; then
cd "$dir"
fi
rm -f src/packages.lock.json
dotnet publish -r osx-x64 -c release /p:RestoreLockedMode=true
dotnet publish -r osx-x64 -c release /p:RestoreLockedMode=true -t:BundleApp
strip src/bin/Release/net*/osx-x64/publish/AvaloniaCoreRTDemo.app/Contents/MacOS/AvaloniaCoreRTDemo