Single file publish support, test project and simple build CI
This also adds remote raspberry pi debugging with default install details. More testing is required as MonoMod may not be working for arm64 still CI might not work yet either
This commit is contained in:
parent
c159f2b388
commit
2c36dacfd2
8 changed files with 241 additions and 29 deletions
|
|
@ -5,18 +5,18 @@
|
|||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AssemblyName Condition="$([MSBuild]::IsOSPlatform('Windows'))">TShock</AssemblyName>
|
||||
<AssemblyName Condition="$([MSBuild]::IsOSPlatform('Windows')) == false">TShock.Run</AssemblyName>
|
||||
<AssemblyName Condition="'$(RuntimeIdentifier)' == 'win-x64' Or '$(RuntimeIdentifier)' == ''">TShock</AssemblyName>
|
||||
<AssemblyName Condition="'$(RuntimeIdentifier)' != 'win-x64' And '$(RuntimeIdentifier)' != ''">TShock.Run</AssemblyName>
|
||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||
<DebugType>embedded</DebugType>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TerrariaServerAPI\TerrariaServerAPI\TerrariaServerAPI.csproj" />
|
||||
<ProjectReference Include="..\TShockAPI\TShockAPI.csproj">
|
||||
<!-- dont put TShockAPI in the dependencies -->
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<Reference Include="HttpServer">
|
||||
<ProjectReference Include="..\TerrariaServerAPI\TerrariaServerAPI\TerrariaServerAPI.csproj" ExcludeFromSingleFile="true" />
|
||||
<ProjectReference Include="..\TShockAPI\TShockAPI.csproj" ExcludeFromSingleFile="true" Condition="'$(PublishSingleFile)' == 'true'" />
|
||||
<ProjectReference Include="..\TShockAPI\TShockAPI.csproj" ReferenceOutputAssembly="false" Condition="'$(PublishSingleFile)' != 'true'" />
|
||||
<Reference Include="HttpServer" ExcludeFromSingleFile="true" >
|
||||
<HintPath>..\prebuilts\HttpServer.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
|
@ -28,23 +28,27 @@
|
|||
<PackageReference Include="SQLite" Version="3.13.0" />
|
||||
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.115.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="MoveToBinFolderDebug" AfterTargets="FinalCleanup;PostBuildEvent">
|
||||
<ItemGroup>
|
||||
<MoveBinariesForDebug Include="$(TargetDir)*" Exclude="$(TargetDir)TShock.Run*;$(TargetDir)TShock*" />
|
||||
<TShockPluginFiles Include="$(ProjectDir)../TShockAPI/bin/$(Configuration)/$(TargetFramework)/TShockAPI*" />
|
||||
</ItemGroup>
|
||||
<Move SourceFiles="@(MoveBinariesForDebug)" DestinationFolder="$(TargetDir)bin" ContinueOnError="true" />
|
||||
<Copy SourceFiles="@(TShockPluginFiles)" DestinationFolder="$(TargetDir)ServerPlugins" ContinueOnError="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="MoveToBinFolderPublish" AfterTargets="Publish">
|
||||
<Target Name="MoveTShockDebug" AfterTargets="FinalCleanup;PostBuildEvent">
|
||||
<ItemGroup>
|
||||
<MoveBinariesForPublish Include="$(PublishDir)*" Exclude="$(PublishDir)\TShock.exe;$(PublishDir)\TShockAPI*" />
|
||||
<TShockPluginFilesForPublish Include="$(ProjectDir)../TShockAPI/bin/$(Configuration)/$(TargetFramework)/TShockAPI*" />
|
||||
<TShockPluginFilesDebug Include="$(TargetDir)/TShockAPI*" />
|
||||
</ItemGroup>
|
||||
<Move SourceFiles="@(MoveBinariesForPublish)" DestinationFolder="$(PublishDir)bin" ContinueOnError="true" />
|
||||
<Copy SourceFiles="@(TShockPluginFilesForPublish)" DestinationFolder="$(PublishDir)ServerPlugins" ContinueOnError="true" />
|
||||
<Move SourceFiles="@(TShockPluginFilesDebug)" DestinationFolder="$(TargetDir)ServerPlugins" ContinueOnError="true" />
|
||||
</Target>
|
||||
<Target Name="MoveTShockPublish" AfterTargets="Publish">
|
||||
<ItemGroup>
|
||||
<TShockPluginFilesPublish Include="$(PublishDir)/TShockAPI*" />
|
||||
<TShockPluginFilesForPublish Include="$(ProjectDir)../TShockAPI/bin/$(Configuration)/$(TargetFramework)/TShockAPI*" Condition="'$(PublishSingleFile)' != 'true'" />
|
||||
</ItemGroup>
|
||||
<Move SourceFiles="@(TShockPluginFilesPublish)" DestinationFolder="$(PublishDir)ServerPlugins" ContinueOnError="true" />
|
||||
<Copy SourceFiles="@(TShockPluginFilesForPublish)" DestinationFolder="$(PublishDir)ServerPlugins" ContinueOnError="true" Condition="'$(PublishSingleFile)' != 'true'" />
|
||||
</Target>
|
||||
|
||||
<Target Name="MoveBin" AfterTargets="Publish">
|
||||
<ItemGroup>
|
||||
<MoveBinaries Include="$(PublishDir)*" Exclude="$(PublishDir)\TShock.exe;$(PublishDir)\TShockAPI*" />
|
||||
</ItemGroup>
|
||||
<Move SourceFiles="@(MoveBinaries)" DestinationFolder="$(PublishDir)bin" ContinueOnError="true" />
|
||||
</Target>
|
||||
|
||||
<UsingTask TaskName="PatchAppHost" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
|
||||
|
|
@ -83,9 +87,8 @@
|
|||
<PatchAppHost HostExe="$(PublishDir)TShock.exe" />
|
||||
<Message Text="Patched TShock.exe host for ./bin redirect" Importance="High" />
|
||||
</Target>
|
||||
|
||||
<Target Name="CreateOsxLauncherAfterPublish" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)' == 'osx-x64' Or '$(RuntimeIdentifier)' == 'ubuntu.16.04-x64' Or '$(RuntimeIdentifier)' == 'linux-arm64'">
|
||||
<Target Name="CreateScriptAfterPublish" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)' != 'win-x64'">
|
||||
<Copy SourceFiles="$(ProjectDir)TShock.sh" DestinationFolder="$(PublishDir)" />
|
||||
<!-- <Message Text="Run the launcher with chmod u+x TShock.exe && ./TShock.exe" Importance="High" /> -->
|
||||
<Message Text="Run the launcher with chmod +x TShock.sh && ./TShock.sh" Importance="High" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue