Skip to content

Commit

Permalink
Remove dotnet bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
EX3exp committed Oct 3, 2024
1 parent 05c6ff1 commit 2b64c96
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 10 deletions.
1 change: 0 additions & 1 deletion Mirivoice.Desktop/Mirivoice.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.1.3" />
<PackageReference Include="Dotnet.Bundle" Version="0.9.13" />
<PackageReference Include="Serilog" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
Expand Down
47 changes: 38 additions & 9 deletions Mirivoice.Desktop/appveyor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,38 @@ def write_appcast(appcast_os, appcast_rid, appcast_file):
with open("appcast.%s.xml" % (appcast_rid), 'w') as f:
f.write(xml)

def write_info_plist():
plist = '''<?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>MiriVoice</string>
<key>CFBundleDisplayName</key>
<string>MiriVoice</string>
<key>CFBundleIdentifier</key>
<string>com.ex3.mirivoice</string>
<key>CFBundleVersion</key>
<string>@@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>MiriVoice</string>
<key>CFBundleIconFile</key>
<string>mirivoice.icns</string>
<key>CFBundleShortVersionString</key>
<string>@@</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<true />
</dict>
</plist>'''.replace('@@', appcast_ver)

with open("Mirivoice.Desktop/osxbuild/MiriVoice.app/Contents/Info.plist", 'w') as f:
f.write(plist)

if sys.platform == 'win32':
if appcast_ver is not None:
Expand All @@ -53,20 +85,17 @@ def write_appcast(appcast_os, appcast_rid, appcast_file):
os.system("rm *.xml")

os.system("git checkout Mirivoice.Desktop/Mirivoice.Desktop.csproj")
os.system("rm LICENSE.txt")
os.system(
"sed -i '' \"s/0.0.0/%s/g\" Mirivoice.Desktop/Mirivoice.Desktop.csproj" % (appcast_ver))
write_info_plist()
os.system("dotnet restore Mirivoice.Desktop/Mirivoice.Desktop.csproj -r osx-x64")
os.system("dotnet msbuild Mirivoice.Desktop/Mirivoice.Desktop.csproj -t:BundleApp -p:Configuration=Release -p:RuntimeIdentifier=osx-x64 -p:UseAppHost=true -p:OutputPath=../Mirivoice.Desktop/bin/osx-x64/ -p:AssemblyVersion=%s" % (appcast_ver))
os.system(
"cp Mirivoice.Desktop/mirivoice.icns Mirivoice.Desktop/bin/osx-x64/publish/MiriVoice.app/Contents/Resources/")
os.system("rm *.dmg")
os.system("dotnet publish Mirivoice.Desktop/Mirivoice.Desktop.csproj -c Release -r osx-x64 --self-contained true -o Mirivoice.Desktop/bin/osx-x64 -p:UseAppHost=true -p:AssemblyVersion=%s" % (appcast_ver) )
os.system("cp -a Mirivoice.Desktop/bin/osx-x64/publish/ Mirivoice.Desktop/osxbuild/MiriVoice.app/Contents/MacOS")
os.system("chmod +x Mirivoice.Desktop/osxbuild/MiriVoice.app/Contents/MacOS/MiriVoice")
os.system("npm install -g create-dmg")
os.system("create-dmg Mirivoice.Desktop/bin/osx-x64/publish/MiriVoice.app")
os.system("create-dmg Mirivoice.Desktop/osxbuild/MiriVoice.app")
os.system("mv *.dmg MiriVoice-osx-x64.dmg")
os.system("codesign -fvs - MiriVoice-osx-x64.dmg")
os.system("git checkout Mirivoice.Desktop.csproj")
os.system("git checkout LICENSE.txt")
os.system("git checkout Mirivoice.Desktop/Mirivoice.Desktop.csproj")

write_appcast("macos", "osx-x64", "MiriVoice-osx-x64.dmg")

Expand Down
28 changes: 28 additions & 0 deletions Mirivoice.Desktop/osxbuild/MiriVoice.app/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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>MiriVoice</string>
<key>CFBundleDisplayName</key>
<string>MiriVoice</string>
<key>CFBundleIdentifier</key>
<string>com.ex3.mirivoice</string>
<key>CFBundleVersion</key>
<string>0.0.0.6</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>MiriVoice</string>
<key>CFBundleIconFile</key>
<string>mirivoice.icns</string>
<key>CFBundleShortVersionString</key>
<string>0.0.0.6</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<true />
</dict>
</plist>
Binary file not shown.

0 comments on commit 2b64c96

Please sign in to comment.