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: 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.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); 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.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/RelaxVersioner/RelaxVersioner.csproj b/RelaxVersioner/RelaxVersioner.csproj index 3bcc360..b835061 100644 --- a/RelaxVersioner/RelaxVersioner.csproj +++ b/RelaxVersioner/RelaxVersioner.csproj @@ -25,7 +25,7 @@ - Minor + LatestMajor @@ -37,7 +37,7 @@ + Include="RelaxVersioner" Version="3.3.0" PrivateAssets="all" /> 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)')) 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