-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* check for viability * attempt 2 * make directory exist silly git * checkout * add simple test * im becoming jokerfied * correct artifact creation * Add tests using a legacy-style csproj based on RPM * nuget needs a sln file to not freak out 🙄 * I cannot type * fix "repo" root * always get that one wrong * fix for real * Unify CI workflow * delete nuget workflow
- Loading branch information
1 parent
32a9d13
commit eafb4d6
Showing
11 changed files
with
246 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This is an internal test for KSPBuildTools and not intended to be used by other projects | ||
name: Test Plugin Mod (Legacy) | ||
|
||
on: | ||
workflow_call: | ||
|
||
env: | ||
TESTDIR: tests/plugin-mod-legacy | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-ckan | ||
|
||
- uses: ./.github/actions/compile | ||
with: | ||
solution-file-path: ${{ env.TESTDIR }}/PluginModLegacy.sln | ||
ksp-zip-url: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip | ||
|
||
- uses: ./.github/actions/assemble-release | ||
with: | ||
artifacts: ${{ env.TESTDIR }}/GameData | ||
output-file-name: plugin-mod-legacy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This is an internal test for KSPBuildTools and not intended to be used by other projects | ||
name: Test Plugin Mod | ||
|
||
on: | ||
workflow_call: | ||
|
||
env: | ||
TESTDIR: tests/plugin-mod | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-ckan | ||
|
||
- uses: ./.github/actions/compile | ||
with: | ||
solution-file-path: ${{ env.TESTDIR }}/plugin-mod.csproj | ||
ksp-zip-url: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip | ||
|
||
- uses: ./.github/actions/assemble-release | ||
with: | ||
artifacts: ${{ env.TESTDIR }}/GameData | ||
output-file-name: plugin-mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
packages | ||
obj | ||
bin | ||
GameData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.0.31903.59 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plugin-mod-legacy", "PluginModLegacy\plugin-mod-legacy.csproj", "{F19C7AB4-50C2-4378-9673-CC039CA12E10}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F19C7AB4-50C2-4378-9673-CC039CA12E10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F19C7AB4-50C2-4378-9673-CC039CA12E10}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F19C7AB4-50C2-4378-9673-CC039CA12E10}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F19C7AB4-50C2-4378-9673-CC039CA12E10}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
10 changes: 10 additions & 0 deletions
10
tests/plugin-mod-legacy/PluginModLegacy/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
[assembly: AssemblyTitle ("PluginModLegacy")] | ||
[assembly: AssemblyDescription ("Test mod using a legacy csproj")] | ||
|
||
// This supposedly helps avoid plugin depencency problems. | ||
[assembly: KSPAssembly("plugin-mod-legacy", 1, 2, 3)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Krafs.Publicizer" version="1.0.3" targetFramework="net48" developmentDependency="true" /> | ||
</packages> |
77 changes: 77 additions & 0 deletions
77
tests/plugin-mod-legacy/PluginModLegacy/plugin-mod-legacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildThisFileDirectory)../packages/Krafs.Publicizer.1.0.3/build/Krafs.Publicizer.props" Condition="Exists('$(MSBuildThisFileDirectory)../packages/Krafs.Publicizer.1.0.3/build/Krafs.Publicizer.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{F19C7AB4-50C2-4378-9673-CC039CA12E10}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>JSI</RootNamespace> | ||
<AssemblyName>PluginModMono</AssemblyName> | ||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> | ||
<CodePage>65001</CodePage> | ||
<TargetFrameworkProfile /> | ||
<NuGetPackageImportStamp> | ||
</NuGetPackageImportStamp> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>portable</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<Prefer32Bit>false</Prefer32Bit> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<Prefer32Bit>false</Prefer32Bit> | ||
<DebugType>portable</DebugType> | ||
<DebugSymbols>true</DebugSymbols> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<RunPostBuildEvent>Always</RunPostBuildEvent> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Profile|AnyCPU'"> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>bin\Profile\</OutputPath> | ||
<DefineConstants>ENABLE_PROFILER</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<DebugType>portable</DebugType> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<RepoRootPath>$(MSBuildThisFileDirectory)../</RepoRootPath> | ||
<BinariesOutputRelativePath>GameData/plugin-mod-legacy</BinariesOutputRelativePath> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildExtensionsPath)/$(MSBuildToolsVersion)\Microsoft.Common.props" /> | ||
<Import Project="$(MSBuildThisFileDirectory)../../../KSPCommon.targets" /> | ||
<Import Project="$(MSBuildBinPath)/Microsoft.CSharp.targets" /> | ||
<ItemGroup> | ||
<Compile Include="Properties/AssemblyInfo.cs"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Publicize Include="Assembly-CSharp" /> | ||
</ItemGroup> | ||
<Target Name="MakeModDir" BeforeTargets="BeforeBuild"> | ||
<MakeDir Directories="$(RepoRootPath)GameData/plugin-mod-legacy" /> | ||
</Target> | ||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
<PropertyGroup> | ||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
</PropertyGroup> | ||
<Error Condition="!Exists('$(MSBuildThisFileDirectory)../packages/Krafs.Publicizer.1.0.3/build/Krafs.Publicizer.props')" Text="$([System.String]::Format('$(ErrorText)', '$(MSBuildThisFileDirectory)../packages/Krafs.Publicizer.1.0.3/build/Krafs.Publicizer.props'))" /> | ||
<Error Condition="!Exists('$(MSBuildThisFileDirectory)../packages/Krafs.Publicizer.1.0.3/build/Krafs.Publicizer.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(MSBuildThisFileDirectory)../packages/Krafs.Publicizer.1.0.3/build/Krafs.Publicizer.targets'))" /> | ||
</Target> | ||
<Import Project="$(MSBuildThisFileDirectory)../packages/Krafs.Publicizer.1.0.3/build/Krafs.Publicizer.targets" Condition="Exists('$(MSBuildThisFileDirectory)packages/Krafs.Publicizer.1.0.3/build/Krafs.Publicizer.targets')" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
obj | ||
bin | ||
GameData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="MinVer" Version="5.0.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<!-- Static Properties --> | ||
<PropertyGroup> | ||
<TargetFramework>net48</TargetFramework> | ||
<LangVersion>7.3</LangVersion> | ||
<IsPackable>false</IsPackable> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<NoWarn>1701;1702;CS0649;CS1591;</NoWarn> | ||
<AssemblyCopyright>2024 KSPModdingLibs Contributors</AssemblyCopyright> | ||
<AssemblyName>PluginMod</AssemblyName> | ||
<RepoRootPath>$(MSBuildThisFileDirectory)</RepoRootPath> | ||
<BinariesOutputRelativePath>GameData/plugin-mod</BinariesOutputRelativePath> | ||
</PropertyGroup> | ||
|
||
<!-- DLL Dependencies--> | ||
<ItemGroup> | ||
<Reference Include="0Harmony, Culture=neutral, PublicKeyToken=null"> | ||
<HintPath>$(KSPRoot)/GameData/000_Harmony/0Harmony.dll</HintPath> | ||
<CKANIdentifier>Harmony2</CKANIdentifier> | ||
<CKANVersion>2.2.1.0</CKANVersion> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
<!-- Version Files --> | ||
<ItemGroup> | ||
<KSPVersionFile Include="."> | ||
<Destination>$(RepoRootPath)$(BinariesOutputRelativePath)/plugin-mod.version</Destination> | ||
</KSPVersionFile> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<GenerateKSPAssemblyAttribute>true</GenerateKSPAssemblyAttribute> | ||
<GenerateKSPAssemblyDependencyAttributes>true</GenerateKSPAssemblyDependencyAttributes> | ||
</PropertyGroup> | ||
|
||
<Target Name="MakeModDir" BeforeTargets="BeforeBuild"> | ||
<MakeDir Directories="$(RepoRootPath)GameData/plugin-mod" /> | ||
</Target> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)../../KSPCommon.targets" /> | ||
</Project> |