From 71572e79f94bebee5ca795f5152def8e7fae3c77 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Tue, 28 May 2024 20:02:21 +0900 Subject: [PATCH 1/5] Fixed could not retreive any commit information when project places into submodule. --- RelaxVersioner.Core/Utilities.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RelaxVersioner.Core/Utilities.cs b/RelaxVersioner.Core/Utilities.cs index 53d2a72..34d0c13 100644 --- a/RelaxVersioner.Core/Utilities.cs +++ b/RelaxVersioner.Core/Utilities.cs @@ -81,7 +81,9 @@ public static async Task OpenRepositoryAsync( { var repository = await TraversePathToRootAsync(candidatePath, async path => { - if (Directory.Exists(Path.Combine(path, ".git"))) + var gitPath = Path.Combine(path, ".git"); + if (Directory.Exists(gitPath) || + File.Exists(gitPath)) // submodule { var r = await Repository.Factory.OpenStructureAsync(path); logger.Message(LogImportance.Low, "Repository opened, Path={0}", path); From d0edbb4dab0d3ed61e266fc016accd7592271cd1 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Tue, 28 May 2024 22:51:05 +0900 Subject: [PATCH 2/5] Supported dotnet future release versions (maybe). --- RelaxVersioner/RelaxVersioner.csproj | 2 +- RelaxVersioner/build/RelaxVersioner.props | 28 ++++++++++++++++++++- RelaxVersioner/build/RelaxVersioner.targets | 13 ++++++++-- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/RelaxVersioner/RelaxVersioner.csproj b/RelaxVersioner/RelaxVersioner.csproj index 3bcc360..1c9d823 100644 --- a/RelaxVersioner/RelaxVersioner.csproj +++ b/RelaxVersioner/RelaxVersioner.csproj @@ -25,7 +25,7 @@ - Minor + LatestMajor diff --git a/RelaxVersioner/build/RelaxVersioner.props b/RelaxVersioner/build/RelaxVersioner.props index 52ca8f8..6f6f9ac 100644 --- a/RelaxVersioner/build/RelaxVersioner.props +++ b/RelaxVersioner/build/RelaxVersioner.props @@ -99,5 +99,31 @@ - + + + + + + + + + + + + + + + + diff --git a/RelaxVersioner/build/RelaxVersioner.targets b/RelaxVersioner/build/RelaxVersioner.targets index 9d91254..d8e3920 100644 --- a/RelaxVersioner/build/RelaxVersioner.targets +++ b/RelaxVersioner/build/RelaxVersioner.targets @@ -53,6 +53,11 @@ + + <_RVB_CandidateToolingDir ToolingDir="$(_RVB_ToolingDir)"> + + + @@ -110,7 +115,7 @@ $(_RVB_RuntimeName) - $([System.IO.Path]::GetFullPath('$(_RVB_ToolingDir)')) + $(_RVB_ToolingCandidateDir) $([System.IO.Path]::Combine('$(RelaxVersionerToolingDir)','$(_RVB_ExecutableName)')) @@ -282,9 +287,13 @@ + <_RVB_CandidateToolingDir ToolingDir="$(_RVB_ToolingDir)"> + + + $(_RVB_RuntimeName) - $([System.IO.Path]::GetFullPath('$(_RVB_ToolingDir)')) + $(_RVB_ToolingCandidateDir) $([System.IO.Path]::Combine('$(RelaxVersionerToolingDir)','$(_RVB_ExecutableName)')) $([System.IO.Path]::Combine('$(MSBuildProjectDirectory)','$(NuspecOutputPath)')) From 88c40f723d9b116f134d6c7b2669f1ea55684dc5 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Tue, 28 May 2024 23:01:27 +0900 Subject: [PATCH 3/5] Added building script. --- RelaxVersioner.sln | 2 ++ build-nupkg-bootstrap.sh | 25 +++++++++++++++++++++++++ build-nupkg.sh | 17 +++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100755 build-nupkg-bootstrap.sh create mode 100755 build-nupkg.sh diff --git a/RelaxVersioner.sln b/RelaxVersioner.sln index 3e7c084..7f53647 100644 --- a/RelaxVersioner.sln +++ b/RelaxVersioner.sln @@ -18,6 +18,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.ja.md = README.ja.md README.md = README.md STARTGUIDE.md = STARTGUIDE.md + build-nupkg-bootstrap.sh = build-nupkg-bootstrap.sh + build-nupkg.sh = build-nupkg.sh EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Images", "Images", "{98ADE163-2FFB-47B0-AA7A-1A294DD7276F}" diff --git a/build-nupkg-bootstrap.sh b/build-nupkg-bootstrap.sh new file mode 100755 index 0000000..a3c5c57 --- /dev/null +++ b/build-nupkg-bootstrap.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# RelaxVersioner - Git tag/branch based, full-automatic version generator. +# Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +# +# Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 + +# This script is used by the RelaxVersioner to get over when .NET releases a new major version. +# For example .NET 8.0 release, the RelaxVersioner that uses itself will fail to build +# because it must support the `net8.0` TFM, which was not included in earlier versions. +# This script will generate a RelaxVersioner with a temporary version embedded +# and a private package so that it can build itself with the new .NET version. + +# `PackageVersion` should be set appropriately. + +echo "" +echo "===========================================================" +echo "Build RelaxVersioner (Bootstrap)" +echo "" + +# https://github.com/dotnet/msbuild/issues/1709 +export MSBUILDDISABLENODEREUSE=1 + +dotnet build -p:Configuration=Release -p:Platform="Any CPU" -p:BOOTSTRAP=True -p:PackageVersion=3.2.10 -p:RestoreNoCache=True RelaxVersioner.sln +dotnet pack -p:Configuration=Release -p:Platform="Any CPU" -p:BOOTSTRAP=True -p:PackageVersion=3.2.10 -o artifacts RelaxVersioner.sln diff --git a/build-nupkg.sh b/build-nupkg.sh new file mode 100755 index 0000000..d440db4 --- /dev/null +++ b/build-nupkg.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# RelaxVersioner - Git tag/branch based, full-automatic version generator. +# Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) +# +# Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0 + +echo "" +echo "===========================================================" +echo "Build RelaxVersioner" +echo "" + +# https://github.com/dotnet/msbuild/issues/1709 +export MSBUILDDISABLENODEREUSE=1 + +dotnet build -p:Configuration=Release -p:Platform="Any CPU" -p:RestoreNoCache=True RelaxVersioner.sln +dotnet pack -p:Configuration=Release -p:Platform="Any CPU" -o artifacts RelaxVersioner.sln From d6abfcfedbe55ea325d66ae25c3dba15805b6bfb Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Tue, 28 May 2024 23:17:29 +0900 Subject: [PATCH 4/5] Updated package. --- RelaxVersioner.Core.Tests/AnalyzerTests.cs | 2 +- RelaxVersioner.Core.Tests/RelaxVersioner.Core.Tests.csproj | 6 +++--- RelaxVersioner.Core/RelaxVersioner.Core.csproj | 4 ++-- RelaxVersioner.Tasks/RelaxVersioner.Tasks.csproj | 2 +- RelaxVersioner/RelaxVersioner.csproj | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/RelaxVersioner.Core.Tests/AnalyzerTests.cs b/RelaxVersioner.Core.Tests/AnalyzerTests.cs index c88a24f..1a4142a 100644 --- a/RelaxVersioner.Core.Tests/AnalyzerTests.cs +++ b/RelaxVersioner.Core.Tests/AnalyzerTests.cs @@ -34,6 +34,6 @@ public async Task LookupVersionLabel(string repositoryName, string expectedStrin var actual = await Analyzer.LookupVersionLabelAsync(repository.Head!, default); - Assert.AreEqual(expectedString, actual.ToString()); + Assert.That(expectedString, Is.EqualTo(actual.ToString())); } } diff --git a/RelaxVersioner.Core.Tests/RelaxVersioner.Core.Tests.csproj b/RelaxVersioner.Core.Tests/RelaxVersioner.Core.Tests.csproj index 00c6fd3..1109ae9 100644 --- a/RelaxVersioner.Core.Tests/RelaxVersioner.Core.Tests.csproj +++ b/RelaxVersioner.Core.Tests/RelaxVersioner.Core.Tests.csproj @@ -2,15 +2,15 @@ enable - net48;net5.0;net6.0;net7.0;net8.0 + net48;net6.0;net7.0;net8.0 $(NoWarn);NU5104 - + - + diff --git a/RelaxVersioner.Core/RelaxVersioner.Core.csproj b/RelaxVersioner.Core/RelaxVersioner.Core.csproj index 4b58e31..857ea93 100644 --- a/RelaxVersioner.Core/RelaxVersioner.Core.csproj +++ b/RelaxVersioner.Core/RelaxVersioner.Core.csproj @@ -12,11 +12,11 @@ - + + Include="RelaxVersioner" Version="3.3.0" PrivateAssets="all" /> diff --git a/RelaxVersioner.Tasks/RelaxVersioner.Tasks.csproj b/RelaxVersioner.Tasks/RelaxVersioner.Tasks.csproj index aa5e74e..f6c990f 100644 --- a/RelaxVersioner.Tasks/RelaxVersioner.Tasks.csproj +++ b/RelaxVersioner.Tasks/RelaxVersioner.Tasks.csproj @@ -29,7 +29,7 @@ + Include="RelaxVersioner" Version="3.3.0" PrivateAssets="all" /> diff --git a/RelaxVersioner/RelaxVersioner.csproj b/RelaxVersioner/RelaxVersioner.csproj index 1c9d823..b835061 100644 --- a/RelaxVersioner/RelaxVersioner.csproj +++ b/RelaxVersioner/RelaxVersioner.csproj @@ -37,7 +37,7 @@ + Include="RelaxVersioner" Version="3.3.0" PrivateAssets="all" /> From 0b25897cee5d9c24980162ca94c41cb6d95ae0e4 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Tue, 28 May 2024 23:31:17 +0900 Subject: [PATCH 5/5] Updated readme. --- README.ja.md | 3 +++ README.md | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.ja.md b/README.ja.md index 4b07560..4e77ecc 100644 --- a/README.ja.md +++ b/README.ja.md @@ -460,6 +460,9 @@ nuspecファイルを使ってパッケージを生成する場合は、デフ ## 履歴 +* 3.4.0: + * Gitサブモジュール内にプロジェクトが配置されている場合に正しい情報を取得できない問題を修正。 + * GitReaderを1.8.0に上げました。 * 3.3.0: * .NET 8.0 SDKに対応しました。 * GitReaderを1.7.0に上げました。 diff --git a/README.md b/README.md index f8983b7..c3f202a 100644 --- a/README.md +++ b/README.md @@ -439,7 +439,10 @@ When you are using a nuspec file to generate a NuGet package, there are addition ## History -* 3.3.0:. +* 3.4.0: + * Fixed a problem with getting correct information when a project is placed inside a Git submodule. + * Updated GitReader to 1.8.0. +* 3.3.0: * Added support for .NET 8.0 SDK. * Updated GitReader to 1.7.0. * 3.2.60: