Skip to content

Commit

Permalink
Set up versioning and KSPAssembly attributes with KSPBuildTools
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyOThan committed Feb 20, 2025
1 parent a8040de commit 696cd4c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 44 deletions.
20 changes: 3 additions & 17 deletions SCANmechjeb/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a96b8661-cfef-40ab-8798-f701b97808c4")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.20.4.0")]
//[assembly: AssemblyFileVersion("1.20.4.0")]
//[assembly: AssemblyInformationalVersion ("v20.4")]

[assembly: KSPAssembly ("SCANmechjeb", 0, 5)]
[assembly: KSPAssemblyDependency ("SCANsat", 1, 20)]
[assembly: KSPAssemblyDependency("MechJeb2", 2, 5)]
// ideally this should get generated from KSPBuildTools
// https://github.com/KSPModdingLibs/KSPBuildTools/issues/46
[assembly: KSPAssemblyDependency ("SCANsat", 21, 0)]
5 changes: 5 additions & 0 deletions SCANmechjeb/SCANmechjeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
<AssemblyName>SCANmechjeb</AssemblyName>
<TargetFramework>net4.8</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<GenerateKSPAssemblyAttribute>true</GenerateKSPAssemblyAttribute>
<GenerateKSPAssemblyDependencyAttributes>true</GenerateKSPAssemblyDependencyAttributes>
</PropertyGroup>
<ItemGroup>
<Reference Include="MechJeb2">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(KSPRoot)\GameData\MechJeb2\Plugins\MechJeb2.dll</HintPath>
<Private>False</Private>
<CKANIdentifier>MechJeb2</CKANIdentifier>
<KSPAssemblyVersion>2.5</KSPAssemblyVersion>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
11 changes: 0 additions & 11 deletions SCANsat.Unity/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,3 @@
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//// Setting ComVisible to false makes the types in this assembly not visible
//// to COM components. If you need to access a type in this assembly from
//// COM, set the ComVisible attribute to true on that type.
//[assembly: ComVisible(false)]

//// The following GUID is for the ID of the typelib if this project is exposed to COM
//[assembly: Guid("0c523d04-a52e-48bb-85b6-d75e8b7a63b9")]

//[assembly: AssemblyVersion("1.20.4.0")]
//[assembly: AssemblyFileVersion("1.20.4.0")]
1 change: 1 addition & 0 deletions SCANsat.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="SCANsat.version.props" />
<PropertyGroup>
<BinariesOutputRelativePath>GameData/SCANsat/Plugins</BinariesOutputRelativePath>
</PropertyGroup>
Expand Down
12 changes: 9 additions & 3 deletions SCANsat.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35312.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCANsat", "SCANsat\SCANsat.csproj", "{3AE13948-477D-4375-8AB4-B45664966D9E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCANsat", "SCANsat\SCANsat.csproj", "{3AE13948-477D-4375-8AB4-B45664966D9E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCANmechjeb", "SCANmechjeb\SCANmechjeb.csproj", "{A2B942AF-3AB2-4A9F-9211-FFC47364128D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCANmechjeb", "SCANmechjeb\SCANmechjeb.csproj", "{A2B942AF-3AB2-4A9F-9211-FFC47364128D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCANsat.Unity", "SCANsat.Unity\SCANsat.Unity.csproj", "{4ED5E40D-273A-4643-9009-04C1DD02F3E2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCANsat.Unity", "SCANsat.Unity\SCANsat.Unity.csproj", "{4ED5E40D-273A-4643-9009-04C1DD02F3E2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{63914E47-3B9A-4298-BAA4-362B47D8F105}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
CHANGELOG.md = CHANGELOG.md
CONTRIBUTING.md = CONTRIBUTING.md
LICENSE.txt = LICENSE.txt
README.md = README.md
SCANsat.props = SCANsat.props
SCANsat.props.user = SCANsat.props.user
SCANsat.version.props = SCANsat.version.props
EndProjectSection
EndProject
Global
Expand Down
6 changes: 6 additions & 0 deletions SCANsat.version.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>21.0.0.0</Version>
</PropertyGroup>
</Project>
13 changes: 0 additions & 13 deletions SCANsat/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,3 @@
[assembly: AssemblyCopyright ("Danny")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

// TODO: need to figure out whether to continue with 1.20.x or 20.x or what

//[assembly: AssemblyVersion ("1.20.4.0")]
//[assembly: AssemblyFileVersion ("1.20.4.0")]
//[assembly: AssemblyInformationalVersion ("v20.4")]

[assembly: KSPAssembly ("SCANsat", 1, 20)]


4 changes: 4 additions & 0 deletions SCANsat/SCANsat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<AssemblyName>SCANsat</AssemblyName>
<TargetFramework>net4.8</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<GenerateKSPAssemblyAttribute>true</GenerateKSPAssemblyAttribute>
<GenerateKSPAssemblyDependencyAttributes>true</GenerateKSPAssemblyDependencyAttributes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="KSPBuildTools" Version="0.0.3-alpha.4" />
</ItemGroup>
Expand Down

0 comments on commit 696cd4c

Please sign in to comment.