Skip to content

Commit

Permalink
Test use with _ImplicitDefineConstant
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Mar 27, 2024
1 parent e37443b commit 1b23cfe
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
10 changes: 0 additions & 10 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@
"type": "boolean",
"description": "Shows the execution plan (HTML)"
},
"PreReleaseFilter": {
"type": "array",
"items": {
"type": "string"
}
},
"Profile": {
"type": "array",
"description": "Defines the profiles to load",
Expand Down Expand Up @@ -106,10 +100,8 @@
"Clean",
"Compile",
"CopyNupkg",
"GitPreRelease",
"GitRelease",
"Pack",
"PrePack",
"Release",
"Sign",
"Test"
Expand All @@ -130,10 +122,8 @@
"Clean",
"Compile",
"CopyNupkg",
"GitPreRelease",
"GitRelease",
"Pack",
"PrePack",
"Release",
"Sign",
"Test"
Expand Down
2 changes: 1 addition & 1 deletion Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using ricaun.Nuke;
using ricaun.Nuke.Components;

class Build : NukeBuild, IPublishPack, IPrePack, ICopyNupkg
class Build : NukeBuild, IPublishPack, ICopyNupkg//, IPrePack
{
bool IPack.UnlistNuget => true;
public static int Main() => Execute<Build>(x => x.From<IPublishPack>().Build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<RevitVersion>2024</RevitVersion>
<RevitVersion>2021</RevitVersion>
<DefineConstants>TEST</DefineConstants>
</PropertyGroup>

Expand Down
7 changes: 7 additions & 0 deletions RevitVersion.DefineConstants.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ namespace RevitVersion.DefineConstants.Tests
{
public class Tests
{
#if REVIT_TEST
[Test]
public void Test()
{
Assert.Pass();
}
#endif
#if REVIT2025
[Test]
public void Test2025()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<PropertyGroup>
<PackageId>RevitVersion.DefineConstants</PackageId>
<Version>1.0.0-beta.2</Version>
<Version>1.0.0-beta.4</Version>
<ProjectGuid>{92328A76-ABD3-4197-AB06-19741F2F4566}</ProjectGuid>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
<Project>

<!-- Revit DefineConstants. -->
<Import Project="RevitVersionConstants.targets"/>
<!--<Import Project="RevitVersionConstants.targets"/>-->

<ItemGroup>
<SupportedRevitVersion Include="2017" DisplayName="2017" Alias="2017" />
<SupportedRevitVersion Include="2018" DisplayName="2018" Alias="2018" />
<SupportedRevitVersion Include="2019" DisplayName="2019" Alias="2019" />
<SupportedRevitVersion Include="2020" DisplayName="2020" Alias="2020" />
<SupportedRevitVersion Include="2021" DisplayName="2021" Alias="2021" />
<SupportedRevitVersion Include="R2022" DisplayName="2022" Alias="2022" />
<SupportedRevitVersion Include="R2023" DisplayName="2023" Alias="2023" />
<SupportedRevitVersion Include="R2024" DisplayName="2024" Alias="2024" />
<SupportedRevitVersion Include="R2025" DisplayName="2025" Alias="2025" />
</ItemGroup>

<!-- Add RevitVerison and OR_GREATER defines -->
<Target Name="GenerateRevitVersionDefineConstants" AfterTargets="PrepareForBuild">

<ItemGroup>
<_SupportedRevitVersions Include="@(SupportedRevitVersion->'%(Identity)'->TrimStart('REVIT'))" />
<_CompatibleFrameworkVersions Include="@(_SupportedRevitVersions)" Condition=" %(Identity) != '' and $([MSBuild]::VersionLessThanOrEquals(%(Identity), $(RevitVersion))) " />

<_ImplicitDefineConstant Include="REVIT_TEST" />
<_ImplicitDefineConstant Include="REVIT$(RevitVersion)" />
<_ImplicitDefineConstant Include="@(_CompatibleFrameworkVersions->'REVIT%(Identity)_OR_GREATER'->Replace('.', '_'))" />
</ItemGroup>
</Target>

</Project>

0 comments on commit 1b23cfe

Please sign in to comment.