no powershell

master
t0stiman 2025-02-03 16:55:52 +01:00
parent 83839c6e8e
commit bd9ee968f5
4 changed files with 8 additions and 46 deletions

View File

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

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net48</TargetFramework> <TargetFramework>net48</TargetFramework>
<LangVersion>latest</LangVersion> <LangVersion>10</LangVersion>
<WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors> <WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors>
<PackageId>doot</PackageId> <PackageId>doot</PackageId>
<RootNamespace>doot</RootNamespace> <RootNamespace>doot</RootNamespace>
@ -14,7 +14,6 @@
<!-- Railroader --> <!-- Railroader -->
<Reference Include="Assembly-CSharp" /> <Reference Include="Assembly-CSharp" />
<Reference Include="Definition" /> <Reference Include="Definition" />
<Reference Include="Ops" />
<!-- Unity --> <!-- Unity -->
<Reference Include="Unity.Analytics.DataPrivacy" /> <Reference Include="Unity.Analytics.DataPrivacy" />
@ -132,14 +131,4 @@
<Publicize Include="Assembly-CSharp" /> <Publicize Include="Assembly-CSharp" />
</ItemGroup> </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> </Project>

View File

@ -1,29 +0,0 @@
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"
}