Skip to content

Commit

Permalink
Supported dotnet future release versions (maybe).
Browse files Browse the repository at this point in the history
  • Loading branch information
kekyo committed May 28, 2024
1 parent 71572e7 commit d0edbb4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 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 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

0 comments on commit d0edbb4

Please sign in to comment.