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 (cross platform F# VS Code tools) working folder
.ionide/ .ionide/
.DS_Store

View File

@ -4,6 +4,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<ApplicationIcon>app.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
@ -36,6 +37,7 @@
<PackageReference Include="Avalonia" Version="0.10.7" /> <PackageReference Include="Avalonia" Version="0.10.7" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.7" /> <PackageReference Include="Avalonia.Desktop" Version="0.10.7" />
<PackageReference Include="Avalonia.ReactiveUI" 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-*" /> <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="7.0.0-*" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -49,7 +51,25 @@
<None Update="dotnet.png" CopyToPublishDirectory="PreserveNewest"> <None Update="dotnet.png" CopyToPublishDirectory="PreserveNewest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="app.icns" CopyToPublishDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('osx'))">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </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"> <Target Name="ConfigureTrimming" BeforeTargets="PrepareForILLink">
<ItemGroup> <ItemGroup>
<ManagedAssemblyToLink> <ManagedAssemblyToLink>

BIN
src/app.icns Normal file

Binary file not shown.

View File

@ -4,4 +4,5 @@ if [ -d "$dir" ]; then
cd "$dir" cd "$dir"
fi fi
rm -f src/packages.lock.json 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