parent
07c6bc3d0a
commit
1bcb99430c
@ -1,9 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This file contains project properties used by the build. -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ImportBSMTTargets>True</ImportBSMTTargets>
|
||||
<BSMTProjectType>BSIPA</BSMTProjectType>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
<DisableCopyToPlugins>true</DisableCopyToPlugins>
|
||||
<DisableZipRelease>true</DisableZipRelease>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(NCrunch)' == '1'">
|
||||
<ContinuousIntegrationBuild>false</ContinuousIntegrationBuild>
|
||||
<DisableCopyToPlugins>true</DisableCopyToPlugins>
|
||||
<DisableZipRelease>true</DisableZipRelease>
|
||||
</PropertyGroup>
|
||||
</Project>
|
101
Mod/Directory.Build.targets
Normal file
101
Mod/Directory.Build.targets
Normal file
@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This file contains the build tasks and targets for verifying the manifest, zipping Release builds,
|
||||
and copying the plugin to to your Beat Saber folder. Only edit this if you know what you are doing. -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<BuildTargetsVersion>2.0</BuildTargetsVersion>
|
||||
<!--Set this to true if you edit this file to prevent automatic updates-->
|
||||
<BuildTargetsModified>false</BuildTargetsModified>
|
||||
<!--Output assembly path without extension-->
|
||||
<OutputAssemblyName>$(OutputPath)$(AssemblyName)</OutputAssemblyName>
|
||||
<!--Path to folder to be zipped. Needs to be relative to the project directory to work without changes to the 'BuildForCI' target.-->
|
||||
<ArtifactDestination>$(OutputPath)Final</ArtifactDestination>
|
||||
<ErrorOnMismatchedVersions Condition="'$(Configuration)' == 'Release'">True</ErrorOnMismatchedVersions>
|
||||
</PropertyGroup>
|
||||
<!--Build Targets-->
|
||||
<!--Displays a warning if BeatSaberModdingTools.Tasks is not installed.-->
|
||||
<Target Name="CheckBSMTInstalled" AfterTargets="BeforeBuild" Condition="'$(BSMTTaskAssembly)' == ''">
|
||||
<Warning Text="The BeatSaberModdingTools.Tasks nuget package doesn't seem to be installed, advanced build targets will not work."/>
|
||||
</Target>
|
||||
<!--Runs a build task to get info about the project used by later targets.-->
|
||||
<Target Name="GetProjectInfo" AfterTargets="CheckBSMTInstalled" DependsOnTargets="CheckBSMTInstalled" Condition="'$(BSMTTaskAssembly)' != ''">
|
||||
<Message Text="Using AssemblyVersion defined in project instead of 'Properties\AssemblyInfo.cs'" Importance="high" Condition="'$(AssemblyVersion)' != ''"/>
|
||||
<GetManifestInfo FailOnError="$(ErrorOnMismatchedVersions)">
|
||||
<Output TaskParameter="PluginVersion" PropertyName="PluginVersion"/>
|
||||
<Output TaskParameter="BasePluginVersion" PropertyName="BasePluginVersion"/>
|
||||
<Output TaskParameter="GameVersion" PropertyName="GameVersion"/>
|
||||
</GetManifestInfo>
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>$(BasePluginVersion)</AssemblyVersion>
|
||||
<FileVersion>$(BasePluginVersion)</FileVersion>
|
||||
<InformationalVersion>$(BasePluginVersion)</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
<GetCommitInfo ProjectDir="$(ProjectDir)">
|
||||
<Output TaskParameter="CommitHash" PropertyName="CommitHash"/>
|
||||
<Output TaskParameter="Branch" PropertyName="Branch"/>
|
||||
<Output TaskParameter="Modified" PropertyName="GitModified"/>
|
||||
</GetCommitInfo>
|
||||
<PropertyGroup>
|
||||
<!--Build name for artifact/zip file-->
|
||||
<ArtifactName>$(AssemblyName)</ArtifactName>
|
||||
<ArtifactName Condition="'$(PluginVersion)' != ''">$(ArtifactName)-$(PluginVersion)</ArtifactName>
|
||||
<ArtifactName Condition="'$(GameVersion)' != ''">$(ArtifactName)-bs$(GameVersion)</ArtifactName>
|
||||
<ArtifactName Condition="'$(CommitHash)' != '' AND '$(CommitHash)' != 'local'">$(ArtifactName)-$(CommitHash)</ArtifactName>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<!--Build target for Continuous Integration builds. Set up for GitHub Actions.-->
|
||||
<Target Name="BuildForCI" AfterTargets="Build" DependsOnTargets="GetProjectInfo" Condition="'$(ContinuousIntegrationBuild)' == 'True' AND '$(BSMTTaskAssembly)' != ''">
|
||||
<PropertyGroup>
|
||||
<!--Set 'ArtifactName' if it failed before.-->
|
||||
<ArtifactName Condition="'$(ArtifactName)' == ''">$(AssemblyName)</ArtifactName>
|
||||
</PropertyGroup>
|
||||
<Message Text="Building for CI" Importance="high"/>
|
||||
<Message Text="PluginVersion: $(PluginVersion), AssemblyVersion: $(AssemblyVersion), GameVersion: $(GameVersion)" Importance="high"/>
|
||||
<Message Text="::set-output name=filename::$(ArtifactName)" Importance="high"/>
|
||||
<Message Text="::set-output name=assemblyname::$(AssemblyName)" Importance="high"/>
|
||||
<Message Text="::set-output name=artifactpath::$(ProjectDir)$(ArtifactDestination)" Importance="high"/>
|
||||
<Message Text="Copying '$(OutputAssemblyName).dll' to '$(ProjectDir)$(ArtifactDestination)\Plugins\$(AssemblyName).dll'" Importance="high"/>
|
||||
<Copy SourceFiles="$(OutputAssemblyName).dll" DestinationFiles="$(ProjectDir)$(ArtifactDestination)\Plugins\$(AssemblyName).dll"/>
|
||||
</Target>
|
||||
<!--Creates a BeatMods compliant zip file with the release.-->
|
||||
<Target Name="ZipRelease" AfterTargets="Build" Condition="'$(DisableZipRelease)' != 'True' AND '$(Configuration)' == 'Release' AND '$(BSMTTaskAssembly)' != ''">
|
||||
<PropertyGroup>
|
||||
<!--Set 'ArtifactName' if it failed before.-->
|
||||
<ArtifactName Condition="'$(ArtifactName)' == ''">$(AssemblyName)</ArtifactName>
|
||||
<DestinationDirectory>$(OutDir)zip\</DestinationDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<OldZips Include="$(DestinationDirectory)$(AssemblyName)*.zip"/>
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="$(OutputAssemblyName).dll" DestinationFiles="$(ArtifactDestination)\Plugins\$(AssemblyName).dll"/>
|
||||
<Message Text="PluginVersion: $(PluginVersion), AssemblyVersion: $(AssemblyVersion), GameVersion: $(GameVersion)" Importance="high"/>
|
||||
<Delete Files="@(OldZips)" TreatErrorsAsWarnings="true" ContinueOnError="true"/>
|
||||
<ZipDir SourceDirectory="$(ArtifactDestination)" DestinationFile="$(DestinationDirectory)$(ArtifactName).zip"/>
|
||||
</Target>
|
||||
<!--Copies the assembly and pdb to the Beat Saber folder.-->
|
||||
<Target Name="CopyToPlugins" AfterTargets="Build" Condition="'$(DisableCopyToPlugins)' != 'True' AND '$(ContinuousIntegrationBuild)' != 'True'">
|
||||
<PropertyGroup>
|
||||
<PluginDir>$(BeatSaberDir)\Plugins</PluginDir>
|
||||
<CanCopyToPlugins>True</CanCopyToPlugins>
|
||||
<CopyToPluginsError Condition="!Exists('$(PluginDir)')">Unable to copy assembly to game folder, did you set 'BeatSaberDir' correctly in your 'csproj.user' file? Plugins folder doesn't exist: '$(PluginDir)'.</CopyToPluginsError>
|
||||
<!--Error if 'BeatSaberDir' does not have 'Beat Saber.exe'-->
|
||||
<CopyToPluginsError Condition="!Exists('$(BeatSaberDir)\Beat Saber.exe')">Unable to copy to Plugins folder, '$(BeatSaberDir)' does not appear to be a Beat Saber game install.</CopyToPluginsError>
|
||||
<!--Error if 'BeatSaberDir' is the same as 'LocalRefsDir'-->
|
||||
<CopyToPluginsError Condition="'$(BeatSaberDir)' == '$(LocalRefsDir)' OR '$(BeatSaberDir)' == ''">Unable to copy to Plugins folder, 'BeatSaberDir' has not been set in your 'csproj.user' file.</CopyToPluginsError>
|
||||
<CanCopyToPlugins Condition="'$(CopyToPluginsError)' != ''">False</CanCopyToPlugins>
|
||||
</PropertyGroup>
|
||||
<!--Check if Beat Saber is running-->
|
||||
<IsProcessRunning ProcessName="Beat Saber" Condition="'$(BSMTTaskAssembly)' != ''">
|
||||
<Output TaskParameter="IsRunning" PropertyName="IsRunning"/>
|
||||
</IsProcessRunning>
|
||||
<PropertyGroup>
|
||||
<!--If Beat Saber is running, output to the Pending folder-->
|
||||
<PluginDir Condition="'$(IsRunning)' == 'True'">$(BeatSaberDir)\IPA\Pending\Plugins</PluginDir>
|
||||
</PropertyGroup>
|
||||
<Warning Text="$(CopyToPluginsError)" Condition="'$(CopyToPluginsError)' != ''"/>
|
||||
<Message Text="Copying '$(OutputAssemblyName).dll' to '$(PluginDir)'." Importance="high" Condition="$(CanCopyToPlugins)"/>
|
||||
<Copy SourceFiles="$(OutputAssemblyName).dll" DestinationFiles="$(PluginDir)\$(AssemblyName).dll" Condition="$(CanCopyToPlugins)"/>
|
||||
<Copy SourceFiles="$(OutputAssemblyName).pdb" DestinationFiles="$(PluginDir)\$(AssemblyName).pdb" Condition="'$(CanCopyToPlugins)' == 'True' AND Exists('$(OutputAssemblyName).pdb')"/>
|
||||
<Warning Text="Beat Saber is running, restart the game to use the latest build." Condition="'$(IsRunning)' == 'True'"/>
|
||||
</Target>
|
||||
</Project>
|
@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<LocalRefsDir Condition="Exists('..\Refs')">..\Refs</LocalRefsDir>
|
||||
<GameDirectory>$(LocalRefsDir)</GameDirectory>
|
||||
<BeatSaberDir>$(LocalRefsDir)</BeatSaberDir>
|
||||
<AppOutputBase>$(MSBuildProjectDirectory)\</AppOutputBase>
|
||||
<LangVersion>9</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Copyright>Copyright © 2023</Copyright>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<WarningLevel>3</WarningLevel>
|
||||
</PropertyGroup>
|
||||
@ -16,12 +18,12 @@
|
||||
<Reference Include="BGNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
|
||||
<Reference Include="BS_Utils, Version=1.12.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>$(GameDirectory)\Plugins\BS_Utils.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Plugins\BS_Utils.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="SiraUtil, Version=3.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>$(GameDirectory)\Plugins\SiraUtil.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Plugins\SiraUtil.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
@ -31,57 +33,57 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Main">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\Main.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Main.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="HMLib">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\HMLib.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\HMLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="HMUI">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\HMUI.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\HMUI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="IPA.Loader">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\IPA.Loader.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\IPA.Loader.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Unity.TextMeshPro">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\Unity.TextMeshPro.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Unity.TextMeshPro.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\UnityEngine.UI.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UIElementsModule">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UIModule">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\UnityEngine.UIModule.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UIModule.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityWebRequestModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\UnityEngine.UnityWebRequestModule.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UnityWebRequestModule.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.VRModule">
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\UnityEngine.VRModule.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.VRModule.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Zenject, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\Zenject.dll</HintPath>
|
||||
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Zenject.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
Reference in New Issue
Block a user