mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 10:08:39 +00:00
Revert "remove numeric versioning for upstream merge"
This reverts commit 3e7d8eccbc
.
This commit is contained in:
parent
3e7d8eccbc
commit
7fbe145b80
3 changed files with 26 additions and 1 deletions
|
@ -4,4 +4,5 @@ public class CustomizationConfiguration
|
||||||
{
|
{
|
||||||
public string ServerName { get; set; } = "Project Lighthouse";
|
public string ServerName { get; set; } = "Project Lighthouse";
|
||||||
public string EnvironmentName { get; set; } = "project-lighthouse";
|
public string EnvironmentName { get; set; } = "project-lighthouse";
|
||||||
|
public bool UseLessReliableNumericRevisionNumberingSystem { get; set; } = false;
|
||||||
}
|
}
|
|
@ -13,7 +13,19 @@ public static class VersionHelper
|
||||||
{
|
{
|
||||||
CommitHash = ResourceHelper.ReadManifestFile("gitVersion.txt");
|
CommitHash = ResourceHelper.ReadManifestFile("gitVersion.txt");
|
||||||
Branch = ResourceHelper.ReadManifestFile("gitBranch.txt");
|
Branch = ResourceHelper.ReadManifestFile("gitBranch.txt");
|
||||||
commitNumber = $"{CommitHash}_{Build}";
|
bool isShallowRepo = ResourceHelper.ReadManifestFile("gitIsShallowRepo.txt") == "true";
|
||||||
|
if (isShallowRepo)
|
||||||
|
{
|
||||||
|
Logger.Warn
|
||||||
|
(
|
||||||
|
"The UseLessReliavleNumericRevisionNumberingSystem option is not supported for builds made from a shallow clone." +
|
||||||
|
"Please perform a full clone if you want to use numeric revision numbers." +
|
||||||
|
"UseLessReliavleNumericRevisionNumberingSystem is now disabled.",
|
||||||
|
LogArea.Startup
|
||||||
|
);
|
||||||
|
ServerConfiguration.Instance.Customization.UseLessReliableNumericRevisionNumberingSystem = false;
|
||||||
|
}
|
||||||
|
commitNumber = ServerConfiguration.Instance.Customization.UseLessReliableNumericRevisionNumberingSystem ? ResourceHelper.ReadManifestFile("gitRevCount.txt") : $"{CommitHash}_{Build}";
|
||||||
OrdinalCommitNumber = (Branch == "main") ? $"r{commitNumber}" : $"{Branch}_r{commitNumber}";
|
OrdinalCommitNumber = (Branch == "main") ? $"r{commitNumber}" : $"{Branch}_r{commitNumber}";
|
||||||
|
|
||||||
string remotesFile = ResourceHelper.ReadManifestFile("gitRemotes.txt");
|
string remotesFile = ResourceHelper.ReadManifestFile("gitRemotes.txt");
|
||||||
|
@ -51,6 +63,8 @@ public static class VersionHelper
|
||||||
"Please make sure you are properly disclosing the source code to any users who may be using this instance.",
|
"Please make sure you are properly disclosing the source code to any users who may be using this instance.",
|
||||||
LogArea.Startup
|
LogArea.Startup
|
||||||
);
|
);
|
||||||
|
if (ServerConfiguration.Instance.Customization.UseLessReliableNumericRevisionNumberingSystem) // remove redundancy
|
||||||
|
OrdinalCommitNumber = $"{Branch}-dirty_r{commitNumber}";
|
||||||
CanCheckForUpdates = false;
|
CanCheckForUpdates = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,14 @@
|
||||||
<EmbeddedResource Include="chatCensoredList.txt">
|
<EmbeddedResource Include="chatCensoredList.txt">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<None Remove="gitRevCount.txt" />
|
||||||
|
<EmbeddedResource Include="gitRevCount.txt">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Remove="gitIsShallowRepo.txt" />
|
||||||
|
<EmbeddedResource Include="gitIsShallowRepo.txt">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -59,6 +67,8 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||||
|
<Exec Command="git rev-parse --is-shallow-repository > "$(ProjectDir)/gitIsShallowRepo.txt"" />
|
||||||
|
<Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 > "$(ProjectDir)/gitVersion.txt"" />
|
||||||
<Exec Command="git rev-list HEAD --count > "$(ProjectDir)/gitRevCount.txt"" />
|
<Exec Command="git rev-list HEAD --count > "$(ProjectDir)/gitRevCount.txt"" />
|
||||||
<Exec Command="git branch --show-current > "$(ProjectDir)/gitBranch.txt"" />
|
<Exec Command="git branch --show-current > "$(ProjectDir)/gitBranch.txt"" />
|
||||||
<Exec Command="git remote -v > "$(ProjectDir)/gitRemotes.txt"" />
|
<Exec Command="git remote -v > "$(ProjectDir)/gitRemotes.txt"" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue