Skip to content

Commit

Permalink
Merge pull request #8 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Version 1.3.0
  • Loading branch information
ricaun authored Jun 4, 2024
2 parents d5ed0b6 + 9251df2 commit c9b690b
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 73 deletions.
28 changes: 28 additions & 0 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
"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"
Expand All @@ -72,6 +80,12 @@
"type": "boolean",
"description": "Shows the execution plan (HTML)"
},
"PreReleaseFilter": {
"type": "array",
"items": {
"type": "string"
}
},
"Profile": {
"type": "array",
"description": "Defines the profiles to load",
Expand All @@ -91,6 +105,9 @@
"ReleaseBundle": {
"type": "boolean"
},
"ReleaseExample": {
"type": "boolean"
},
"ReleaseFolder": {
"type": "string"
},
Expand Down Expand Up @@ -119,10 +136,14 @@
"type": "string",
"enum": [
"Build",
"BuildConsole",
"Clean",
"Compile",
"GitPreRelease",
"GitRelease",
"Pack",
"PackageBuilder",
"PrePack",
"Release",
"Sign"
]
Expand All @@ -139,15 +160,22 @@
"type": "string",
"enum": [
"Build",
"BuildConsole",
"Clean",
"Compile",
"GitPreRelease",
"GitRelease",
"Pack",
"PackageBuilder",
"PrePack",
"Release",
"Sign"
]
}
},
"UnlistNuget": {
"type": "boolean"
},
"VendorDescription": {
"type": "string"
},
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, IPublishRevit
class Build : NukeBuild, IPublishRevit, IBuildConsole, IPrePack
{
string IHazRevitPackageBuilder.ApplicationType => "DBApplication";
string IHazRevitPackageBuilder.Application => "Revit.App";
Expand Down
2 changes: 1 addition & 1 deletion Build/Build.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>.</NukeRootDirectory>
Expand Down
36 changes: 36 additions & 0 deletions Build/IBuildConsole.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.Utilities.Collections;
using ricaun.Nuke.Components;
using ricaun.Nuke.Extensions;

public interface IBuildConsole : IHazExample, IRevitPackageBuilder
{
Target BuildConsole => _ => _
.TriggeredBy(PackageBuilder)
.Before(Release)
.Executes(() =>
{
var project = Solution.GetOtherProject("DesignAutomationConsole");
var releaseDirectory = GetReleaseDirectory(MainProject);
Globbing.GlobFiles(releaseDirectory, "**/*.bundle.zip")
.ForEach(file =>
{
var resourcesDirectory = project.Directory / "Bundle";
Serilog.Log.Information($"Copy Bundle: {file} to {resourcesDirectory}");
FileSystemTasks.CopyFileToDirectory(file, resourcesDirectory, FileExistsPolicy.OverwriteIfNewer);
});
Solution.BuildProject(project, (project) =>
{
SignProject(project);
var fileName = project.Name;
var version = project.GetInformationalVersion();
var exampleDirectory = GetExampleDirectory(project);
var releaseFileName = CreateReleaseFromDirectory(exampleDirectory, fileName, version);
Serilog.Log.Information($"Release: {releaseFileName}");
});
});
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.3.0] / 2025-04-05
- Update to Revit 2025
- Build `DesignAutomationConsole`.
- Add `FrameworkName` and `Reference` in the output.
- Issue with Design Automation for Revit not selecting the right version of the addin in the bundle. #7
- Set bundle with version 2019, 2021, and 2025.

## [1.2.0] / 2024-03-02
- Add `Sleep` in milliseconds input.

Expand All @@ -19,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[1.3.0]: ../../compare/1.2.0...1.3.0
[1.2.0]: ../../compare/1.1.0...1.2.0
[1.1.0]: ../../compare/1.0.0...1.1.0
[1.0.1]: ../../compare/1.0.0...1.0.1
Expand Down
Binary file modified DesignAutomationConsole/Bundle/RevitAddin.DA.Tester.bundle.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion DesignAutomationConsole/DesignAutomationConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<None Update="Bundle\RevitAddin.DA.Tester.bundle.zip">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions DesignAutomationConsole/Models/OutputModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ public class OutputModel
public string VersionBuild { get; set; }
public DateTime TimeStart { get; set; } = DateTime.UtcNow;
public string Text { get; set; }
public string Reference { get; set; }
public string FrameworkName { get; set; }
}
}
3 changes: 3 additions & 0 deletions DesignAutomationConsole/Models/ParameterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class ParameterOptions
Description = "Output file.")]
public OutputModel Output { get; set; }

//[ParameterOutput("console.txt", DownloadFile = true)]
//public string Console { get; set; }

//[ParameterWorkItemTimeSec]
//public int TimeSec { get; set; } = 60;

Expand Down
21 changes: 16 additions & 5 deletions DesignAutomationConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public static async Task Main(string[] args)

private static async Task DA_RevitAddin_DA_Tester()
{
const string RequestUri =
"https://github.com/ricaun-io/RevitAddin.DA.Tester/releases/latest/download/RevitAddin.DA.Tester.bundle.zip";

var appName = "RevitAddin_DA_Tester";

IDesignAutomationService designAutomationService = new RevitDesignAutomationService(appName)
Expand All @@ -38,16 +35,30 @@ private static async Task DA_RevitAddin_DA_Tester()
//"2020",
//"2021",
//"2022",
"2023",
//"2023",
//"2024",
"2025",
},
EnableConsoleLogger = true,
//EnableParameterConsoleLogger = true,
EnableReportConsoleLogger = true,
RunTimeOutMinutes = 5,
};

//var revit = new RevitDesignAutomationService(appName);
//var engines = await revit.GetEnginesAsync();
//foreach ( var engine in engines )
//{
// Console.WriteLine(engine);
//}

//var status = await revit.GetWorkitemStatusAsync("id");
//Console.WriteLine(status.Status);

await designAutomationService.Initialize($".\\Bundle\\RevitAddin.DA.Tester.bundle.zip");

//const string RequestUri =
// "https://github.com/ricaun-io/RevitAddin.DA.Tester/releases/latest/download/RevitAddin.DA.Tester.bundle.zip";
//await designAutomationService.Initialize(await RequestService.Instance.GetFileAsync(RequestUri));

var engineVersions = designAutomationService.CoreEngineVersions();
Expand All @@ -61,7 +72,7 @@ private static async Task DA_RevitAddin_DA_Tester()
Input = new InputModel()
{
Text = engineVersion,
Sleep = 2000
Sleep = 1000
}
};
options.Add(option);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class OutputModel

## License

This project is [licensed](LICENSE) under the [MIT Licence](https://en.wikipedia.org/wiki/MIT_License).
This project is [licensed](LICENSE) under the [MIT License](https://en.wikipedia.org/wiki/MIT_License).

---

Expand Down
2 changes: 2 additions & 0 deletions RevitAddin.DA.Tester/Models/OutputModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class OutputModel
public string VersionBuild { get; set; }
public DateTime TimeStart { get; set; } = DateTime.UtcNow;
public string Text { get; set; }
public string Reference { get; set; }
public string FrameworkName { get; set; }

#region JsonConvert
private const string JSON_FILE = "output.json";
Expand Down
49 changes: 19 additions & 30 deletions RevitAddin.DA.Tester/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions RevitAddin.DA.Tester/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public ExternalDBApplicationResult OnStartup(ControlledApplication application)
Console.WriteLine("----------------------------------------");
Console.WriteLine(this.GetType().Assembly.FullName);
Console.WriteLine("----------------------------------------");
Console.WriteLine(this.GetType().Assembly.Location);
Console.WriteLine("----------------------------------------");

DesignAutomationBridge.DesignAutomationReadyEvent += DesignAutomationBridge_DesignAutomationReadyEvent;
return ExternalDBApplicationResult.Succeeded;
Expand Down
Loading

0 comments on commit c9b690b

Please sign in to comment.