Skip to content

Commit

Permalink
feat: UploadHelper Overhaul/Fixing BepInExPluginVersion (#503)
Browse files Browse the repository at this point in the history
* UploadHelper Overhaul/Fixing BepInExPluginVersion

* Fix for spaces in path
  • Loading branch information
MrPurple6411 authored Dec 2, 2023
1 parent 661b32f commit 6477816
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 145 deletions.
89 changes: 45 additions & 44 deletions Example mod/Example mod.csproj
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<RootNamespace>Nautilus.Examples</RootNamespace>
<AssemblyName>Nautilus.Example</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<Configurations>SN.STABLE;BZ.STABLE</Configurations>
<Platforms>AnyCPU</Platforms>
<Copyright>Copyright © 2023</Copyright>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
<Import Project="$(SolutionDir)Version.targets" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SN.STABLE|AnyCPU'">
<OutputPath>bin\SN.STABLE\</OutputPath>
<DefineConstants>SUBNAUTICA;SUBNAUTICA_STABLE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'BZ.STABLE|AnyCPU'">
<OutputPath>bin\BZ.STABLE\</OutputPath>
<DefineConstants>BELOWZERO;BELOWZERO_STABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Nautilus\Nautilus.csproj">
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.21" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.1.0" />
<PackageReference Include="PolySharp" Version="1.13.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Target Name="CopyToOutputPath" AfterTargets="Build">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="$(SolutionDir)Version.targets" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<RootNamespace>Nautilus.Examples</RootNamespace>
<AssemblyName>Nautilus.Example</AssemblyName>
<BepInExPluginVersion>$(VersionPrefix).$(SuffixNumber)</BepInExPluginVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<Configurations>SN.STABLE;BZ.STABLE</Configurations>
<Platforms>AnyCPU</Platforms>
<Copyright>Copyright © 2023</Copyright>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SN.STABLE|AnyCPU'">
<OutputPath>bin\SN.STABLE\</OutputPath>
<DefineConstants>SUBNAUTICA;SUBNAUTICA_STABLE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'BZ.STABLE|AnyCPU'">
<OutputPath>bin\BZ.STABLE\</OutputPath>
<DefineConstants>BELOWZERO;BELOWZERO_STABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<LocalizationFiles Include="Localization\*.*" />
<ProjectReference Include="..\Nautilus\Nautilus.csproj">
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Copy SourceFiles="@(LocalizationFiles)" DestinationFolder="$(OutDir)\Localization" SkipUnchangedFiles="true" />
</Target>
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.21" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.1.0" />
<PackageReference Include="PolySharp" Version="1.13.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Target Name="CopyToOutputPath" AfterTargets="Build">
<ItemGroup>
<LocalizationFiles Include="Localization\*.*" />
</ItemGroup>
<Copy SourceFiles="@(LocalizationFiles)" DestinationFolder="$(OutDir)\Localization" SkipUnchangedFiles="true" />
</Target>
</Project>
4 changes: 3 additions & 1 deletion Nautilus.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5152F028-6D03-43C0-88C5-986313017D4F}"
ProjectSection(SolutionItems) = preProject
common.props = common.props
Directory.Build.props = Directory.Build.props
PostBuild.targets = PostBuild.targets
Version.targets = Version.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UploadHelper", "UploadHelper\UploadHelper.csproj", "{1D6AED20-87CC-4756-8E6A-1E8A10E16EB1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UploadHelper", "UploadHelper\UploadHelper.csproj", "{1D6AED20-87CC-4756-8E6A-1E8A10E16EB1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions Nautilus/Nautilus.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="..\Version.targets" />
<PropertyGroup>
Expand All @@ -8,7 +8,7 @@
<RootNamespace>Nautilus</RootNamespace>
<AssemblyName>Nautilus</AssemblyName>
<BepInExPluginGuid>com.snmodding.nautilus</BepInExPluginGuid>
<BepInExPluginVersion>$(VersionPrefix)</BepInExPluginVersion>
<BepInExPluginVersion>$(VersionPrefix).$(SuffixNumber)</BepInExPluginVersion>
<LangVersion>11</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
Expand Down
4 changes: 2 additions & 2 deletions PostBuild.targets
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="ZipPlugin" AfterTargets="Build">
<PropertyGroup>
<BuildPath>Nautilus</BuildPath>
<PluginsDir>$(OutDir)\plugins</PluginsDir>
<BuildDir>$([System.IO.Path]::Combine('$(PluginsDir)', '$(BuildPath)'))</BuildDir>
<BuildZipPath>$([System.IO.Path]::Combine('$(TargetDir)', 'Nautilus_$(ConfigurationName).zip'))</BuildZipPath>
<BuildZipPath>$([System.IO.Path]::Combine('$(TargetDir)', 'Nautilus_$(ConfigurationName)_$(BepInExPluginVersion).zip'))</BuildZipPath>
<TemporaryDir>$([System.IO.Path]::Combine('$(OutDir)', 'TemporaryDir'))</TemporaryDir>
<TemporaryBuildDir>$([System.IO.Path]::Combine('$(TemporaryDir)', 'Build'))</TemporaryBuildDir>
</PropertyGroup>
Expand Down
Loading

0 comments on commit 6477816

Please sign in to comment.