parent
07c6bc3d0a
commit
1bcb99430c
@ -1,9 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- This file contains project properties used by the build. -->
|
<!-- This file contains project properties used by the build. -->
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||||
<ImportBSMTTargets>True</ImportBSMTTargets>
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||||
<BSMTProjectType>BSIPA</BSMTProjectType>
|
<DisableCopyToPlugins>true</DisableCopyToPlugins>
|
||||||
<LangVersion>8.0</LangVersion>
|
<DisableZipRelease>true</DisableZipRelease>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(NCrunch)' == '1'">
|
||||||
|
<ContinuousIntegrationBuild>false</ContinuousIntegrationBuild>
|
||||||
|
<DisableCopyToPlugins>true</DisableCopyToPlugins>
|
||||||
|
<DisableZipRelease>true</DisableZipRelease>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</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 Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net48</TargetFramework>
|
<TargetFramework>net48</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<LocalRefsDir Condition="Exists('..\Refs')">..\Refs</LocalRefsDir>
|
<LocalRefsDir Condition="Exists('..\Refs')">..\Refs</LocalRefsDir>
|
||||||
<GameDirectory>$(LocalRefsDir)</GameDirectory>
|
<BeatSaberDir>$(LocalRefsDir)</BeatSaberDir>
|
||||||
<AppOutputBase>$(MSBuildProjectDirectory)\</AppOutputBase>
|
<AppOutputBase>$(MSBuildProjectDirectory)\</AppOutputBase>
|
||||||
<LangVersion>9</LangVersion>
|
<LangVersion>9</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<Copyright>Copyright © 2023</Copyright>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
<WarningLevel>3</WarningLevel>
|
<WarningLevel>3</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -16,12 +18,12 @@
|
|||||||
<Reference Include="BGNet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
|
<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">
|
<Reference Include="BS_Utils, Version=1.12.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
<HintPath>$(GameDirectory)\Plugins\BS_Utils.dll</HintPath>
|
<HintPath>$(BeatSaberDir)\Plugins\BS_Utils.dll</HintPath>
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SiraUtil, Version=3.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="SiraUtil, Version=3.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
<HintPath>$(GameDirectory)\Plugins\SiraUtil.dll</HintPath>
|
<HintPath>$(BeatSaberDir)\Plugins\SiraUtil.dll</HintPath>
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@ -31,57 +33,57 @@
|
|||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Main">
|
<Reference Include="Main">
|
||||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\Main.dll</HintPath>
|
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Main.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HMLib">
|
<Reference Include="HMLib">
|
||||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\HMLib.dll</HintPath>
|
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\HMLib.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HMUI">
|
<Reference Include="HMUI">
|
||||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\HMUI.dll</HintPath>
|
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\HMUI.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="IPA.Loader">
|
<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>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Unity.TextMeshPro">
|
<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>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine">
|
<Reference Include="UnityEngine">
|
||||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\UnityEngine.dll</HintPath>
|
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.CoreModule">
|
<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>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.UI">
|
<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>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.UIElementsModule">
|
<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>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.UIModule">
|
<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>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.UnityWebRequestModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="UnityEngine.UnityWebRequestModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<Private>False</Private>
|
<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>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.VRModule">
|
<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>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Zenject, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Zenject, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
<HintPath>$(GameDirectory)\Beat Saber_Data\Managed\Zenject.dll</HintPath>
|
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Zenject.dll</HintPath>
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Reference in New Issue
Block a user