Skip to content

Commit

Permalink
GenerateCustomPropsFile in InitialTargets, removing the need to run a…
Browse files Browse the repository at this point in the history
…s postAction (#15)
  • Loading branch information
microsoftenator2022 authored Jul 23, 2024
1 parent 51ef288 commit 7fe238a
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 168 deletions.
20 changes: 1 addition & 19 deletions content/Kingmaker.ModTemplate/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,5 @@
"replaces": "{Game}",
"defaultValue": "Kingmaker"
}
},
"postActions": [
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "dotnet",
"args": "msbuild -t:GenerateCustomPropsFile",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [
{
"text": "Run 'GenerateCustomPropsFile' target"
}
],
"continueOnError": false,
"description ": "Sets up reference paths by executing the GenerateCustomPropsFile MSBuild target"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile">
<Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" />

<PropertyGroup>
Expand Down Expand Up @@ -35,7 +35,7 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" IncludeAssets="build; contentfiles" Version="0.4.2" PrivateAssets="all" />
</ItemGroup>
<Target Name="GenerateCustomPropsFile" BeforeTargets="BeforeBuild" Condition="$({Game}InstallDir) == ''">
<Target Name="GenerateCustomPropsFile" Condition="$({Game}InstallDir) == ''">
<Exec Command="findstr /C:&quot;[Manager] Mods path: &quot; &quot;$({Game}Data)\output_log.txt&quot;" IgnoreExitCode="true" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,5 @@
"replaces": "{Game}",
"defaultValue": "RogueTrader"
}
},
"postActions": [
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "dotnet",
"args": "msbuild -t:GenerateCustomPropsFile",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [
{
"text": "Run 'GenerateCustomPropsFile' target"
}
],
"continueOnError": false,
"description ": "Sets up reference paths by executing the GenerateCustomPropsFile MSBuild target"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile">
<Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" />

<PropertyGroup>
Expand Down Expand Up @@ -43,7 +43,7 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" IncludeAssets="build; contentfiles" Version="0.4.2" PrivateAssets="all" />
</ItemGroup>
<Target Name="GenerateCustomPropsFile" BeforeTargets="BeforeBuild" Condition="$({Game}InstallDir) == ''">
<Target Name="GenerateCustomPropsFile" Condition="$({Game}InstallDir) == ''">
<Exec Command="findstr /C:&quot;Mono path[0]&quot; &quot;$({Game}Data)\Player.log&quot;" IgnoreExitCode="true" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" />
Expand Down
20 changes: 1 addition & 19 deletions content/RogueTrader.ModTemplate/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,5 @@
"replaces": "{Game}",
"defaultValue": "RogueTrader"
}
},
"postActions": [
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "dotnet",
"args": "msbuild -t:GenerateCustomPropsFile",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [
{
"text": "Run 'GenerateCustomPropsFile' target"
}
],
"continueOnError": false,
"description ": "Sets up reference paths by executing the GenerateCustomPropsFile MSBuild target"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile">
<Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" />

<PropertyGroup>
Expand Down Expand Up @@ -43,7 +43,7 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" IncludeAssets="build; contentfiles" Version="0.4.2" PrivateAssets="all" />
</ItemGroup>
<Target Name="GenerateCustomPropsFile" BeforeTargets="BeforeBuild" Condition="$({Game}InstallDir) == ''">
<Target Name="GenerateCustomPropsFile" Condition="$({Game}InstallDir) == ''">
<Exec Command="findstr /C:&quot;Mono path[0]&quot; &quot;$({Game}Data)\Player.log&quot;" IgnoreExitCode="true" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,5 @@
"replaces": "{Game}",
"defaultValue": "RogueTrader"
}
},
"postActions": [
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "dotnet",
"args": "msbuild -t:GenerateCustomPropsFile",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [
{
"text": "Run 'GenerateCustomPropsFile' target"
}
],
"continueOnError": false,
"description ": "Sets up reference paths by executing the GenerateCustomPropsFile MSBuild target"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile">
<Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" />

<PropertyGroup>
Expand Down Expand Up @@ -49,7 +49,7 @@
<RemoveDir Directories="$(OutputPath)\publish" />
<PublishToWorkshop PathToManifest="$(MSBuildThisFileDirectory)\OwlcatModificationManifest.json" ImageDir="$(SolutionDir)" BuildDir="$(MSBuildProjectDirectory)\$(OutputPath)" PathToDescription="$(SolutionDir)Workshop-description.txt" GameAppId="2186680" />
</Target>
<Target Name="GenerateCustomPropsFile" BeforeTargets="BeforeBuild" Condition="$({Game}InstallDir) == ''">
<Target Name="GenerateCustomPropsFile" Condition="$({Game}InstallDir) == ''">
<Exec Command="findstr /C:&quot;Mono path[0]&quot; &quot;$({Game}Data)\Player.log&quot;" IgnoreExitCode="true" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,5 @@
"replaces": "{Game}",
"defaultValue": "RogueTrader"
}
},
"postActions": [
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "dotnet",
"args": "msbuild -t:GenerateCustomPropsFile",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [
{
"text": "Run 'GenerateCustomPropsFile' target"
}
],
"continueOnError": false,
"description ": "Sets up reference paths by executing the GenerateCustomPropsFile MSBuild target"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile">
<Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" />

<PropertyGroup>
Expand Down Expand Up @@ -49,7 +49,7 @@
<RemoveDir Directories="$(OutputPath)\publish" />
<PublishToWorkshop PathToManifest="$(MSBuildThisFileDirectory)\OwlcatModificationManifest.json" ImageDir="$(SolutionDir)" BuildDir="$(MSBuildProjectDirectory)\$(OutputPath)" PathToDescription="$(SolutionDir)Workshop-description.txt" GameAppId="2186680" />
</Target>
<Target Name="GenerateCustomPropsFile" BeforeTargets="BeforeBuild" Condition="$({Game}InstallDir) == ''">
<Target Name="GenerateCustomPropsFile" Condition="$({Game}InstallDir) == ''">
<Exec Command="findstr /C:&quot;Mono path[0]&quot; &quot;$({Game}Data)\Player.log&quot;" IgnoreExitCode="true" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" />
Expand Down
20 changes: 1 addition & 19 deletions content/Wrath.BPCoreModTemplate/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,5 @@
"replaces": "{Game}",
"defaultValue": "Wrath"
}
},
"postActions": [
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "dotnet",
"args": "msbuild -t:GenerateCustomPropsFile",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [
{
"text": "Run 'GenerateCustomPropsFile' target"
}
],
"continueOnError": false,
"description ": "Sets up reference paths by executing the GenerateCustomPropsFile MSBuild target"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile">
<Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" />

<PropertyGroup>
Expand Down Expand Up @@ -57,7 +57,7 @@
<PackageReference Include="ILRepack.MSBuild.Task" Version="2.*" />
<PackageReference Include="WW-Blueprint-Core" Version="*" />
</ItemGroup>
<Target Name="GenerateCustomPropsFile" BeforeTargets="BeforeBuild" Condition="$({Game}InstallDir) == ''">
<Target Name="GenerateCustomPropsFile" Condition="$({Game}InstallDir) == ''">
<Exec Command="findstr /C:&quot;Mono path[0]&quot; &quot;$({Game}Data)\Player.log&quot;" IgnoreExitCode="true" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" />
Expand Down
20 changes: 1 addition & 19 deletions content/Wrath.ModTemplate/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,5 @@
"replaces": "{Game}",
"defaultValue": "Wrath"
}
},
"postActions": [
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "dotnet",
"args": "msbuild -t:GenerateCustomPropsFile",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [
{
"text": "Run 'GenerateCustomPropsFile' target"
}
],
"continueOnError": false,
"description ": "Sets up reference paths by executing the GenerateCustomPropsFile MSBuild target"
}
]
}
}
4 changes: 2 additions & 2 deletions content/Wrath.ModTemplate/{SourceName}/{SourceName}.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile">
<Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" />

<PropertyGroup>
Expand Down Expand Up @@ -37,7 +37,7 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" IncludeAssets="build; contentfiles" Version="0.4.2" PrivateAssets="all" />
</ItemGroup>
<Target Name="GenerateCustomPropsFile" BeforeTargets="BeforeBuild" Condition="$({Game}InstallDir) == ''">
<Target Name="GenerateCustomPropsFile" Condition="$({Game}InstallDir) == ''">
<Exec Command="findstr /C:&quot;Mono path[0]&quot; &quot;$({Game}Data)\Player.log&quot;" IgnoreExitCode="true" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" />
Expand Down
20 changes: 1 addition & 19 deletions content/Wrath.SoundModTemplate/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,5 @@
"replaces": "{Game}",
"defaultValue": "Wrath"
}
},
"postActions": [
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "dotnet",
"args": "msbuild -t:GenerateCustomPropsFile",
"redirectStandardOutput": false,
"redirectStandardError": false
},
"manualInstructions": [
{
"text": "Run 'GenerateCustomPropsFile' target"
}
],
"continueOnError": false,
"description ": "Sets up reference paths by executing the GenerateCustomPropsFile MSBuild target"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateCustomPropsFile">
<Import Project="$(SolutionDir)GamePath.props" Condition="Exists('$(SolutionDir)GamePath.props')" />

<PropertyGroup>
Expand Down Expand Up @@ -39,7 +39,7 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" IncludeAssets="build; contentfiles" Version="0.4.2" PrivateAssets="all" />
</ItemGroup>
<Target Name="GenerateCustomPropsFile" BeforeTargets="BeforeBuild" Condition="$({Game}InstallDir) == ''">
<Target Name="GenerateCustomPropsFile" Condition="$({Game}InstallDir) == ''">
<Exec Command="findstr /C:&quot;Mono path[0]&quot; &quot;$({Game}Data)\Player.log&quot;" IgnoreExitCode="true" ConsoleToMSBuild="true">
<Output TaskParameter="ExitCode" PropertyName="ExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="MonoPathLine" />
Expand Down

0 comments on commit 7fe238a

Please sign in to comment.