Skip to content

Commit 8be7c9a

Browse files
committed
Add sample console app with cross-plat building (host sys = mac)
1 parent b1bc639 commit 8be7c9a

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
appcast-output/*
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
outputDir="appcast-output"
3+
rm -rf "${outputDir}" # remove any old files
4+
mkdir -p $outputDir
5+
for config in "osx-arm64" "osx-x64" "win-arm64" "win-x64" "linux-x64"; do
6+
if [[ "$config" == osx* ]]; then
7+
ext=""
8+
if [[ "$config" == "osx-arm64" ]]; then
9+
os="macos-arm64"
10+
version=2.0 # since app cast gen doesn't like items with same version right now
11+
else
12+
os="macos-x64"
13+
version=2.1
14+
fi
15+
aot="true"
16+
singlefile="false"
17+
elif [[ "$config" == win* ]]; then
18+
ext=".exe"
19+
if [[ "$config" == "win-arm64" ]]; then
20+
os="windows-arm64"
21+
version=2.2
22+
else
23+
os="windows-x64"
24+
version=2.3
25+
fi
26+
aot="false"
27+
singlefile="true"
28+
else
29+
ext=""
30+
version=2.4
31+
os="linux-x64"
32+
aot="false"
33+
singlefile="true"
34+
fi
35+
filename="${outputDir}/${config}/SimpleNetSparkleConsoleApp${ext}"
36+
filenameNxt="${outputDir}/${config}/SimpleNetSparkleConsoleApp_${os}${ext}"
37+
dotnet publish -c Release --self-contained -r "${config}" -o "${outputDir}/${config}" "-p:PublishAot=${aot}" "-p:PublishSingleFile=${singlefile}"
38+
mv "${filename}" "${filenameNxt}"
39+
netsparkle-generate-appcast -n "Sparkle Console App" --os "${os}" --appcast-output-directory "${outputDir}" --single-file "${filenameNxt}" --reparse-existing --file-version "${version}" -u "https://netsparkleupdater.github.io/NetSparkle/files/console-sample-app"
40+
mv "${filenameNxt}" "${outputDir}/SimpleNetSparkleConsoleApp_${os}${ext}"
41+
done
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<IsTrimmable>true</IsTrimmable>
9+
<PublishTrimmed>true</PublishTrimmed>
10+
<!-- <PublishSingleFile>true</PublishSingleFile> -->
11+
<TrimMode>full</TrimMode>
12+
<IsAotCompatible>true</IsAotCompatible>
13+
<Nullable>enable</Nullable>
14+
<!-- <PublishAot>true</PublishAot> -->
15+
<IlcOptimizationPreference>Size</IlcOptimizationPreference>
16+
<IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
17+
<IlcTrimMetadata>true</IlcTrimMetadata>
18+
<IlcDisableReflection>true</IlcDisableReflection>
19+
<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
20+
21+
<Version>1.0</Version>
22+
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
23+
<AssemblyTitle>My Simple Console App - NetSparkle</AssemblyTitle>
24+
<AssemblyName>SimpleNetSparkleConsoleApp</AssemblyName>
25+
<Copyright>NetSparkleUpdater</Copyright>
26+
<Company>NetSparkleUpdater</Company>
27+
<Product>NetSparkleUpdater</Product>
28+
</PropertyGroup>
29+
<PropertyGroup Condition="'$(Configuration)'=='Release'">
30+
<DebugSymbols>False</DebugSymbols>
31+
<DebugType>None</DebugType>
32+
</PropertyGroup>
33+
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Console.WriteLine("");
2+
Console.WriteLine("");
3+
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
4+
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
5+
Console.WriteLine("~~~~~~~~~~~~~~~~~ NetSparkle ~~~~~~~~~~~~~~~~~~~~~~~");
6+
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
7+
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
8+
Console.WriteLine("Hello, World! This is the app downloaded by NetSparkle — usually the downloaded file would be your installer or DMG or other app you need for your updates~");
9+
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
10+
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
11+
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
12+
Console.WriteLine("");
13+
Console.WriteLine("");

0 commit comments

Comments
 (0)