no powershell
parent
83839c6e8e
commit
bd9ee968f5
|
@ -1,12 +1,14 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<RrInstallDir>D:\Programs\Railroader</RrInstallDir>
|
||||
<UnityInstallDir>D:\Programs\Unity\2021.3.33f1\Editor</UnityInstallDir>
|
||||
<RrInstallDir>/mnt/Data/SteamLibrary/steamapps/common/Railroader</RrInstallDir>
|
||||
<ReferencePath>
|
||||
$(RrInstallDir)\Railroader_Data\Managed\;
|
||||
$(RrInstallDir)\Railroader_Data\Managed\UnityModManager\;
|
||||
$(UnityInstallDir)\Data\Managed\
|
||||
$(RrInstallDir)/Railroader_Data/Managed/;
|
||||
$(RrInstallDir)/Railroader_Data/Managed/UnityModManager/;
|
||||
</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>
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<LangVersion>10</LangVersion>
|
||||
<WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors>
|
||||
<PackageId>doot</PackageId>
|
||||
<RootNamespace>doot</RootNamespace>
|
||||
|
@ -14,7 +14,6 @@
|
|||
<!-- Railroader -->
|
||||
<Reference Include="Assembly-CSharp" />
|
||||
<Reference Include="Definition" />
|
||||
<Reference Include="Ops" />
|
||||
|
||||
<!-- Unity -->
|
||||
<Reference Include="Unity.Analytics.DataPrivacy" />
|
||||
|
@ -132,14 +131,4 @@
|
|||
<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 "(../package.ps1)"" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
29
package.ps1
29
package.ps1
|
@ -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"
|
||||
}
|
Loading…
Reference in New Issue