Repository navigation
Expand file tree
/
Copy pathtemplate.targets
More file actions
66 lines (60 loc) · 3.05 KB
/
Copy pathtemplate.targets
File metadata and controls
66 lines (60 loc) · 3.05 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
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<!-- UTSL 插件不需要把第三方依赖复制到 out/:宿主已经带了 UnifierTSL / TShockAPI 及其依赖。
需要私有依赖的插件请走 ModuleDependencies + dependencies.json(参考 UTSL 自带的 Atelier 插件)。 -->
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup>
<OutputPath>..\..\out\$(Configuration)</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<!--
UnifierTSL 源码位置。默认取本仓库同级目录下的 UnifierTSL。
放在别处时用属性覆盖:
dotnet build Plugin.slnx -c Release -p:UnifierTSLRepo=D:\path\to\UnifierTSL
-->
<PropertyGroup>
<UnifierTSLRepo Condition="'$(UnifierTSLRepo)' == ''">$(MSBuildThisFileDirectory)../UnifierTSL</UnifierTSLRepo>
</PropertyGroup>
<!--
GetText.NET 不在这里显式引用:TShockAPI 已经以 8.0.5 引用它(与宿主运行时一致),
传递过来即可编译 src/Shared/I18n.cs。显式写死会被 dependabot 拱到 10.x,
与宿主实际加载的 GetText 版本不一致。
-->
<!--
宿主(UnifierTSL / TShockAPI)已经加载了这些程序集,Private=false 避免复制到 out/,
这样打包出来的 Plugins.zip 里只有插件自己的 DLL。
-->
<ItemGroup>
<ProjectReference Include="$(UnifierTSLRepo)/src/UnifierTSL/UnifierTSL.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
<ProjectReference Include="$(UnifierTSLRepo)/src/Plugins/TShockAPI/TShockAPI.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Shared\**\*.cs"/>
<EmbeddedResource Include=".\i18n\*.mo">
<LogicalName>i18n.%(FileName).mo</LogicalName>
</EmbeddedResource>
</ItemGroup>
<Target Name="githash" BeforeTargets="PreBuildEvent">
<Exec Command="git log -1 --pretty="format:%25H"" StandardOutputImportance="low" StandardErrorImportance="low" ContinueOnError="true" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitHashValue"/>
</Exec>
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyInformationalVersionAttribute">
<_Parameter1>$(CommitHashValue)</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Target>
</Project>