Skip to content

Commit

Permalink
Fixed mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
EX3exp committed Oct 1, 2024
1 parent effbd62 commit ffe9d6c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
52 changes: 51 additions & 1 deletion Mirivoice.Desktop/Mirivoice.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<RootNamespace>Mirivoice.Desktop</RootNamespace>
<Company>EX3</Company>
</PropertyGroup>


<PropertyGroup>
<CFBundleName>MiriVoice</CFBundleName>
<CFBundleDisplayName>MiriVoice</CFBundleDisplayName>
Expand Down Expand Up @@ -49,9 +51,57 @@
<SignAssembly>False</SignAssembly>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Company>EX3</Company>
<Product>MiriVOice</Product>
<Product>MiriVoice</Product>
<Authors>EX3</Authors>
</PropertyGroup>

<Target Name="CreateMacAppBundle" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)' == 'osx-x64' Or '$(RuntimeIdentifier)' == 'osx-arm64'">
<Message Text="Building macOS .app bundle..." Importance="high" />

<MakeDir Directories="$(PublishDir)$(AssemblyName).app/Contents/MacOS" />
<MakeDir Directories="$(PublishDir)$(AssemblyName).app/Contents/Resources" />

<!-- Move the published executable to the .app bundle -->
<Move SourceFiles="$(PublishDir)$(AssemblyName)"
DestinationFiles="$(PublishDir)$(AssemblyName).app/Contents/MacOS/$(AssemblyName)" />

<!-- Create the Info.plist file -->
<WriteLinesToFile File="$(PublishDir)$(AssemblyName).app/Contents/Info.plist" Lines="
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>
<plist version='1.0'>
<dict>
<key>CFBundleName</key>
<string>$(CFBundleName)</string>
<key>CFBundleDisplayName</key>
<string>$(CFBundleDisplayName)</string>
<key>CFBundleIdentifier</key>
<string>$(CFBundleIdentifier)</string>
<key>CFBundleVersion</key>
<string>$(CFBundleVersion)</string>
<key>CFBundleShortVersionString</key>
<string>$(CFBundleShortVersionString)</string>
<key>CFBundlePackageType</key>
<string>$(CFBundlePackageType)</string>
<key>CFBundleSignature</key>
<string>$(CFBundleSignature)</string>
<key>CFBundleExecutable</key>
<string>$(CFBundleExecutable)</string>
<key>CFBundleIconFile</key>
<string>$(CFBundleIconFile)</string>
<key>NSPrincipalClass</key>
<string>$(NSPrincipalClass)</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
" />

<!-- Copy the icon file to the Resources folder -->
<Copy SourceFiles="Mirivoice/Assets/mirivoice.icns"
DestinationFolder="$(PublishDir)$(AssemblyName).app/Contents/Resources/" />
</Target>

<ItemGroup>
<Content Include="mirivoice-logo.ico" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ for:
- pwd
- dotnet restore Mirivoice.Desktop/Mirivoice.Desktop.csproj
- dotnet publish Mirivoice.Desktop/Mirivoice.Desktop.csproj -c Release -r osx-x64 --self-contained true
- npm install -g create-dmg
- create-dmg --volname "MiriVoice-osx-x64" --volicon "MiriVoice\Mirivoice\Assets\mirivoice.icns" --window-pos 200 120 --window-size 800 400 --icon-size 100 --icon "MiriVoice\Mirivoice\Assets\mirivoice.icns" 200 190 --hide-extension "MiriVoice.app" --app-drop-link 600 185 "MiriVoice-osx-x64.dmg" "MiriVoice.Desktop/bin/x64/Release/net8.0/osx-x64/publish/"
- codesign -fvs - MiriVoice-osx-x64.dmg
- codesign -fvs "Developer ID Application: EX3exp" Mirivoice.Desktop/bin/x64/Release/net8.0/osx-x64/publish/Mirivoice.app
- brew install create-dmg
- create-dmg MiriVoice-osx-x64.dmg Mirivoice.Desktop/bin/x64/Release/net8.0/osx-x64/publish/Mirivoice.app

-
matrix:
Expand Down

0 comments on commit ffe9d6c

Please sign in to comment.