-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
381 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"$ref": "#/definitions/build", | ||
"title": "Build Schema", | ||
"definitions": { | ||
"build": { | ||
"type": "object", | ||
"properties": { | ||
"Continue": { | ||
"type": "boolean", | ||
"description": "Indicates to continue a previously failed build attempt" | ||
}, | ||
"Folder": { | ||
"type": "string" | ||
}, | ||
"GitHubToken": { | ||
"type": "string", | ||
"default": "Secrets must be entered via 'nuke :secrets [profile]'" | ||
}, | ||
"Help": { | ||
"type": "boolean", | ||
"description": "Shows the help text for this build assembly" | ||
}, | ||
"Host": { | ||
"type": "string", | ||
"description": "Host for execution. Default is 'automatic'", | ||
"enum": [ | ||
"AppVeyor", | ||
"AzurePipelines", | ||
"Bamboo", | ||
"Bitbucket", | ||
"Bitrise", | ||
"GitHubActions", | ||
"GitLab", | ||
"Jenkins", | ||
"Rider", | ||
"SpaceAutomation", | ||
"TeamCity", | ||
"Terminal", | ||
"TravisCI", | ||
"VisualStudio", | ||
"VSCode" | ||
] | ||
}, | ||
"MainName": { | ||
"type": "string" | ||
}, | ||
"NoLogo": { | ||
"type": "boolean", | ||
"description": "Disables displaying the NUKE logo" | ||
}, | ||
"NugetApiKey": { | ||
"type": "string", | ||
"default": "Secrets must be entered via 'nuke :secrets [profile]'" | ||
}, | ||
"NugetApiUrl": { | ||
"type": "string", | ||
"default": "Secrets must be entered via 'nuke :secrets [profile]'" | ||
}, | ||
"Partition": { | ||
"type": "string", | ||
"description": "Partition to use on CI" | ||
}, | ||
"Plan": { | ||
"type": "boolean", | ||
"description": "Shows the execution plan (HTML)" | ||
}, | ||
"PreReleaseFilter": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"Profile": { | ||
"type": "array", | ||
"description": "Defines the profiles to load", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"ReleaseFolder": { | ||
"type": "string" | ||
}, | ||
"ReleaseNameVersion": { | ||
"type": "boolean" | ||
}, | ||
"Root": { | ||
"type": "string", | ||
"description": "Root directory during build execution" | ||
}, | ||
"SignFile": { | ||
"type": "string", | ||
"default": "Secrets must be entered via 'nuke :secrets [profile]'" | ||
}, | ||
"SignPassword": { | ||
"type": "string", | ||
"default": "Secrets must be entered via 'nuke :secrets [profile]'" | ||
}, | ||
"Skip": { | ||
"type": "array", | ||
"description": "List of targets to be skipped. Empty list skips all dependencies", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"Build", | ||
"Clean", | ||
"Compile", | ||
"CopyNupkg", | ||
"GitPreRelease", | ||
"GitRelease", | ||
"Pack", | ||
"PrePack", | ||
"Release", | ||
"Sign", | ||
"Test" | ||
] | ||
} | ||
}, | ||
"Solution": { | ||
"type": "string", | ||
"description": "Path to a solution file that is automatically loaded" | ||
}, | ||
"Target": { | ||
"type": "array", | ||
"description": "List of targets to be invoked. Default is '{default_target}'", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"Build", | ||
"Clean", | ||
"Compile", | ||
"CopyNupkg", | ||
"GitPreRelease", | ||
"GitRelease", | ||
"Pack", | ||
"PrePack", | ||
"Release", | ||
"Sign", | ||
"Test" | ||
] | ||
} | ||
}, | ||
"TestBuildStopWhenFailed": { | ||
"type": "boolean" | ||
}, | ||
"TestProjectName": { | ||
"type": "string" | ||
}, | ||
"TestResults": { | ||
"type": "boolean" | ||
}, | ||
"Verbosity": { | ||
"type": "string", | ||
"description": "Logging verbosity during build execution. Default is 'Normal'", | ||
"enum": [ | ||
"Minimal", | ||
"Normal", | ||
"Quiet", | ||
"Verbose" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Nuke.Common; | ||
using Nuke.Common.IO; | ||
using Nuke.Common.Utilities.Collections; | ||
using ricaun.Nuke.Components; | ||
|
||
interface ICopyNupkg : ICompile, ITest | ||
{ | ||
Target CopyNupkg => _ => _ | ||
.TriggeredBy(Compile) | ||
.Before(Test) | ||
.Executes(() => | ||
{ | ||
var referencesDirectory = Solution.Directory / "references"; | ||
|
||
if (!referencesDirectory.DirectoryExists()) | ||
{ | ||
Serilog.Log.Warning($"Skip Not found: {referencesDirectory}"); | ||
return; | ||
} | ||
|
||
var mainProjectDirectory = GetMainProject().Directory; | ||
var packages = Globbing.GlobFiles(mainProjectDirectory, "**/*.nupkg"); | ||
|
||
packages.ForEach(file => | ||
{ | ||
Serilog.Log.Warning($"CopyFile: {file.Name} to {referencesDirectory}"); | ||
FileSystemTasks.CopyFileToDirectory(file, referencesDirectory, FileExistsPolicy.Overwrite); | ||
}); | ||
}); | ||
} |
40 changes: 40 additions & 0 deletions
40
RevitVersion.DefineConstants.Tests/RevitVersion.DefineConstants.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net46;net47;net48;net8.0-windows</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<Choose> | ||
<When Condition="$(TargetFramework.StartsWith('net46'))"> | ||
<PropertyGroup> | ||
<RevitVersion>2017</RevitVersion> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="$(TargetFramework.StartsWith('net47'))"> | ||
<PropertyGroup> | ||
<RevitVersion>2019</RevitVersion> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="$(TargetFramework.StartsWith('net48'))"> | ||
<PropertyGroup> | ||
<RevitVersion>2021</RevitVersion> | ||
</PropertyGroup> | ||
</When> | ||
<Otherwise> | ||
<PropertyGroup> | ||
<RevitVersion>2025</RevitVersion> | ||
</PropertyGroup> | ||
</Otherwise> | ||
</Choose> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NUnit" Version="3.13.3" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="RevitVersion.DefineConstants" Version="*-*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
using NUnit.Framework; | ||
|
||
namespace RevitVersion.DefineConstants.Tests | ||
{ | ||
public class Tests | ||
{ | ||
#if REVIT2025 | ||
[Test] | ||
public void Test2025() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2024 | ||
[Test] | ||
public void Test2024() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2023 | ||
[Test] | ||
public void Test2023() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2022 | ||
[Test] | ||
public void Test2022() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2021 | ||
[Test] | ||
public void Test2021() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2020 | ||
[Test] | ||
public void Test2020() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2019 | ||
[Test] | ||
public void Test2019() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2018 | ||
[Test] | ||
public void Test2018() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2017 | ||
[Test] | ||
public void Test2017() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
} | ||
|
||
public class TestsOrGreater | ||
{ | ||
#if REVIT2025_OR_GREATER | ||
[Test] | ||
public void Test2025OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2024_OR_GREATER | ||
[Test] | ||
public void Test2024OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2023_OR_GREATER | ||
[Test] | ||
public void Test2023OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2022_OR_GREATER | ||
[Test] | ||
public void Test2022OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2021_OR_GREATER | ||
[Test] | ||
public void Test2021OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2020_OR_GREATER | ||
[Test] | ||
public void Test2020OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2019_OR_GREATER | ||
[Test] | ||
public void Test2019OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2018_OR_GREATER | ||
[Test] | ||
public void Test2018OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
#if REVIT2017_OR_GREATER | ||
[Test] | ||
public void Test2017OrGreater() | ||
{ | ||
Assert.Pass(); | ||
} | ||
#endif | ||
} | ||
} |
Oops, something went wrong.