Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
kekyo committed May 28, 2024
2 parents 25739ac + 0b25897 commit 99000c5
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 14 deletions.
3 changes: 3 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ nuspecファイルを使ってパッケージを生成する場合は、デフ

## 履歴

* 3.4.0:
* Gitサブモジュール内にプロジェクトが配置されている場合に正しい情報を取得できない問題を修正。
* GitReaderを1.8.0に上げました。
* 3.3.0:
* .NET 8.0 SDKに対応しました。
* GitReaderを1.7.0に上げました。
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion RelaxVersioner.Core.Tests/AnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}
6 changes: 3 additions & 3 deletions RelaxVersioner.Core.Tests/RelaxVersioner.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<Nullable>enable</Nullable>
<TargetFrameworks>net48;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net7.0;net8.0</TargetFrameworks>
<NoWarn>$(NoWarn);NU5104</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Verify.NUnit" Version="19.13.0" />
<PackageReference Include="Verify.NUnit" Version="24.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions RelaxVersioner.Core/RelaxVersioner.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GitReader" Version="1.7.0" />
<PackageReference Include="GitReader" Version="1.8.0" />
<PackageReference Include="NamingFormatter" Version="2.3.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Condition="'$(RV_BOOTSTRAP)' != 'True'"
Include="RelaxVersioner" Version="3.2.60" PrivateAssets="all" />
Include="RelaxVersioner" Version="3.3.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion RelaxVersioner.Core/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public static async Task<StructuredRepository> 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);
Expand Down
2 changes: 1 addition & 1 deletion RelaxVersioner.Tasks/RelaxVersioner.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Condition="'$(RV_BOOTSTRAP)' != 'True'"
Include="RelaxVersioner" Version="3.2.60" PrivateAssets="all" />
Include="RelaxVersioner" Version="3.3.0" PrivateAssets="all" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions RelaxVersioner.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions RelaxVersioner/RelaxVersioner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</PropertyGroup>

<PropertyGroup Condition="('$(TargetFramework)' == 'netcoreapp3.1') OR ('$(TargetFramework)' == 'net5.0') OR ('$(TargetFramework)' == 'net6.0') OR ('$(TargetFramework)' == 'net7.0') OR ('$(TargetFramework)' == 'net8.0')">
<RollForward>Minor</RollForward>
<RollForward>LatestMajor</RollForward>
</PropertyGroup>

<ItemGroup>
Expand All @@ -37,7 +37,7 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Condition="'$(RV_BOOTSTRAP)' != 'True'"
Include="RelaxVersioner" Version="3.2.60" PrivateAssets="all" />
Include="RelaxVersioner" Version="3.3.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
28 changes: 27 additions & 1 deletion RelaxVersioner/build/RelaxVersioner.props
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,31 @@
</Code>
</Task>
</UsingTask>


<UsingTask
TaskName="_RVB_CandidateToolingDir"
TaskFactory="$(_RVB_TaskFactory)"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
<ParameterGroup>
<ToolingDir ParameterType="Microsoft.Build.Framework.ITaskItem" Required="true" />
<CandidateDir Output="true" />
</ParameterGroup>
<Task>
<Using Namespace="System"/>
<Using Namespace="System.IO"/>
<Using Namespace="Microsoft.Build.Framework"/>
<Code Type="Fragment" Language="cs">
<![CDATA[
string path = Path.GetFullPath(ToolingDir.ItemSpec);
if (!Directory.Exists(path))
{
string basePath = Path.GetDirectoryName(path);
path = Path.Combine(basePath, "net8.0");
}
CandidateDir = path;
]]>
</Code>
</Task>
</UsingTask>

</Project>
13 changes: 11 additions & 2 deletions RelaxVersioner/build/RelaxVersioner.targets
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
</Target>

<Target Name="RelaxVersionerPrepare">

<_RVB_CandidateToolingDir ToolingDir="$(_RVB_ToolingDir)">
<Output TaskParameter="CandidateDir" PropertyName="_RVB_ToolingCandidateDir" />
</_RVB_CandidateToolingDir>

<!-- For F# -->
<PropertyGroup Condition="'$(Language)' == 'F#'">
<!-- HACK: https://github.com/fsharp/fsharp/issues/289 -->
Expand Down Expand Up @@ -110,7 +115,7 @@

<PropertyGroup>
<RelaxVersionerToolingRuntimeName Condition="'$(RelaxVersionerToolingRuntimeName)' == ''">$(_RVB_RuntimeName)</RelaxVersionerToolingRuntimeName>
<RelaxVersionerToolingDir Condition="'$(RelaxVersionerToolingDir)' == ''">$([System.IO.Path]::GetFullPath('$(_RVB_ToolingDir)'))</RelaxVersionerToolingDir>
<RelaxVersionerToolingDir Condition="'$(RelaxVersionerToolingDir)' == ''">$(_RVB_ToolingCandidateDir)</RelaxVersionerToolingDir>
<RelaxVersionerToolingPath Condition="'$(RelaxVersionerToolingPath)' == ''">$([System.IO.Path]::Combine('$(RelaxVersionerToolingDir)','$(_RVB_ExecutableName)'))</RelaxVersionerToolingPath>
</PropertyGroup>

Expand Down Expand Up @@ -282,9 +287,13 @@

<Target Name="RelaxVersionerPackPrepare">

<_RVB_CandidateToolingDir ToolingDir="$(_RVB_ToolingDir)">
<Output TaskParameter="CandidateDir" PropertyName="_RVB_ToolingCandidateDir" />
</_RVB_CandidateToolingDir>

<PropertyGroup>
<RelaxVersionerToolingRuntimeName Condition="'$(RelaxVersionerToolingRuntimeName)' == ''">$(_RVB_RuntimeName)</RelaxVersionerToolingRuntimeName>
<RelaxVersionerToolingDir Condition="'$(RelaxVersionerToolingDir)' == ''">$([System.IO.Path]::GetFullPath('$(_RVB_ToolingDir)'))</RelaxVersionerToolingDir>
<RelaxVersionerToolingDir Condition="'$(RelaxVersionerToolingDir)' == ''">$(_RVB_ToolingCandidateDir)</RelaxVersionerToolingDir>
<RelaxVersionerToolingPath Condition="'$(RelaxVersionerToolingPath)' == ''">$([System.IO.Path]::Combine('$(RelaxVersionerToolingDir)','$(_RVB_ExecutableName)'))</RelaxVersionerToolingPath>

<RelaxVersionerOutputDir Condition="'$(RelaxVersionerOutputDir)' == ''">$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)','$(NuspecOutputPath)'))</RelaxVersionerOutputDir>
Expand Down
25 changes: 25 additions & 0 deletions build-nupkg-bootstrap.sh
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions build-nupkg.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 99000c5

Please sign in to comment.