|
1 |
| -<Project Sdk="Microsoft.NET.Sdk"> |
| 1 | +<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile"> |
| 2 | + <Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" /> |
2 | 3 |
|
3 | 4 | <PropertyGroup>
|
4 | 5 | <TargetFramework>net481</TargetFramework>
|
5 | 6 | <ImplicitUsings>enable</ImplicitUsings>
|
6 |
| - <Nullable>disable</Nullable> |
7 |
| - <PackageOutputPath>$(OutputPath)</PackageOutputPath> |
8 |
| - <AllowUnsafeBlocks>True</AllowUnsafeBlocks> |
9 |
| - <LangVersion>preview</LangVersion> |
10 |
| - <RunPostBuildEvent>Always</RunPostBuildEvent> |
11 |
| - <AssemblyVersion>1.2.0</AssemblyVersion> |
12 |
| - <FileVersion>1.2.0</FileVersion> |
| 7 | + <AssemblyName>AutoMount</AssemblyName> |
| 8 | + <Description>AutoMount for TabletopTweaks</Description> |
| 9 | + <Version>1.2.1</Version> |
| 10 | + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
| 11 | + <LangVersion>latest</LangVersion> |
| 12 | + <RootNamespace>AutoMount</RootNamespace> |
| 13 | + <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> |
| 14 | + <RestoreAdditionalProjectSources>https://api.nuget.org/v3/index.json</RestoreAdditionalProjectSources> |
| 15 | + <WrathData>$(LocalAppData)Low\Owlcat Games\Pathfinder Wrath Of The Righteous</WrathData> |
13 | 16 | </PropertyGroup>
|
14 |
| - |
15 | 17 | <ItemGroup>
|
16 |
| - <PackageReference Include="AssemblyPublicizer" Version="1.0.2"> |
17 |
| - <PrivateAssets>all</PrivateAssets> |
18 |
| - <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
19 |
| - </PackageReference> |
| 18 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\Assembly-CSharp.dll*" Publicize="true" Private="false" /> |
| 19 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\Assembly-CSharp-firstpass.dll*" Private="false" /> |
| 20 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\Core*.dll" Private="false" /> |
| 21 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\Newtonsoft.Json.dll*" Private="false" /> |
| 22 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\Owlcat*.dll" Publicize="true" Private="false" /> |
| 23 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\UniRx.dll*" Private="false" /> |
| 24 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\Unity*.dll" Private="false" /> |
| 25 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\UnityModManager\UnityModManager.dll*" Publicize="true" Private="false" /> |
| 26 | + <Reference Include="$(WrathInstallDir)\Wrath_Data\Managed\UnityModManager\0Harmony.dll*" Private="false" /> |
| 27 | + <Reference Include="$(WrathInstallDir)\Mods\ModMenu\ModMenu.dll" Private="false" /> |
20 | 28 | </ItemGroup>
|
21 |
| - |
| 29 | + <Target Name="EmptyModDir" BeforeTargets="Build"> |
| 30 | + <ItemGroup> |
| 31 | + <ModDir Include="$(WrathInstallDir)\Mods\$(AssemblyName)\*.*" /> |
| 32 | + </ItemGroup> |
| 33 | + |
| 34 | + <Delete Files="@(ModDir)" /> |
| 35 | + </Target> |
22 | 36 | <ItemGroup>
|
23 |
| - <Reference Include="0Harmony"> |
24 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\UnityModManager\0Harmony.dll</HintPath> |
25 |
| - <Private>False</Private> |
26 |
| - </Reference> |
27 |
| - <Reference Include="Assembly-CSharp"> |
28 |
| - <HintPath>$(SolutionDir)lib\Assembly-CSharp_public.dll</HintPath> |
29 |
| - <Private>False</Private> |
30 |
| - </Reference> |
31 |
| - <Reference Include="Assembly-CSharp-firstpass"> |
32 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath> |
33 |
| - <Private>False</Private> |
34 |
| - </Reference> |
35 |
| - <Reference Include="Owlcat.Runtime.Core"> |
36 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\Owlcat.Runtime.Core.dll</HintPath> |
37 |
| - </Reference> |
38 |
| - <Reference Include="Owlcat.Runtime.UI"> |
39 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\Owlcat.Runtime.UI.dll</HintPath> |
40 |
| - </Reference> |
41 |
| - <Reference Include="UnityEngine"> |
42 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\UnityEngine.dll</HintPath> |
43 |
| - </Reference> |
44 |
| - <Reference Include="UnityEngine.CoreModule"> |
45 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\UnityEngine.CoreModule.dll</HintPath> |
46 |
| - <Private>False</Private> |
47 |
| - </Reference> |
48 |
| - <Reference Include="UnityEngine.IMGUIModule"> |
49 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath> |
50 |
| - <Private>False</Private> |
51 |
| - </Reference> |
52 |
| - <Reference Include="UnityEngine.TextRenderingModule"> |
53 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath> |
54 |
| - </Reference> |
55 |
| - <Reference Include="UnityModManager"> |
56 |
| - <HintPath>$(WrathPath)\Wrath_Data\Managed\UnityModManager\UnityModManager.dll</HintPath> |
57 |
| - <Private>False</Private> |
58 |
| - </Reference> |
59 |
| - <Reference Include="ModMenu"> |
60 |
| - <HintPath>$(WrathPath)\Mods\ModMenu\ModMenu.dll</HintPath> |
61 |
| - <Private>False</Private> |
62 |
| - </Reference> |
| 37 | + <None Include="Info.json" CopyToOutputDirectory="PreserveNewest" /> |
63 | 38 | </ItemGroup>
|
| 39 | + <Target Name="Deploy" AfterTargets="Build"> |
| 40 | + <ItemGroup> |
| 41 | + <Files Include="$(TargetDir)\**\*.*" /> |
| 42 | + </ItemGroup> |
64 | 43 |
|
65 |
| - <ItemGroup> |
66 |
| - <Compile Update="Properties\Resources.Designer.cs"> |
67 |
| - <DesignTime>True</DesignTime> |
68 |
| - <AutoGen>True</AutoGen> |
69 |
| - <DependentUpon>Resources.resx</DependentUpon> |
70 |
| - </Compile> |
71 |
| - </ItemGroup> |
| 44 | + <PropertyGroup> |
| 45 | + <ModDescription>$(Description.Replace(' ', '_'))</ModDescription> |
| 46 | + </PropertyGroup> |
72 | 47 |
|
| 48 | + <Copy |
| 49 | + SourceFiles="@(Files)" |
| 50 | + DestinationFiles="@(Files->'$(WrathInstallDir)\Mods\$(AssemblyName)\%(RecursiveDir)%(Filename)%(Extension)')" |
| 51 | + OverwriteReadOnlyFiles="true" |
| 52 | + SkipUnchangedFiles="false" |
| 53 | + /> |
| 54 | + |
| 55 | + <MakeDir Directories="$(MSBuildProjectDirectory)\$(OutputPath)\$(AssemblyName)" /> |
| 56 | + <Move SourceFiles="@(Files)" DestinationFolder="$(MSBuildProjectDirectory)\$(OutputPath)\$(AssemblyName)"/> |
| 57 | + |
| 58 | + <ZipDirectory |
| 59 | + SourceDirectory="$(MSBuildProjectDirectory)\$(OutputPath)" |
| 60 | + DestinationFile="$(SolutionDir)Export\$(ModDescription)_v$(Version).zip" |
| 61 | + Overwrite="true" |
| 62 | + /> |
| 63 | + </Target> |
73 | 64 | <ItemGroup>
|
74 |
| - <EmbeddedResource Update="Properties\Resources.resx"> |
75 |
| - <Generator>ResXFileCodeGenerator</Generator> |
76 |
| - <LastGenOutput>Resources.Designer.cs</LastGenOutput> |
77 |
| - </EmbeddedResource> |
| 65 | + <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" /> |
| 66 | + <PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" IncludeAssets="build; contentfiles" Version="0.4.2" PrivateAssets="all" /> |
78 | 67 | </ItemGroup>
|
| 68 | + <Target Name="GenerateCustomPropsFile" Condition="$(WrathInstallDir) == ''"> |
| 69 | + <Exec Command="findstr /C:"Mono path[0]" "$(WrathData)\Player.log"" IgnoreExitCode="true" ConsoleToMSBuild="true"> |
| 70 | + <Output TaskParameter="ExitCode" PropertyName="ExitCode" /> |
| 71 | + <Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" /> |
| 72 | + </Exec> |
79 | 73 |
|
80 |
| - <Target Name="Deploy" AfterTargets="Build"> |
| 74 | + <PropertyGroup> |
| 75 | + <MonoPathRegex>^Mono path\[0\] = '(.*?)/Wrath_Data/Managed'$</MonoPathRegex> |
| 76 | + </PropertyGroup> |
| 77 | + |
| 78 | + <PropertyGroup> |
| 79 | + <WrathInstallDir>$([System.Text.RegularExpressions.Regex]::Match($(MonoPathLine), $(MonoPathRegex)).Groups[1].Value)</WrathInstallDir> |
| 80 | + </PropertyGroup> |
| 81 | + |
| 82 | + <WriteLinesToFile File="$(SolutionDir)GamePath.props" Lines="<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
 <PropertyGroup>
 <WrathInstallDir>$(WrathInstallDir)</WrathInstallDir>
 </PropertyGroup>
</Project>" Overwrite="true" Encoding="utf-8" /> |
| 83 | + </Target> |
| 84 | + <Target Name="DeleteFiles" BeforeTargets="Clean"> |
81 | 85 | <ItemGroup>
|
82 |
| - <Files1 Include="$(OutDir)\**\AutoMount.*" /> |
| 86 | + <PropsFile Include="GamePath.props" /> |
83 | 87 | </ItemGroup>
|
84 | 88 | <ItemGroup>
|
85 |
| - <Files2 Include="$(ProjectDir)\Info.json" /> |
| 89 | + <ExportDir Include="$(SolutionDir)Export\*.zip" /> |
86 | 90 | </ItemGroup>
|
87 | 91 |
|
88 |
| - <Copy |
89 |
| - SourceFiles="@(Files1);@(Files2)" |
90 |
| - DestinationFolder="$(WrathPath)\Mods\$(MSBuildProjectName)" |
91 |
| - OverwriteReadOnlyFiles="true" |
92 |
| - SkipUnchangedFiles="false" |
93 |
| - /> |
| 92 | + <Delete Files="@(PropsFile);@(ExportDir)" /> |
94 | 93 | </Target>
|
95 |
| - |
96 |
| - <Target Name="Publicize" AfterTargets="Clean"> |
97 |
| - <ItemGroup> |
98 |
| - <Assemblies Include="$(WrathPath)\Wrath_Data\Managed\Assembly-CSharp.dll" /> |
99 |
| - </ItemGroup> |
100 |
| - |
101 |
| - <PublicizeTask InputAssemblies="@(Assemblies)" OutputDir="$(SolutionDir)lib/" /> |
| 94 | + <Target Name="PostClean" AfterTargets="Clean"> |
| 95 | + <RemoveDir Directories="$(OutDir)"/> |
102 | 96 | </Target>
|
103 |
| - |
104 |
| - <ProjectExtensions><VisualStudio><UserProperties info_1json__JsonSchema="https://json.schemastore.org/global.json" /></VisualStudio></ProjectExtensions> |
105 |
| - |
106 | 97 | </Project>
|
0 commit comments