-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModInfoJson.targets
More file actions
49 lines (44 loc) · 2.32 KB
/
ModInfoJson.targets
File metadata and controls
49 lines (44 loc) · 2.32 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
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Mod_Id Condition=" '$(Mod_Id)' == '' ">$(AssemblyName)</Mod_Id>
<Mod_DisplayName Condition=" '$(DisplayName)' == '' ">$(Mod_Id)</Mod_DisplayName>
<Mod_Author Condition=" '$(Mod_Author)' == '' ">$(Authors)</Mod_Author>
<Mod_Version Condition=" '$(Mod_Version)' == '' ">$(Version)</Mod_Version>
<Mod_AssemblyName Condition=" '$(Mod_AssemblyName)' == '' ">$(AssemblyName).dll</Mod_AssemblyName>
<Mod_EntryMethod Condition=" '$(Mod_EntryMethod)' == ''" >$(RootNamespace).Main.Load</Mod_EntryMethod>
</PropertyGroup>
<ItemGroup>
<ValueLine Include="{"/>
<ValueLine Include=""Id": "$(Mod_Id)","/>
<ValueLine Include=""DisplayName": "$(Mod_DisplayName)","/>
<ValueLine Include=""Author": "$(Mod_Author)","/>
<ValueLine Include=""Version": "$(Mod_Version)","/>
<ValueLine Include=""ManagerVersion": "$(Mod_ManagerVersion)","/>
<ValueLine Include=""AssemblyName": "$(Mod_AssemblyName)","/>
<ValueLine Include=""EntryMethod": "$(Mod_EntryMethod)""/>
<ValueLine Include="}"/>
</ItemGroup>
<Target Name="MakeModInfo">
<Message Text="Make Mod Info." Importance="high" />
<WriteLinesToFile
File="$(OutputPath)\Info.json"
Overwrite="True"
Lines="@(ValueLine)"
/>
</Target>
<Target Name="CopyModToGame">
<Message Text="Copy mod." Importance="high" />
<Error Text="GamePath not set." Condition=" '$(GamePath)' == ''"/>
<Message Text="Copy mod to game: "$(GamePath)\Mods\$(AssemblyName)"" Importance="High" />
<RemoveDir Directories="$(GamePath)\Mods\$(AssemblyName)"/>
<ItemGroup>
<MyStuff Include="$(TargetDir)**\*" />
<!--<MyStuff Include="$(TargetDir)Info.json" />-->
</ItemGroup>
<Message Text="MyStuff: @(MyStuff)" Importance="High" />
<Message Text="TargetDir: $(TargetDir)" Importance="High" />
<Copy SourceFiles="@(MyStuff)" DestinationFolder="$(GamePath)\Mods\$(AssemblyName)\%(RecursiveDir)" ContinueOnError="false" />
<!--<Copy SourceFiles="$(TergetDir)\Info.json" DestinationFolder="$(GamePath)\Mods\$(AssemblyName)\Info.json" ContinueOnError="false" />-->
</Target>
</Project>