Skip to content

Commit

Permalink
Merge pull request #50 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Version 1.4.3
  • Loading branch information
ricaun authored May 8, 2023
2 parents 5a6f91b + 432f0a1 commit d80439e
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
"MainName": {
"type": "string"
},
"MiddleVersions": {
"type": "boolean"
},
"NewVersions": {
"type": "boolean"
},
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.4.3] / 2023-05-06
### Updated
- Update Readme
- Update `RevitContentsBuilder` add `MiddleVersions`

## [1.4.2] / 2023-03-30
### Updated
- Update `ricaun.Nuke` to `1.4.4`
Expand Down Expand Up @@ -224,6 +229,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[1.4.3]: ../../compare/1.4.2...1.4.3
[1.4.2]: ../../compare/1.4.1...1.4.2
[1.4.1]: ../../compare/1.4.0...1.4.1
[1.4.0]: ../../compare/1.3.5...1.4.0
Expand Down
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,47 @@ env:
InstallationFiles: ${{ secrets.INSTALLATION_FILES }}
```
## IPublishRevit
### IHazPackageBuilderProject
```C#
string IHazPackageBuilderProject.Name => "Example";
bool IHazPackageBuilderProject.ReleasePackageBuilder => true;
bool IHazPackageBuilderProject.ReleaseBundle => true;
bool IHazPackageBuilderProject.ProjectNameFolder => true;
bool IHazPackageBuilderProject.ProjectVersionFolder => true;
```

### IHazRevitPackageBuilder

```C#
string IHazRevitPackageBuilder.Application => "Revit.App";
string IHazRevitPackageBuilder.ApplicationType => "Application";
bool IHazRevitPackageBuilder.MiddleVersions => true;
bool IHazRevitPackageBuilder.NewVersions => true;
string IHazRevitPackageBuilder.VendorId => "VendorId";
string IHazRevitPackageBuilder.VendorDescription => "VendorDescription";
```

### IHazInstallationFiles

```C#
string IHazInstallationFiles.InstallationFiles => "InstallationFiles";
IssConfiguration IHazInstallationFiles.IssConfiguration => new IssConfiguration()
{
Image = "image.bmp",
ImageSmall = "imageSmall.bmp",
Icon = "icon.ico",
Licence = "License.txt",
Language = new IssLanguage() { Name = "en", MessagesFile = "compiler:Default.isl"},
IssLanguageLicences
= new[] {
new IssLanguageLicence() { Name="br", Licence = "License-br.txt", MessagesFile = @"compiler:Languages\BrazilianPortuguese.isl"}
}
};
```


## License

This package is [licensed](LICENSE) under the [MIT Licence](https://en.wikipedia.org/wiki/MIT_License).
Expand Down
2 changes: 1 addition & 1 deletion RevitAddin.PackageBuilder.Example/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace RevitAddin.PackageBuilder.Example.Revit
{
[Console]
[AppLoader]
public class App : IExternalApplication
{
private static RibbonPanel ribbonPanel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<UseWPF>true</UseWPF>
<LangVersion>9</LangVersion>
<LangVersion>Latest</LangVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<Configurations>Debug 2019;2019;Debug 2020;2020;Debug 2021;2021;Debug 2022;2022;2023</Configurations>
<Configurations>Debug 2019;2019;Debug 2020;2020;Debug 2021;2021;Debug 2022;2022;2023;2017</Configurations>
</PropertyGroup>

<!-- RevitVersion -->
Expand Down Expand Up @@ -83,7 +82,7 @@

<PropertyGroup>
<PackageId>RevitAddin.PackageBuilder.Example</PackageId>
<Version>1.4.2</Version>
<Version>1.4.3</Version>
<ProjectGuid>{d2797a34-4696-490d-a97a-c17afb5f0225}</ProjectGuid>
</PropertyGroup>

Expand Down
9 changes: 7 additions & 2 deletions ricaun.Nuke.PackageBuilder.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31911.196
# Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ricaun.Nuke.PackageBuilder", "ricaun.Nuke.PackageBuilder\ricaun.Nuke.PackageBuilder.csproj", "{BD946DCE-6BC5-4DF0-A82B-16541C2074FB}"
EndProject
Expand All @@ -17,6 +17,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RevitAddin.PackageBuilder.E
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2017|Any CPU = 2017|Any CPU
2019|Any CPU = 2019|Any CPU
2020|Any CPU = 2020|Any CPU
2021|Any CPU = 2021|Any CPU
Expand All @@ -26,6 +27,7 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BD946DCE-6BC5-4DF0-A82B-16541C2074FB}.2017|Any CPU.ActiveCfg = Release|Any CPU
{BD946DCE-6BC5-4DF0-A82B-16541C2074FB}.2019|Any CPU.ActiveCfg = Release|Any CPU
{BD946DCE-6BC5-4DF0-A82B-16541C2074FB}.2020|Any CPU.ActiveCfg = Release|Any CPU
{BD946DCE-6BC5-4DF0-A82B-16541C2074FB}.2021|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -35,13 +37,16 @@ Global
{BD946DCE-6BC5-4DF0-A82B-16541C2074FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD946DCE-6BC5-4DF0-A82B-16541C2074FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD946DCE-6BC5-4DF0-A82B-16541C2074FB}.Release|Any CPU.Build.0 = Release|Any CPU
{595F0BE9-3F26-40AA-BBEF-992BC1D377F6}.2017|Any CPU.ActiveCfg = Release|Any CPU
{595F0BE9-3F26-40AA-BBEF-992BC1D377F6}.2019|Any CPU.ActiveCfg = Release|Any CPU
{595F0BE9-3F26-40AA-BBEF-992BC1D377F6}.2020|Any CPU.ActiveCfg = Release|Any CPU
{595F0BE9-3F26-40AA-BBEF-992BC1D377F6}.2021|Any CPU.ActiveCfg = Release|Any CPU
{595F0BE9-3F26-40AA-BBEF-992BC1D377F6}.2022|Any CPU.ActiveCfg = Release|Any CPU
{595F0BE9-3F26-40AA-BBEF-992BC1D377F6}.2023|Any CPU.ActiveCfg = Release|Any CPU
{595F0BE9-3F26-40AA-BBEF-992BC1D377F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{595F0BE9-3F26-40AA-BBEF-992BC1D377F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2797A34-4696-490D-A97A-C17AFB5F0225}.2017|Any CPU.ActiveCfg = 2017|Any CPU
{D2797A34-4696-490D-A97A-C17AFB5F0225}.2017|Any CPU.Build.0 = 2017|Any CPU
{D2797A34-4696-490D-A97A-C17AFB5F0225}.2019|Any CPU.ActiveCfg = 2019|Any CPU
{D2797A34-4696-490D-A97A-C17AFB5F0225}.2019|Any CPU.Build.0 = 2019|Any CPU
{D2797A34-4696-490D-A97A-C17AFB5F0225}.2020|Any CPU.ActiveCfg = 2020|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public interface IHazRevitPackageBuilder : IHazPackageBuilderProject, INukeBuild
/// <returns></returns>
public string GetApplication() => Application;

/// <summary>
/// Add Middle Versions (default: true)
/// </summary>
[Parameter]
bool MiddleVersions => TryGetValue<bool?>(() => MiddleVersions) ?? true;

/// <summary>
/// Add New Versions (default: true)
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void CreatePackageBuilder(Project project, bool releasePackageBuilder = f
// CopyInstallationFiles If Exists
CopyInstallationFilesTo(PackageBuilderDirectory);

new RevitContentsBuilder(project, BundleDirectory, NewVersions)
new RevitContentsBuilder(project, BundleDirectory, MiddleVersions, NewVersions)
.Build(BundleDirectory / "PackageContents.xml");

new IssRevitBuilder(project, PackageBuilderDirectory, IssConfiguration)
Expand Down
4 changes: 2 additions & 2 deletions ricaun.Nuke.PackageBuilder/PackageBuilder/IssConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public class IssLanguage
public class IssLanguageLicence : IssLanguage
{
/// <summary>
/// Licence (default "License.rtf")
/// Licence (default <see cref="IssConfiguration.LICENSE"/>)
/// </summary>
public string Licence { get; set; } = "License.rtf";
public string Licence { get; set; } = IssConfiguration.LICENSE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Nuke.Common.ProjectModel;
using ricaun.Nuke.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

Expand All @@ -24,8 +25,10 @@ public class RevitContentsBuilder : PackageContentsBuilder
/// </summary>
/// <param name="project"></param>
/// <param name="bundleDirectory"></param>
/// <param name="middleVersionRevit"></param>
/// <param name="lastVersionRevit"></param>
public RevitContentsBuilder(Project project, AbsolutePath bundleDirectory, bool lastVersionRevit = false)
public RevitContentsBuilder(Project project, AbsolutePath bundleDirectory,
bool middleVersionRevit, bool lastVersionRevit)
{
var appName = project.Name;

Expand All @@ -41,15 +44,49 @@ public RevitContentsBuilder(Project project, AbsolutePath bundleDirectory, bool

var addinFiles = PathConstruction.GlobFiles(bundleDirectory, $"**/*{project.Name}*.addin");

//var lastVersion = 0;
//foreach (var addinFile in addinFiles)
// lastVersion = AddRevitComponentsByFileVersion(project, addinFile, bundleDirectory);

//if (lastVersionRevit)
// while (lastVersion <= DateTime.Now.Year + LAST_VERSION_PLUS_YEAR)
// {
// lastVersion = AddRevitComponentsByFileVersion(project, addinFiles.Last(), bundleDirectory, lastVersion + 1);
// }

var fileVersion = new Dictionary<int, AbsolutePath>();

var lastVersion = 0;
foreach (var addinFile in addinFiles)
{
lastVersion = AddRevitComponentsByFileVersion(project, addinFile, bundleDirectory);
fileVersion[lastVersion] = addinFile;
}

if (middleVersionRevit)
{
Serilog.Log.Information($"Components Middle Version");
var versions = fileVersion.Keys.ToList();
var lowVersion = versions.Min();
for (int v = versions.Min(); v < versions.Max(); v++)
{
if (versions.Contains(v))
{
lowVersion = v;
continue;
}
AddRevitComponentsByFileVersion(project, fileVersion[lowVersion], bundleDirectory, v);
}
}

if (lastVersionRevit)
{
Serilog.Log.Information($"Components Last Version");
while (lastVersion <= DateTime.Now.Year + LAST_VERSION_PLUS_YEAR)
{
lastVersion = AddRevitComponentsByFileVersion(project, addinFiles.Last(), bundleDirectory, lastVersion + 1);
}
}

}

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.4.2</Version>
<Version>1.4.3</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit d80439e

Please sign in to comment.