forked from PhoenixNil/XrayUI-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXrayUI-dev.csproj
More file actions
132 lines (119 loc) · 6.07 KB
/
XrayUI-dev.csproj
File metadata and controls
132 lines (119 loc) · 6.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>XrayUI</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<WinUISDKReferences>false</WinUISDKReferences>
<EnableMsixTooling>true</EnableMsixTooling>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WindowsPackageType>None</WindowsPackageType>
</PropertyGroup>
<ItemGroup>
<!-- Keep engine + rules out of MSIX packaging but copy them to the output directory -->
<Content Remove="Assets\engine\wintun.dll" />
<Content Remove="Assets\engine\xray.exe" />
<Content Remove="Assets\rules\geoip.dat" />
<Content Remove="Assets\rules\geosite.dat" />
</ItemGroup>
<!-- The standalone Updater lives in a sibling project; exclude it from the main app's
default file globs so we don't double-include its sources / Program.cs entry point. -->
<ItemGroup>
<Compile Remove="XrayUI.Updater\**" />
<Content Remove="XrayUI.Updater\**" />
<None Remove="XrayUI.Updater\**" />
<Page Remove="XrayUI.Updater\**" />
<ApplicationDefinition Remove="XrayUI.Updater\**" />
</ItemGroup>
<ItemGroup>
<None Include="Assets\engine\xray.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Assets\engine\wintun.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Assets\rules\geoip.dat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Assets\rules\geosite.dat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<!--
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
Tools extension to be activated for this project even if the Windows App SDK Nuget
package has not yet been restored.
-->
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ProjectCapability Include="Msix" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.251219" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.28000.1839" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="2.0.1" />
<!-- Promote these two transitive deps of WindowsAppSDK to direct references so we can
strip their runtime assets (DirectML.dll / onnxruntime.dll / Microsoft.Windows.AI.MachineLearning.dll).
IncludeAssets=compile keeps the reference assemblies for compile-time use; PrivateAssets=all
prevents them from flowing to consumers. -->
<PackageReference Include="Microsoft.WindowsAppSDK.AI" Version="*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.AI.MachineLearning" Version="*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="WinUIEx" Version="2.9.0" />
</ItemGroup>
<!--
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
Explorer "Package and Publish" context menu entry to be enabled for this project even if
the Windows App SDK Nuget package has not yet been restored.
-->
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
<!-- Publish Properties -->
<PropertyGroup>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<ApplicationIcon>Assets\Icons\output.ico</ApplicationIcon>
</PropertyGroup>
<!-- Version: defaults for local builds; CI overrides via -p:Version=<tag> -->
<PropertyGroup>
<Version Condition="'$(Version)' == ''">0.0.0-dev</Version>
</PropertyGroup>
<ItemGroup>
<Content Update="Assets\Icons\output.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!-- Auto-publish the standalone Updater alongside the main app on local
`dotnet publish`, so testing the in-app upgrade flow doesn't require
running two commands. CI bypasses this with -p:BuildingForCI=true
(it publishes the updater explicitly to keep step logs separated).
Skipped when no RID is set (e.g. plain `dotnet build`) since the
Exec would otherwise emit a malformed `-r` flag. -->
<Target Name="PublishUpdaterAlongside" AfterTargets="Publish"
Condition="'$(BuildingForCI)' != 'true' and '$(RuntimeIdentifier)' != ''">
<PropertyGroup>
<UpdaterStagingDir>$(IntermediateOutputPath)updater-publish\</UpdaterStagingDir>
</PropertyGroup>
<Exec Command="dotnet publish "$(MSBuildThisFileDirectory)XrayUI.Updater\XrayUI.Updater.csproj" -c $(Configuration) -r $(RuntimeIdentifier) -p:SelfContained=true -p:PublishAot=true -p:PublishTrimmed=true -p:PublishSingleFile=false -p:Version=$(Version) -o "$(UpdaterStagingDir)""
EnvironmentVariables="DOTNET_CLI_UI_LANGUAGE=en" />
<Copy SourceFiles="$(UpdaterStagingDir)XrayUI.Updater.exe"
DestinationFolder="$(PublishDir)" />
<Message Text="Bundled XrayUI.Updater.exe into $(PublishDir)" Importance="high" />
</Target>
</Project>