-
Notifications
You must be signed in to change notification settings - Fork 2
/
Directory.Build.targets
53 lines (48 loc) · 2 KB
/
Directory.Build.targets
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
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<RelTargetDir>$(RelDir)\$(TargetName)</RelTargetDir>
</PropertyGroup>
<Target Name="WriteModDescFile" AfterTargets="Build">
<PropertyGroup>
<ModDescFile>$(ProjectDir)info\mod.yaml</ModDescFile>
<ModDescFileContent>
title: "$(ModName)"
description: "$(ModDesc)"
staticID: "$(ModID)"
</ModDescFileContent>
</PropertyGroup>
<WriteLinesToFile File="$(ModDescFile)" Overwrite="true" Lines="$(ModDescFileContent)"/>
</Target>
<Target Name="WriteModInfoFile" AfterTargets="Build">
<PropertyGroup>
<ModInfoFile>$(ProjectDir)info\mod_info.yaml</ModInfoFile>
<ModInfoFileContent>
supportedContent: $(SupportedContent)
minimumSupportedBuild: $(minimumSupportedBuild)
APIVersion: $(APIVersion)
version: "$(ModVersion)"
</ModInfoFileContent>
</PropertyGroup>
<WriteLinesToFile File="$(ModInfoFile)" Overwrite="true" Lines="$(ModInfoFileContent)"/>
</Target>
<Target Name="CopyRelFiles" AfterTargets="Build">
<RemoveDir Directories="$(RelTargetDir)" />
<ItemGroup>
<DllFiles Include="$(TargetDir)*.dll" />
<AssetFiles Include="$(ProjectDir)assets\*" />
<TranslationFiles Include="$(ProjectDir)translations\*" />
<ConfigFiles Include="$(ProjectDir)*.json" />
<InfoFiles Include="$(ProjectDir)info\*" />
</ItemGroup>
<Copy SourceFiles="@(DllFiles)" DestinationFolder="$(RelTargetDir)" />
<Copy SourceFiles="@(AssetFiles)" DestinationFolder="$(RelTargetDir)\assets" />
<Copy SourceFiles="@(TranslationFiles)" DestinationFolder="$(RelTargetDir)\translations" />
<Copy SourceFiles="@(ConfigFiles)" DestinationFolder="$(RelTargetDir)" />
<Copy SourceFiles="@(InfoFiles)" DestinationFolder="$(RelTargetDir)" />
<ItemGroup>
<ModFiles Include="$(RelTargetDir)\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(ModFiles)" DestinationFiles="@(ModFiles->'$(ModDir)\$(TargetName)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
</Project>