Skip to content

Commit

Permalink
Using net472 for Steam/GOG/Epic and netcoreapp for Xbox instead of ne…
Browse files Browse the repository at this point in the history
…tstandard2.0 for both

Because Visual Studio 2022 is not able to use netstandard2.0
Using standard xml replacing instead of the custom one
Better GameBinariesFolder for the non Sdk project
  • Loading branch information
Vitalii Mikhailov committed Jul 18, 2023
1 parent 0912ece commit 3740416
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 105 deletions.
24 changes: 0 additions & 24 deletions src/Bannerlord.Module.CSharp/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,30 +316,6 @@
}
],
"SpecialCustomOperations": {
"**/*.xml": {
"operations": [
{
"type": "conditional",
"configuration": {
"if": [
"---#if"
],
"else": [
"---#else"
],
"elseif": [
"---#elseif",
"---#elif"
],
"endif": [
"---#endif"
],
"trim": "true",
"wholeLine": "true"
}
}
]
},
"**/*.json": {
"flagPrefix": "//",
"operations": [
Expand Down
25 changes: 22 additions & 3 deletions src/Bannerlord.Module.CSharp/BLNamespace.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

<PropertyGroup>
<Version>0.0.1</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<!--#if (gameWindows && gameWindowsStore) -->
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<!--#elseif (gameWindows && !gameWindowsStore) -->
<TargetFramework>net472</TargetFramework>
<!--#elseif (!gameWindows && gameWindowsStore) -->
<TargetFramework>netcoreapp3.1</TargetFramework>
<!--#endif -->
<Platforms>x64</Platforms>
<LangVersion Condition="'$(langVersion)' != ''">$(ProjectLanguageVersion)</LangVersion>
<Nullable Condition="'$(nullable)' != ''">enable</Nullable>
Expand All @@ -12,11 +18,24 @@
<ModuleName>$(ProjectModuleName)</ModuleName>
<ModuleUrl>$(ProjectModuleUrl)</ModuleUrl>
<GameFolder>$(ProjectGameFolder)</GameFolder>
<GameBinariesFolder Condition="Exists('$(GameFolder)\bin\Win64_Shipping_Client')">Win64_Shipping_Client</GameBinariesFolder>
<GameBinariesFolder Condition="Exists('$(GameFolder)\bin\Gaming.Desktop.x64_Shipping_Client')">Gaming.Desktop.x64_Shipping_Client</GameBinariesFolder>
<GameBinariesFolder Condition="Exists('$(GameFolder)\bin\Win64_Shipping_Client\Bannerlord.exe')">Win64_Shipping_Client</GameBinariesFolder>
<GameBinariesFolder Condition="Exists('$(GameFolder)\bin\Gaming.Desktop.x64_Shipping_Client\Bannerlord.exe')">Gaming.Desktop.x64_Shipping_Client</GameBinariesFolder>
<GameVersion Condition="'$(ReferenceReferenceAssemblies)' == 'true'">$(ProjectGameVersion)</GameVersion>
</PropertyGroup>

<!--#if (gameWindows) -->
<PropertyGroup Condition="$(TargetFramework) == 'net472'">
<BuildForWindows>true</BuildForWindows>
</PropertyGroup>
<!--#endif -->
<!--#if (gameWindowsStore) -->
<PropertyGroup Condition="$(TargetFramework) == 'netcoreapp3.1'">
<BuildForWindowsStore>false</BuildForWindowsStore>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
<!--#endif -->

<ItemGroup Condition="'$(ReferenceGameAssemblies)' == 'true'">
<Reference Include="$(GameFolder)\bin\$(GameBinariesFolder)\Newtonsoft.Json.dll">
<HintPath>%(Identity)</HintPath>
Expand Down
56 changes: 28 additions & 28 deletions src/Bannerlord.Module.CSharp/_Module/SubModule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,74 +9,74 @@
<ModuleType value="Community" />
<Url value="$moduleurl$" />
<DependedModules>
---#if (AddBLSELoadingInterceptor)
<!--#if (AddBLSELoadingInterceptor) -->
<!-- BLSE or any launcher that provides this feature will ignore this Dependency-marker -->
<!-- but the default launcher will not let this module to be loaded -->
<DependedModule Id="BLSE.LoadingInterceptor" Optional="false" />
---#endif
---#if (AddBLSEAssemblyResolver)
<!--#endif -->
<!--#if (AddBLSEAssemblyResolver) -->
<!-- BLSE or any launcher that provides this feature will ignore this Dependency-marker -->
<!-- but the default launcher will not let this module to be loaded -->
<DependedModule Id="BLSE.AssemblyResolver" Optional="false" />
---#endif
---#if (ReferenceHarmony)
<!--#endif -->
<!--#if (ReferenceHarmony) -->
<DependedModule Id="Bannerlord.Harmony" DependentVersion="v2.2.2" />
---#endif
---#if (ReferenceButterLib)
<!--#endif -->
<!--#if (ReferenceButterLib) -->
<DependedModule Id="Bannerlord.ButterLib" DependentVersion="v2.8.0" />
---#endif
---#if (ReferenceUIExtenderEx)
<!--#endif -->
<!--#if (ReferenceUIExtenderEx) -->
<DependedModule Id="Bannerlord.UIExtenderEx" DependentVersion="v2.8.0" />
---#endif
---#if (ReferenceMCM)
<!--#endif -->
<!--#if (ReferenceMCM) -->
<DependedModule Id="Bannerlord.MBOptionScreen" DependentVersion="v5.7.1" />
---#endif
---#if (ReferenceReferenceAssemblies)
<!--#endif -->
<!--#if (ReferenceReferenceAssemblies) -->
<DependedModule Id="Native" DependentVersion="$gameversion$" />
<DependedModule Id="SandBoxCore" DependentVersion="$gameversion$" />
<DependedModule Id="Sandbox" DependentVersion="$gameversion$" />
<DependedModule Id="StoryMode" DependentVersion="$gameversion$" />
<DependedModule Id="CustomBattle" DependentVersion="$gameversion$" />
---#else
<!--#else -->
<DependedModule Id="Native" />
<DependedModule Id="SandBoxCore" />
<DependedModule Id="Sandbox" />
<DependedModule Id="StoryMode" />
<DependedModule Id="CustomBattle" />
---#endif
<!--#endif -->
</DependedModules>
<!-- Community Dependency Metadata -->
<!-- https://github.com/BUTR/Bannerlord.BLSE#for-modders -->
<DependedModuleMetadatas>
---#if (ReferenceHarmony)
<!--#if (ReferenceHarmony) -->
<DependedModuleMetadata id="Bannerlord.Harmony" order="LoadBeforeThis" version="v2.2.2" />
---#endif
---#if (ReferenceButterLib)
<!--#endif -->
<!--#if (ReferenceButterLib) -->
<DependedModuleMetadata id="Bannerlord.ButterLib" order="LoadBeforeThis" version="v2.8.0" />
---#endif
---#if (ReferenceUIExtenderEx)
<!--#endif -->
<!--#if (ReferenceUIExtenderEx) -->
<DependedModuleMetadata id="Bannerlord.UIExtenderEx" order="LoadBeforeThis" version="v2.8.0" />
---#endif
---#if (ReferenceMCM)
<!--#endif -->
<!--#if (ReferenceMCM) -->
<DependedModuleMetadata id="Bannerlord.MBOptionScreen" order="LoadBeforeThis" version="v5.7.1" />
---#endif
---#if (ReferenceReferenceAssemblies)
<!--#endif -->
<!--#if (ReferenceReferenceAssemblies) -->
<DependedModuleMetadata id="Native" order="LoadBeforeThis" version="$gameversion$.*" />
<DependedModuleMetadata id="SandBoxCore" order="LoadBeforeThis" version="$gameversion$.*" />
<DependedModuleMetadata id="Sandbox" order="LoadBeforeThis" version="$gameversion$.*" />
<DependedModuleMetadata id="StoryMode" order="LoadBeforeThis" version="$gameversion$.*" />
<DependedModuleMetadata id="CustomBattle" order="LoadBeforeThis" version="$gameversion$.*" />
---#else
<!--#else -->
<DependedModuleMetadata id="Native" order="LoadBeforeThis" />
<DependedModuleMetadata id="SandBoxCore" order="LoadBeforeThis" />
<DependedModuleMetadata id="Sandbox" order="LoadBeforeThis" />
<DependedModuleMetadata id="StoryMode" order="LoadBeforeThis" />
<DependedModuleMetadata id="CustomBattle" order="LoadBeforeThis" />
---#endif
<!--#endif -->
</DependedModuleMetadatas>
<!-- Community Dependency Metadata -->
<SubModules>
---#if (ReferenceMCMAsSoftDependency)
<!--#if (ReferenceMCMAsSoftDependency) -->
<SubModule>
<Name value="MCMv5" />
<DLLName value="MCMv5.dll" />
Expand All @@ -89,7 +89,7 @@
<SubModuleClassType value="MCM.Internal.MCMImplementationSubModule" />
<Tags />
</SubModule>
---#endif
<!--#endif -->
<SubModule>
<Name value="$modulename$" />
<DLLName value="$modulename$.dll" />
Expand Down
24 changes: 0 additions & 24 deletions src/Bannerlord.Module.Sdk.CSharp/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,30 +299,6 @@
}
],
"SpecialCustomOperations": {
"**/*.xml": {
"operations": [
{
"type": "conditional",
"configuration": {
"if": [
"---#if"
],
"else": [
"---#else"
],
"elseif": [
"---#elseif",
"---#elif"
],
"endif": [
"---#endif"
],
"trim": "true",
"wholeLine": "true"
}
}
]
},
"**/*.json": {
"flagPrefix": "//",
"operations": [
Expand Down
21 changes: 20 additions & 1 deletion src/Bannerlord.Module.Sdk.CSharp/BLNamespace.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

<PropertyGroup>
<Version>0.0.1</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<!--#if (gameWindows && gameWindowsStore) -->
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<!--#elseif (gameWindows && !gameWindowsStore) -->
<TargetFramework>net472</TargetFramework>
<!--#elseif (!gameWindows && gameWindowsStore) -->
<TargetFramework>netcoreapp3.1</TargetFramework>
<!--#endif -->
<Platforms>x64</Platforms>
<LangVersion Condition="'$(langVersion)' != ''">$(ProjectLanguageVersion)</LangVersion>
<Nullable Condition="'$(nullable)' != ''">enable</Nullable>
Expand All @@ -20,6 +26,19 @@
<!-- <OverrideGameVersion>v1.0.0</OverrideGameVersion> -->
</PropertyGroup>

<!--#if (gameWindows) -->
<PropertyGroup Condition="$(TargetFramework) == 'net472'">
<BuildForWindows>true</BuildForWindows>
</PropertyGroup>
<!--#endif -->
<!--#if (gameWindowsStore) -->
<PropertyGroup Condition="$(TargetFramework) == 'netcoreapp3.1'">
<BuildForWindowsStore>false</BuildForWindowsStore>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
<!--#endif -->

<!-- Development Variables -->
<PropertyGroup>
<HarmonyVersion Condition="'$(ReferenceHarmony)' == 'true'">2.2.2</HarmonyVersion>
Expand Down
50 changes: 25 additions & 25 deletions src/Bannerlord.Module.Sdk.CSharp/_Module/SubModule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@
<ModuleType value="Community" />
<Url value="$moduleurl$" />
<DependedModules>
---#if (AddBLSELoadingInterceptor)
<!--#if (AddBLSELoadingInterceptor) -->
<!-- BLSE or any launcher that provides this feature will ignore this Dependency-marker -->
<!-- but the default launcher will not let this module to be loaded -->
<DependedModule Id="BLSE.LoadingInterceptor" Optional="false" />
---#endif
---#if (AddBLSEAssemblyResolver)
<!--#endif -->
<!--#if (AddBLSEAssemblyResolver) -->
<!-- BLSE or any launcher that provides this feature will ignore this Dependency-marker -->
<!-- but the default launcher will not let this module to be loaded -->
<DependedModule Id="BLSE.AssemblyResolver" Optional="false" />
---#endif
---#if (ReferenceHarmony)
<!--#endif -->
<!--#if (ReferenceHarmony) -->
<DependedModule Id="Bannerlord.Harmony" DependentVersion="v$harmonyversion$" />
---#endif
---#if (ReferenceButterLib)
<!--#endif -->
<!--#if (ReferenceButterLib) -->
<DependedModule Id="Bannerlord.ButterLib" DependentVersion="v$butterlibversion$" />
---#endif
---#if (ReferenceUIExtenderEx)
<!--#endif -->
<!--#if (ReferenceUIExtenderEx) -->
<DependedModule Id="Bannerlord.UIExtenderEx" DependentVersion="v$uiextenderexversion$" />
---#endif
---#if (ReferenceMCM)
<!--#endif -->
<!--#if (ReferenceMCM) -->
<DependedModule Id="Bannerlord.MBOptionScreen" DependentVersion="v$mcmversion$" />
---#endif
<!--#endif -->
<DependedModule Id="Native" DependentVersion="$gameversion$" />
<DependedModule Id="SandBoxCore" DependentVersion="$gameversion$" />
<DependedModule Id="Sandbox" DependentVersion="$gameversion$" />
Expand All @@ -40,26 +40,26 @@
<!-- Community Dependency Metadata -->
<!-- https://github.com/BUTR/Bannerlord.BLSE#for-modders -->
<DependedModuleMetadatas>
---#if (ReferenceHarmony)
<!--#if (ReferenceHarmony) -->
<DependedModuleMetadata id="Bannerlord.Harmony" order="LoadBeforeThis" version="v$harmonyversion$" />
---#endif
---#if (ReferenceButterLib)
<!--#endif -->
<!--#if (ReferenceButterLib) -->
<DependedModuleMetadata id="Bannerlord.ButterLib" order="LoadBeforeThis" version="v$butterlibversion$" />
---#endif
---#if (ReferenceUIExtenderEx)
<!--#endif -->
<!--#if (ReferenceUIExtenderEx) -->
<DependedModuleMetadata id="Bannerlord.UIExtenderEx" order="LoadBeforeThis" version="v$uiextenderexversion$" />
---#endif
---#if (ReferenceMCM)
<!--#endif -->
<!--#if (ReferenceMCM) -->
<DependedModuleMetadata id="Bannerlord.MBOptionScreen" order="LoadBeforeThis" version="v$mcmversion$" />
---#endif
<!--#endif -->
<DependedModuleMetadata id="Native" order="LoadBeforeThis" version="$gameversion$.*" />
<DependedModuleMetadata id="SandBoxCore" order="LoadBeforeThis" version="$gameversion$.*" />
<DependedModuleMetadata id="Sandbox" order="LoadBeforeThis" version="$gameversion$.*" />
<DependedModuleMetadata id="StoryMode" order="LoadBeforeThis" version="$gameversion$.*" />
<DependedModuleMetadata id="CustomBattle" order="LoadBeforeThis" version="$gameversion$.*" />
</DependedModuleMetadatas>
<SubModules>
---#if (ReferenceMCMAsSoftDependency)
<!--#if (ReferenceMCMAsSoftDependency) -->
<SubModule>
<Name value="MCMv5" />
<DLLName value="MCMv5.dll" />
Expand All @@ -72,8 +72,8 @@
<SubModuleClassType value="MCM.Internal.MCMImplementationSubModule" />
<Tags />
</SubModule>
---#endif
---#if (ReferenceModuleLoader)
<!--#endif -->
<!--#if (ReferenceModuleLoader) -->
<!-- Bannerlord Module Loader. Do not change the name! -->
<SubModule>
<Name value="Bannerlord Module Loader" />
Expand All @@ -83,13 +83,13 @@
<Tag key="LoaderFilter" value ="$moduleid$.*.dll" />
</Tags>
</SubModule>
---#else
<!--#else -->
<SubModule>
<Name value="$modulename$" />
<DLLName value="$moduleid$.$gameversion$.dll" />
<SubModuleClassType value="$moduleid$.SubModule" />
<Tags />
</SubModule>
---#endif
<!--#endif -->
</SubModules>
</Module>

0 comments on commit 3740416

Please sign in to comment.