Skip to content

Commit 292ad16

Browse files
single binary publish
1 parent f9e272e commit 292ad16

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,12 @@ MacUtilGUI/bin/
321321
MacUtilGUI/obj/
322322
MacUtilGUI/dist/
323323
MacUtilGUI/publish/
324+
325+
# macOS specific files
326+
.DS_Store
327+
.DS_Store?
328+
._*
329+
.Spotlight-V100
330+
.Trashes
331+
ehthumbs.db
332+
Thumbs.db

MacUtilGUI/MacUtilGUI.fsproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
88
<ApplicationManifest>app.manifest</ApplicationManifest>
99
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
10+
11+
<!-- Self-contained single file configuration -->
12+
<PublishSingleFile>true</PublishSingleFile>
13+
<SelfContained>true</SelfContained>
14+
<PublishTrimmed>true</PublishTrimmed>
15+
<TrimMode>link</TrimMode>
16+
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
17+
<PublishReadyToRun>true</PublishReadyToRun>
18+
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
19+
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
20+
<DebugType>embedded</DebugType>
1021
</PropertyGroup>
1122

1223
<ItemGroup>
@@ -30,6 +41,13 @@
3041
<PackageReference Include="Tomlyn" Version="0.17.0" />
3142
</ItemGroup>
3243

44+
<!-- Trim-friendly settings for Avalonia -->
45+
<ItemGroup>
46+
<TrimmerRootAssembly Include="Avalonia" />
47+
<TrimmerRootAssembly Include="Avalonia.Desktop" />
48+
<TrimmerRootAssembly Include="Avalonia.Themes.Fluent" />
49+
</ItemGroup>
50+
3351
<ItemGroup>
3452
<AvaloniaResource Include="Assets\**" />
3553
</ItemGroup>

MacUtilGUI/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mkdir -p ./bin/Release/net9.0/publish/
1818

1919
# Publish for Intel x64 Macs
2020
echo "🔨 Building for Intel x64 Macs..."
21-
dotnet publish -c Release -r osx-x64 --self-contained true -p:PublishSingleFile=true -o ./bin/Release/net9.0/publish/osx-x64/
21+
dotnet publish -c Release -r osx-x64 -o ./bin/Release/net9.0/publish/osx-x64/
2222
if [ $? -eq 0 ]; then
2323
echo "✅ Intel x64 build successful"
2424
else
@@ -29,7 +29,7 @@ echo
2929

3030
# Publish for Apple Silicon ARM64 Macs
3131
echo "🔨 Building for Apple Silicon ARM64 Macs..."
32-
dotnet publish -c Release -r osx-arm64 --self-contained true -p:PublishSingleFile=true -o ./bin/Release/net9.0/publish/osx-arm64/
32+
dotnet publish -c Release -r osx-arm64 -o ./bin/Release/net9.0/publish/osx-arm64/
3333
if [ $? -eq 0 ]; then
3434
echo "✅ Apple Silicon ARM64 build successful"
3535
else

0 commit comments

Comments
 (0)