Compare commits

..

No commits in common. "bd9ee968f5a9b8bbd76b32b6497177605f557dbe" and "3f964c81a6ac22001fe806656ad05cec5ffa3e08" have entirely different histories.

4 changed files with 48 additions and 8 deletions

View File

@ -1,14 +1,12 @@
<Project>
<PropertyGroup>
<RrInstallDir>/mnt/Data/SteamLibrary/steamapps/common/Railroader</RrInstallDir>
<RrInstallDir>D:\Programs\Railroader</RrInstallDir>
<UnityInstallDir>D:\Programs\Unity\2021.3.33f1\Editor</UnityInstallDir>
<ReferencePath>
$(RrInstallDir)/Railroader_Data/Managed/;
$(RrInstallDir)/Railroader_Data/Managed/UnityModManager/;
$(RrInstallDir)\Railroader_Data\Managed\;
$(RrInstallDir)\Railroader_Data\Managed\UnityModManager\;
$(UnityInstallDir)\Data\Managed\
</ReferencePath>
<AssemblySearchPaths>$(AssemblySearchPaths);$(ReferencePath);</AssemblySearchPaths>
</PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<!-- Copy to game folder -->
<Copy SourceFiles="$(TargetPath);../README.md;../info.json;../LICENSE" DestinationFolder="$(RrInstallDir)/Mods/doot" />
</Target>
</Project>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<LangVersion>10</LangVersion>
<LangVersion>latest</LangVersion>
<WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors>
<PackageId>doot</PackageId>
<RootNamespace>doot</RootNamespace>
@ -14,6 +14,7 @@
<!-- Railroader -->
<Reference Include="Assembly-CSharp" />
<Reference Include="Definition" />
<Reference Include="Ops" />
<!-- Unity -->
<Reference Include="Unity.Analytics.DataPrivacy" />
@ -94,7 +95,9 @@
<Reference Include="UnityEngine.TilemapModule" />
<Reference Include="UnityEngine.UI" />
<Reference Include="UnityEngine.UIElementsModule" />
<Reference Include="UnityEngine.UIElementsNativeModule" />
<Reference Include="UnityEngine.UIModule" />
<Reference Include="UnityEngine.UNETModule" />
<Reference Include="UnityEngine.UmbraModule" />
<Reference Include="UnityEngine.UnityAnalyticsCommonModule" />
<Reference Include="UnityEngine.UnityAnalyticsModule" />
@ -131,4 +134,14 @@
<Publicize Include="Assembly-CSharp" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<!-- Copy to build folder -->
<Copy SourceFiles="$(TargetPath)" DestinationFolder="../build/" />
<!-- Package after Release build -->
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="powershell -executionpolicy bypass ../package.ps1 -NoArchive -OutputDirectory 'D:\Programs\Railroader\Mods'" />
<!-- Linux -->
<Exec Condition="'$(OS)' != 'Windows_NT'" Command="pwsh -Command &quot;(../package.ps1)&quot;" />
</Target>
</Project>

29
package.ps1 Normal file
View File

@ -0,0 +1,29 @@
param (
[switch]$NoArchive,
[string]$OutputDirectory = $PSScriptRoot
)
Set-Location "$PSScriptRoot"
$FilesToInclude = "info.json","build/*","LICENSE","README.md"
$modInfo = Get-Content -Raw -Path "info.json" | ConvertFrom-Json
$modId = $modInfo.Id
$modVersion = $modInfo.Version
$DistDir = "$OutputDirectory/dist"
if ($NoArchive) {
$ZipWorkDir = "$OutputDirectory"
} else {
$ZipWorkDir = "$DistDir/tmp"
}
$ZipOutDir = "$ZipWorkDir/$modId"
New-Item "$ZipOutDir" -ItemType Directory -Force
Copy-Item -Force -Path $FilesToInclude -Destination "$ZipOutDir"
Copy-Item -Force -Path "assetbundles/dootbundle" -Destination "$ZipOutDir"
if (!$NoArchive)
{
$FILE_NAME = "$DistDir/${modId}_v$modVersion.zip"
Compress-Archive -Update -CompressionLevel Fastest -Path "$ZipOutDir/*" -DestinationPath "$FILE_NAME"
}