Skip to content

Commit

Permalink
Merge pull request #26 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Update Version 1.1.4
  • Loading branch information
ricaun authored Mar 10, 2022
2 parents e3b9c85 + 5acc0cf commit 2e47490
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- Update Example Project

## [1.1.3] / 2022-03-08
- Add ReleaseBundle Option

Expand Down Expand Up @@ -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
Expand Down
21 changes: 20 additions & 1 deletion RevitAddin.PackageBuilder.Example/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Commands.Command>("-");
return Result.Succeeded;
}
Expand All @@ -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
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@

<PropertyGroup>
<PackageId>RevitAddin.PackageBuilder.Example</PackageId>
<Version>$(RevitVersion).1.3</Version>
<Version>1.1.4</Version>
<ProjectGuid>{d2797a34-4696-490d-a97a-c17afb5f0225}</ProjectGuid>
</PropertyGroup>

<PropertyGroup>
<PackageAssemblyVersion>.$(Version)</PackageAssemblyVersion>
<PackageAssemblyVersion></PackageAssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<Revision>$([System.DateTime]::Now.ToString('ffff'))</Revision>
Expand Down Expand Up @@ -121,7 +121,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" IncludeAssets="build; compile" PrivateAssets="All" />
<PackageReference Include="Revit_All_Main_Versions_API_x64" Version="$(RevitVersion).*" IncludeAssets="build; compile" PrivateAssets="All" />
<PackageReference Include="ricaun.Revit.UI" Version="0.0.8" />
</ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions ricaun.Nuke.PackageBuilder/Components/IHazPackageBuilderProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ public interface IHazPackageBuilderProject : IHazMainProject, IHazSolution, INuk
[Parameter]
bool ReleaseBundle => TryGetValue<bool?>(() => ReleaseBundle) ?? false;

/// <summary>
/// Add ProjectNameFolder on the Contents (default: false)
/// </summary>
[Parameter]
bool ProjectNameFolder => TryGetValue<bool?>(() => ProjectNameFolder) ?? false;

/// <summary>
/// Add ProjectVersionFolder on the Contents (default: false)
/// </summary>
[Parameter]
bool ProjectVersionFolder => TryGetValue<bool?>(() => ProjectVersionFolder) ?? false;

/// <summary>
/// GetPackageBuilderProject
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<PackageId>ricaun.Nuke.PackageBuilder</PackageId>
<Version>1.1.3</Version>
<Version>1.1.4</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 2e47490

Please sign in to comment.