From 726863892e368f9c491e8366bc8ec8bd42078511 Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Thu, 10 Mar 2022 09:17:43 -0300 Subject: [PATCH 1/2] Update to 1.1.4 - Add ProjectNameFolder Option - Add ProjectVersionFolder Option - Clear Example Project --- Build/Build.cs | 2 ++ CHANGELOG.md | 6 ++++++ RevitAddin.PackageBuilder.Example/Revit/App.cs | 2 +- .../RevitAddin.PackageBuilder.Example.csproj | 5 ++--- .../Components/IHazPackageBuilderProject.cs | 12 ++++++++++++ .../Components/Revit/IRevitPackageBuilder.cs | 6 ++++++ .../ricaun.Nuke.PackageBuilder.csproj | 2 +- 7 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index d965366..1ea8f59 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -10,6 +10,8 @@ class Build : NukeBuild, IPublishPack, ICompileExample, IRevitPackageBuilder string IHazPackageBuilderProject.Name => RevitProjectName; bool IHazPackageBuilderProject.ReleasePackageBuilder => true; bool IHazPackageBuilderProject.ReleaseBundle => true; + bool IHazPackageBuilderProject.ProjectVersionFolder => true; + bool IHazPackageBuilderProject.ProjectNameFolder => true; string IHazRevitPackageBuilder.Application => "Revit.App"; bool IHazRevitPackageBuilder.NewVersions => true; string IHazExample.Name => RevitProjectName; diff --git a/CHANGELOG.md b/CHANGELOG.md index 2df0cdc..bc1d133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ 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.1.4] / 2022-03-09 +- Add ProjectNameFolder Option +- Add ProjectVersionFolder Option +- Clear Example Project + ## [1.1.3] / 2022-03-08 - Add ReleaseBundle Option @@ -108,6 +113,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - First Release [vNext]: ../../compare/1.0.0...HEAD +[1.1.4]: ../../compare/1.1.3...1.1.4 [1.1.3]: ../../compare/1.1.2...1.1.3 [1.1.2]: ../../compare/1.1.1...1.1.2 [1.1.1]: ../../compare/1.1.0...1.1.1 diff --git a/RevitAddin.PackageBuilder.Example/Revit/App.cs b/RevitAddin.PackageBuilder.Example/Revit/App.cs index b9e2fe0..7ecc260 100644 --- a/RevitAddin.PackageBuilder.Example/Revit/App.cs +++ b/RevitAddin.PackageBuilder.Example/Revit/App.cs @@ -11,7 +11,7 @@ public class App : IExternalApplication private static RibbonPanel ribbonPanel; public Result OnStartup(UIControlledApplication application) { - ribbonPanel = application.CreatePanel(""); + ribbonPanel = application.CreatePanel("-"); ribbonPanel.AddPushButton("-"); return Result.Succeeded; } diff --git a/RevitAddin.PackageBuilder.Example/RevitAddin.PackageBuilder.Example.csproj b/RevitAddin.PackageBuilder.Example/RevitAddin.PackageBuilder.Example.csproj index 73d65d1..b33f6d7 100644 --- a/RevitAddin.PackageBuilder.Example/RevitAddin.PackageBuilder.Example.csproj +++ b/RevitAddin.PackageBuilder.Example/RevitAddin.PackageBuilder.Example.csproj @@ -77,12 +77,12 @@ RevitAddin.PackageBuilder.Example - $(RevitVersion).1.3 + 1.1.4 {d2797a34-4696-490d-a97a-c17afb5f0225} - .$(Version) + $([System.DateTime]::Now.ToString('ffff')) @@ -121,7 +121,6 @@ - diff --git a/ricaun.Nuke.PackageBuilder/Components/IHazPackageBuilderProject.cs b/ricaun.Nuke.PackageBuilder/Components/IHazPackageBuilderProject.cs index 80da0d6..847f6c4 100644 --- a/ricaun.Nuke.PackageBuilder/Components/IHazPackageBuilderProject.cs +++ b/ricaun.Nuke.PackageBuilder/Components/IHazPackageBuilderProject.cs @@ -28,6 +28,18 @@ public interface IHazPackageBuilderProject : IHazMainProject, IHazSolution, INuk [Parameter] bool ReleaseBundle => TryGetValue(() => ReleaseBundle) ?? false; + /// + /// Add ProjectNameFolder on the Contents (default: false) + /// + [Parameter] + bool ProjectNameFolder => TryGetValue(() => ProjectNameFolder) ?? false; + + /// + /// Add ProjectVersionFolder on the Contents (default: false) + /// + [Parameter] + bool ProjectVersionFolder => TryGetValue(() => ProjectVersionFolder) ?? false; + /// /// GetPackageBuilderProject /// diff --git a/ricaun.Nuke.PackageBuilder/Components/Revit/IRevitPackageBuilder.cs b/ricaun.Nuke.PackageBuilder/Components/Revit/IRevitPackageBuilder.cs index daccc70..83521be 100644 --- a/ricaun.Nuke.PackageBuilder/Components/Revit/IRevitPackageBuilder.cs +++ b/ricaun.Nuke.PackageBuilder/Components/Revit/IRevitPackageBuilder.cs @@ -38,6 +38,12 @@ public void CreatePackageBuilder(Project project, bool releasePackageBuilder = f var BundleDirectory = PackageBuilderDirectory / bundleName; var ContentsDirectory = BundleDirectory / "Contents"; + if (ProjectNameFolder) + ContentsDirectory = ContentsDirectory / project.Name; + + if (ProjectVersionFolder) + ContentsDirectory = ContentsDirectory / project.GetInformationalVersion(); + FileSystemTasks.CopyDirectoryRecursively(InputDirectory, ContentsDirectory); var addInFiles = PathConstruction.GlobFiles(ContentsDirectory, $"**/*{project.Name}*.dll"); diff --git a/ricaun.Nuke.PackageBuilder/ricaun.Nuke.PackageBuilder.csproj b/ricaun.Nuke.PackageBuilder/ricaun.Nuke.PackageBuilder.csproj index 5e49b8e..c216294 100644 --- a/ricaun.Nuke.PackageBuilder/ricaun.Nuke.PackageBuilder.csproj +++ b/ricaun.Nuke.PackageBuilder/ricaun.Nuke.PackageBuilder.csproj @@ -7,7 +7,7 @@ ricaun.Nuke.PackageBuilder - 1.1.3 + 1.1.4 From 5acc0cfc1911c0cec405bedbf93d3a71dce0560b Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Thu, 10 Mar 2022 09:24:21 -0300 Subject: [PATCH 2/2] - Update Example Project --- CHANGELOG.md | 2 +- .../Revit/App.cs | 21 ++++++++++++++++++- .../Revit/Commands/Command.cs | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc1d133..511117c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [1.1.4] / 2022-03-09 - Add ProjectNameFolder Option - Add ProjectVersionFolder Option -- Clear Example Project +- Update Example Project ## [1.1.3] / 2022-03-08 - Add ReleaseBundle Option diff --git a/RevitAddin.PackageBuilder.Example/Revit/App.cs b/RevitAddin.PackageBuilder.Example/Revit/App.cs index 7ecc260..721439f 100644 --- a/RevitAddin.PackageBuilder.Example/Revit/App.cs +++ b/RevitAddin.PackageBuilder.Example/Revit/App.cs @@ -11,7 +11,7 @@ public class App : IExternalApplication private static RibbonPanel ribbonPanel; public Result OnStartup(UIControlledApplication application) { - ribbonPanel = application.CreatePanel("-"); + ribbonPanel = application.CreatePanel(GetRevitVersion()); ribbonPanel.AddPushButton("-"); return Result.Succeeded; } @@ -21,5 +21,24 @@ public Result OnShutdown(UIControlledApplication application) ribbonPanel?.Remove(); return Result.Succeeded; } + + public static string GetRevitVersion() + { +#if Revit2017 + return "2017"; +#elif Revit2018 + return "2018"; +#elif Revit2019 + return "2019"; +#elif Revit2020 + return "2020"; +#elif Revit2021 + return "2021"; +#elif Revit2022 + return "2022"; +#else + return "Undefined"; +#endif + } } } \ No newline at end of file diff --git a/RevitAddin.PackageBuilder.Example/Revit/Commands/Command.cs b/RevitAddin.PackageBuilder.Example/Revit/Commands/Command.cs index a047041..a79fe03 100644 --- a/RevitAddin.PackageBuilder.Example/Revit/Commands/Command.cs +++ b/RevitAddin.PackageBuilder.Example/Revit/Commands/Command.cs @@ -12,7 +12,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme { UIApplication uiapp = commandData.Application; - System.Windows.MessageBox.Show("-"); + System.Windows.MessageBox.Show(App.GetRevitVersion()); return Result.Succeeded; }