Release StaticLink.Avalonia 3.119.4-7922.1
This commit is contained in:
1 parent
12588d44ed
commit
ef96db63b8
16 files changed
+223
-163
No files matched your search
@@ -6,7 +6,7 @@ on:
|
||||
source_version:
|
||||
description: Existing package version containing the static libraries
|
||||
required: true
|
||||
default: 3.119.2-7151.11
|
||||
default: 3.119.4-7922.1
|
||||
type: string
|
||||
publish_to_nuget:
|
||||
description: Publish package to nuget.org
|
||||
|
||||
@@ -18,8 +18,8 @@ on:
|
||||
- "staticlink-avalonia-v*"
|
||||
|
||||
env:
|
||||
SKIASHARP_VERSION: "3.119.2"
|
||||
ANGLE_BRANCH: "7151"
|
||||
SKIASHARP_VERSION: "3.119.4"
|
||||
ANGLE_BRANCH: "7922"
|
||||
DOTNET_ALPINE_IMAGE: mcr.microsoft.com/dotnet/sdk:10.0-alpine
|
||||
|
||||
jobs:
|
||||
@@ -339,7 +339,7 @@ jobs:
|
||||
if: ${{ startsWith(matrix.rid, 'linux-') && !startsWith(matrix.rid, 'linux-musl-') }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang lld zlib1g-dev libfontconfig1-dev
|
||||
sudo apt-get install -y clang lld xvfb zlib1g-dev libfontconfig1-dev libfreetype6 libgl1 libice6 libsm6 libx11-6 libxcb1 libxcursor1 libxext6 libxfixes3 libxinerama1 libxrandr2 libxrender1 libxi6
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
@@ -405,6 +405,40 @@ jobs:
|
||||
}
|
||||
Get-ChildItem -Path $publishDir -Recurse -File | ForEach-Object { $_.FullName }
|
||||
|
||||
- name: Run Windows Avalonia smoke app
|
||||
if: ${{ startsWith(matrix.rid, 'win-') }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
$publishDir = Join-Path $PWD "artifacts/smoke-${{ matrix.rid }}"
|
||||
$app = Join-Path $publishDir "AvaloniaStaticLinkSmoke.exe"
|
||||
$process = Start-Process -FilePath $app -WorkingDirectory $publishDir -PassThru
|
||||
if ($process.WaitForExit(15000)) {
|
||||
if ($process.ExitCode -eq 0) {
|
||||
Write-Host "Avalonia Windows smoke app exited normally."
|
||||
exit 0
|
||||
}
|
||||
throw "Avalonia Windows smoke app failed with exit code $($process.ExitCode)."
|
||||
}
|
||||
|
||||
Stop-Process -Id $process.Id -Force
|
||||
Write-Host "Avalonia Windows smoke app stayed alive for 15 seconds."
|
||||
|
||||
- name: Run Linux Avalonia smoke app
|
||||
if: ${{ startsWith(matrix.rid, 'linux-') && !startsWith(matrix.rid, 'linux-musl-') }}
|
||||
shell: bash
|
||||
run: |
|
||||
set +e
|
||||
cd "artifacts/smoke-${{ matrix.rid }}"
|
||||
chmod +x ./AvaloniaStaticLinkSmoke
|
||||
timeout 15s xvfb-run -a ./AvaloniaStaticLinkSmoke
|
||||
code=$?
|
||||
if [ "$code" = 124 ] || [ "$code" = 143 ]; then
|
||||
echo "Avalonia Linux smoke app stayed alive for 15 seconds."
|
||||
exit 0
|
||||
fi
|
||||
exit "$code"
|
||||
|
||||
- name: Verify musl ELF dependencies
|
||||
if: ${{ startsWith(matrix.rid, 'linux-musl-') }}
|
||||
shell: bash
|
||||
|
||||
+16
-18
@@ -1,9 +1,9 @@
|
||||
diff --git a/DEPS b/DEPS
|
||||
index 9085ba513e..565840a832 100644
|
||||
index 8ba99a6..1a5e1a5 100644
|
||||
--- a/DEPS
|
||||
+++ b/DEPS
|
||||
@@ -696,11 +696,6 @@ deps = {
|
||||
'dep_type': 'cipd',
|
||||
@@ -767,11 +767,6 @@ deps = {
|
||||
'condition': 'not build_with_chromium',
|
||||
},
|
||||
|
||||
- 'third_party/catapult': {
|
||||
@@ -14,44 +14,42 @@ index 9085ba513e..565840a832 100644
|
||||
# Cherry is a dEQP/VK-GL-CTS management GUI written in Go. We use it for viewing test results.
|
||||
'third_party/cherry': {
|
||||
'url': Var('android_git') + '/platform/external/cherry@4f8fb08d33ca5ff05a1c638f04c85bbb8d8b52cc',
|
||||
@@ -722,12 +717,6 @@ deps = {
|
||||
'condition': 'checkout_android and not build_with_chromium',
|
||||
@@ -794,10 +789,5 @@ deps = {
|
||||
},
|
||||
|
||||
-
|
||||
- 'third_party/dawn': {
|
||||
- 'url': Var('dawn_git') + '/dawn.git' + '@' + Var('dawn_revision'),
|
||||
- 'condition': 'not build_with_chromium'
|
||||
- 'condition': 'checkout_angle_dawn_deps and not build_with_chromium'
|
||||
- },
|
||||
-
|
||||
'third_party/depot_tools': {
|
||||
'url': Var('chromium_git') + '/chromium/tools/depot_tools.git@1fcc527019d786502b02f71b8b764ee674a40953',
|
||||
'url': Var('chromium_git') + '/chromium/tools/depot_tools.git@94e89b10b92cc9d6e58fc8d1b6474b7d29e8a114',
|
||||
'condition': 'not build_with_chromium',
|
||||
@@ -809,11 +798,6 @@ deps = {
|
||||
@@ -874,11 +864,6 @@ deps = {
|
||||
'condition': 'not build_with_chromium',
|
||||
},
|
||||
|
||||
- 'third_party/llvm/src': {
|
||||
- 'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project@1fd8d3fea53e6e4573cdce55bd38ef0a7813a442',
|
||||
- 'condition': 'not build_with_chromium',
|
||||
- 'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project@67790d3fb06b184b7be9c4d3e36ab01f0ac4198e',
|
||||
- 'condition': 'checkout_angle_cl_deps and not build_with_chromium',
|
||||
- },
|
||||
-
|
||||
'third_party/jdk': {
|
||||
'packages': [
|
||||
{
|
||||
@@ -1000,11 +984,6 @@ deps = {
|
||||
'third_party/llvm-build/Release+Asserts': {
|
||||
'dep_type': 'gcs',
|
||||
'bucket': 'chromium-browser-clang',
|
||||
@@ -1216,11 +1201,6 @@ deps = {
|
||||
'condition': 'checkout_android and not build_with_chromium',
|
||||
},
|
||||
|
||||
- 'third_party/SwiftShader': {
|
||||
- 'url': Var('swiftshader_git') + '/SwiftShader@7905fa19e456df5aa8e2233a7ec5832c9c6c287b',
|
||||
- 'url': Var('swiftshader_git') + '/SwiftShader@f3e464b1e56795940f826a972b39e19bd9f6ac6c',
|
||||
- 'condition': 'not build_with_chromium',
|
||||
- },
|
||||
-
|
||||
'third_party/turbine/cipd': {
|
||||
'packages': [
|
||||
{
|
||||
@@ -1016,10 +995,6 @@ deps = {
|
||||
@@ -1232,10 +1212,6 @@ deps = {
|
||||
'dep_type': 'cipd',
|
||||
},
|
||||
|
||||
@@ -60,5 +58,5 @@ index 9085ba513e..565840a832 100644
|
||||
- },
|
||||
-
|
||||
'third_party/vulkan-deps': {
|
||||
'url': Var('chromium_git') + '/vulkan-deps@b9aab6c35f37e6532011ddab976c3ca71819c074',
|
||||
'url': Var('chromium_git') + '/vulkan-deps@f2b9fece7c6772c09379b3a6938dbcd2573f2a3e',
|
||||
'condition': 'not build_with_chromium',
|
||||
@@ -11,7 +11,7 @@ dotnet add package StaticLink.Avalonia
|
||||
Or add it manually:
|
||||
|
||||
```xml
|
||||
<PackageReference Include="StaticLink.Avalonia" Version="3.119.2-7151.12" />
|
||||
<PackageReference Include="StaticLink.Avalonia" Version="3.119.4-7922.1" />
|
||||
```
|
||||
|
||||
For macOS, also reference `StaticLink.Avalonia.Native`. This package is macOS-only and must match your Avalonia version because it contains `libAvaloniaNative.a`.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||
<SuppressDependenciesWhenPacking>false</SuppressDependenciesWhenPacking>
|
||||
<PackageId>StaticLink.Avalonia</PackageId>
|
||||
<Version>3.119.2-7151.12</Version>
|
||||
<Version>3.119.4-7922.1</Version>
|
||||
<Authors>greepar</Authors>
|
||||
<Company>greepar</Company>
|
||||
<Description>Static SkiaSharp, HarfBuzzSharp, and ANGLE libraries for Avalonia NativeAOT single-file publishing.</Description>
|
||||
@@ -19,7 +19,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SkiaSharp" Version="3.119.2" />
|
||||
<PackageReference Include="SkiaSharp" Version="3.119.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -11,10 +11,10 @@ dotnet add package StaticLink.Avalonia
|
||||
Or add it manually:
|
||||
|
||||
```xml
|
||||
<PackageReference Include="StaticLink.Avalonia" Version="3.119.2-7151.12" />
|
||||
<PackageReference Include="StaticLink.Avalonia" Version="3.119.4-7922.1" />
|
||||
```
|
||||
|
||||
`3.119.2-7151.12` supports Avalonia 11. If you need the SkiaSharp 2 line for an Avalonia 11 project, use this optional package variant:
|
||||
`3.119.4-7922.1` supports Avalonia 11. If you need the SkiaSharp 2 line for an Avalonia 11 project, use this optional package variant:
|
||||
|
||||
```xml
|
||||
<PackageReference Include="StaticLink.Avalonia" Version="2.88.9-7151.10" />
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<Application xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="AvaloniaStaticLinkSmoke.App">
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
@@ -0,0 +1,23 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace AvaloniaStaticLinkSmoke;
|
||||
|
||||
public sealed partial class App : Application
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
desktop.MainWindow = new MainWindow();
|
||||
}
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="SmokeVersions.props" Condition="Exists('SmokeVersions.props')" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<PublishAot>true</PublishAot>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<AvaloniaVersion Condition="'$(AvaloniaVersion)' == ''">11.3.14</AvaloniaVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="StaticLink.Avalonia" Version="$(StaticLinkVersion)" Condition="'$(StaticLinkVersion)' != ''" />
|
||||
<PackageReference Include="StaticLink.Avalonia.Native" Version="$(StaticLinkNativeVersion)" Condition="'$(StaticLinkNativeVersion)' != ''" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,13 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="AvaloniaStaticLinkSmoke.MainWindow"
|
||||
Width="420"
|
||||
Height="220"
|
||||
Title="Avalonia StaticLink Smoke">
|
||||
<Border Padding="24">
|
||||
<StackPanel Spacing="8" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Text="Avalonia static link smoke" FontSize="24" FontWeight="SemiBold" HorizontalAlignment="Center" />
|
||||
<TextBlock Text="NativeAOT single-file publish" HorizontalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Window>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AvaloniaStaticLinkSmoke;
|
||||
|
||||
public sealed partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using Avalonia;
|
||||
|
||||
namespace AvaloniaStaticLinkSmoke;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
[STAThread]
|
||||
public static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
{
|
||||
var builder = AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.LogToTrace();
|
||||
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
builder = builder.With(new Win32PlatformOptions
|
||||
{
|
||||
RenderingMode =
|
||||
[
|
||||
Win32RenderingMode.AngleEgl,
|
||||
Win32RenderingMode.Software
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
if (OperatingSystem.IsLinux())
|
||||
{
|
||||
builder = builder.With(new X11PlatformOptions
|
||||
{
|
||||
RenderingMode =
|
||||
[
|
||||
X11RenderingMode.Glx,
|
||||
X11RenderingMode.Software
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
builder = builder.With(new AvaloniaNativePlatformOptions
|
||||
{
|
||||
RenderingMode =
|
||||
[
|
||||
AvaloniaNativeRenderingMode.OpenGl,
|
||||
AvaloniaNativeRenderingMode.Software
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@ WORK_DIR="${WORK_DIR:-$ROOT_DIR/External/NativeStatic/.work}"
|
||||
TARGET_CPU="${TARGET_CPU:-x64}"
|
||||
RID="${RID:-linux-$TARGET_CPU}"
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-$ROOT_DIR/External/NativeStatic/$RID}"
|
||||
SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.2}"
|
||||
ANGLE_BRANCH="${ANGLE_BRANCH:-7151}"
|
||||
SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.4}"
|
||||
ANGLE_BRANCH="${ANGLE_BRANCH:-7922}"
|
||||
BUILD_JOBS="${BUILD_JOBS:-$(nproc)}"
|
||||
ANGLE_PATCH_DIR="${ANGLE_PATCH_DIR:-$ROOT_DIR/External/NativeStatic/patches}"
|
||||
LLVM_AR="${LLVM_AR:-llvm-ar-19}"
|
||||
@@ -20,8 +20,8 @@ Usage: scripts/build-linux-static-graphics.sh [skia|angle|all]
|
||||
Environment:
|
||||
WORK_DIR Source/build cache directory. Default: External/NativeStatic/.work
|
||||
OUTPUT_DIR Final static library directory. Default: External/NativeStatic/linux-$TARGET_CPU
|
||||
SKIASHARP_VERSION SkiaSharp release branch version. Default: 3.119.2
|
||||
ANGLE_BRANCH ANGLE chromium branch. Default: 7151
|
||||
SKIASHARP_VERSION SkiaSharp release branch version. Default: 3.119.4
|
||||
ANGLE_BRANCH ANGLE chromium branch. Default: 7922
|
||||
TARGET_CPU GN target_cpu. Default: x64. Supported: x64, arm64
|
||||
RID Output RID. Default: linux-$TARGET_CPU
|
||||
BUILD_JOBS Ninja parallelism. Default: nproc
|
||||
|
||||
@@ -6,8 +6,8 @@ WORK_DIR="${WORK_DIR:-$ROOT_DIR/External/NativeStatic/.work}"
|
||||
TARGET_CPU="${TARGET_CPU:-arm64}"
|
||||
RID="${RID:-osx-$TARGET_CPU}"
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-$ROOT_DIR/External/NativeStatic/$RID}"
|
||||
SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.2}"
|
||||
ANGLE_BRANCH="${ANGLE_BRANCH:-7151}"
|
||||
SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.4}"
|
||||
ANGLE_BRANCH="${ANGLE_BRANCH:-7922}"
|
||||
BUILD_JOBS="${BUILD_JOBS:-$(sysctl -n hw.ncpu)}"
|
||||
ANGLE_PATCH_DIR="${ANGLE_PATCH_DIR:-$ROOT_DIR/External/NativeStatic/patches}"
|
||||
SKIA_DEPS_RETRIES="${SKIA_DEPS_RETRIES:-3}"
|
||||
@@ -112,10 +112,12 @@ build_skia() {
|
||||
cat >"$out_dir/args.gn" <<EOF_ARGS
|
||||
target_os = "mac"
|
||||
target_cpu = "$TARGET_CPU"
|
||||
min_macos_version = "10.13"
|
||||
is_official_build = true
|
||||
is_static_skiasharp = true
|
||||
skia_enable_tools = false
|
||||
skia_enable_ganesh = true
|
||||
skia_use_metal = true
|
||||
skia_enable_pdf = false
|
||||
skia_enable_skottie = false
|
||||
skia_use_dng_sdk = false
|
||||
|
||||
@@ -7,8 +7,8 @@ $ErrorActionPreference = "Stop"
|
||||
|
||||
$RootDir = Split-Path -Parent $PSScriptRoot
|
||||
$WorkDir = if ($env:WORK_DIR) { $env:WORK_DIR } else { Join-Path $RootDir "External\NativeStatic\.work" }
|
||||
$SkiaSharpVersion = if ($env:SKIASHARP_VERSION) { $env:SKIASHARP_VERSION } else { "3.119.2" }
|
||||
$AngleBranch = if ($env:ANGLE_BRANCH) { $env:ANGLE_BRANCH } else { "7151" }
|
||||
$SkiaSharpVersion = if ($env:SKIASHARP_VERSION) { $env:SKIASHARP_VERSION } else { "3.119.4" }
|
||||
$AngleBranch = if ($env:ANGLE_BRANCH) { $env:ANGLE_BRANCH } else { "7922" }
|
||||
$TargetCpu = if ($env:TARGET_CPU) { $env:TARGET_CPU } else { "x64" }
|
||||
$Rid = if ($env:RID) { $env:RID } else { "win-$TargetCpu" }
|
||||
$OutputDir = if ($env:OUTPUT_DIR) { $env:OUTPUT_DIR } else { Join-Path $RootDir "External\NativeStatic\$Rid" }
|
||||
|
||||
@@ -14,144 +14,36 @@ param(
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$templateDir = Join-Path (Split-Path -Parent $PSScriptRoot) "Smoke/AvaloniaStaticLinkSmoke"
|
||||
if (-not (Test-Path (Join-Path $templateDir "AvaloniaStaticLinkSmoke.csproj"))) {
|
||||
throw "Smoke project template was not found: $templateDir"
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Path $ProjectDir -Force | Out-Null
|
||||
Copy-Item (Join-Path $templateDir "*") -Destination $ProjectDir -Recurse -Force
|
||||
|
||||
$nativeReference = ""
|
||||
if ($StaticLinkNativeVersion) {
|
||||
$nativeReference = "`n <PackageReference Include=`"StaticLink.Avalonia.Native`" Version=`"$StaticLinkNativeVersion`" />"
|
||||
}
|
||||
$escapedNuGetSource = [System.Security.SecurityElement]::Escape($NuGetSource)
|
||||
$escapedAvaloniaVersion = [System.Security.SecurityElement]::Escape($AvaloniaVersion)
|
||||
$escapedStaticLinkVersion = [System.Security.SecurityElement]::Escape($StaticLinkVersion)
|
||||
$escapedStaticLinkNativeVersion = [System.Security.SecurityElement]::Escape($StaticLinkNativeVersion)
|
||||
|
||||
$staticLinkReference = ""
|
||||
if ($StaticLinkVersion) {
|
||||
$staticLinkReference = "`n <PackageReference Include=`"StaticLink.Avalonia`" Version=`"$StaticLinkVersion`" />"
|
||||
}
|
||||
@"
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AvaloniaVersion>$escapedAvaloniaVersion</AvaloniaVersion>
|
||||
<StaticLinkVersion>$escapedStaticLinkVersion</StaticLinkVersion>
|
||||
<StaticLinkNativeVersion>$escapedStaticLinkNativeVersion</StaticLinkNativeVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
"@ | Set-Content -Path (Join-Path $ProjectDir "SmokeVersions.props") -Encoding UTF8
|
||||
|
||||
@"
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="local-staticlink" value="$NuGetSource" />
|
||||
<add key="local-staticlink" value="$escapedNuGetSource" />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
"@ | Set-Content -Path (Join-Path $ProjectDir "NuGet.config") -Encoding UTF8
|
||||
|
||||
@"
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<PublishAot>true</PublishAot>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="$AvaloniaVersion" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$AvaloniaVersion" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$AvaloniaVersion" />$staticLinkReference$nativeReference
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
"@ | Set-Content -Path (Join-Path $ProjectDir "AvaloniaStaticLinkSmoke.csproj") -Encoding UTF8
|
||||
|
||||
@"
|
||||
using Avalonia;
|
||||
|
||||
namespace AvaloniaStaticLinkSmoke;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
[STAThread]
|
||||
public static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
{
|
||||
var builder = AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.LogToTrace();
|
||||
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
builder = builder.With(new AvaloniaNativePlatformOptions
|
||||
{
|
||||
RenderingMode = [AvaloniaNativeRenderingMode.Software]
|
||||
});
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
"@ | Set-Content -Path (Join-Path $ProjectDir "Program.cs") -Encoding UTF8
|
||||
|
||||
@"
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace AvaloniaStaticLinkSmoke;
|
||||
|
||||
public sealed partial class App : Application
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
desktop.MainWindow = new MainWindow();
|
||||
}
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
||||
"@ | Set-Content -Path (Join-Path $ProjectDir "App.axaml.cs") -Encoding UTF8
|
||||
|
||||
@"
|
||||
<Application xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="AvaloniaStaticLinkSmoke.App">
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
"@ | Set-Content -Path (Join-Path $ProjectDir "App.axaml") -Encoding UTF8
|
||||
|
||||
@"
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AvaloniaStaticLinkSmoke;
|
||||
|
||||
public sealed partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
"@ | Set-Content -Path (Join-Path $ProjectDir "MainWindow.axaml.cs") -Encoding UTF8
|
||||
|
||||
@"
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="AvaloniaStaticLinkSmoke.MainWindow"
|
||||
Width="420"
|
||||
Height="220"
|
||||
Title="Avalonia StaticLink Smoke">
|
||||
<Border Padding="24">
|
||||
<StackPanel Spacing="8" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Text="Avalonia $AvaloniaVersion" FontSize="24" FontWeight="SemiBold" HorizontalAlignment="Center" />
|
||||
<TextBlock Text="StaticLink NativeAOT smoke publish" HorizontalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Window>
|
||||
"@ | Set-Content -Path (Join-Path $ProjectDir "MainWindow.axaml") -Encoding UTF8
|
||||
Reference in new issue
Block a user