Skip to content

Commit

Permalink
Update To 0.0.7
Browse files Browse the repository at this point in the history
Add Installation Files Folder
  • Loading branch information
ricaun authored Dec 17, 2021
2 parents a899fae + 2cbff50 commit a4eff01
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 36 deletions.
10 changes: 3 additions & 7 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"build": {
"type": "object",
"properties": {
"Application": {
"type": "string"
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
Expand Down Expand Up @@ -40,6 +37,9 @@
"VSCode"
]
},
"Name": {
"type": "string"
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
Expand Down Expand Up @@ -75,9 +75,7 @@
"Build",
"Clean",
"Compile",
"CompileExample",
"GitRelease",
"Pack",
"PackageBuilder",
"Release",
"Sign"
Expand All @@ -97,9 +95,7 @@
"Build",
"Clean",
"Compile",
"CompileExample",
"GitRelease",
"Pack",
"PackageBuilder",
"Release",
"Sign"
Expand Down
16 changes: 13 additions & 3 deletions Build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Nuke.Common;
using Nuke.Common.Execution;
using Nuke.Common.ProjectModel;
using ricaun.Nuke;
using ricaun.Nuke.Components;
using ricaun.Nuke.Extensions;

[CheckBuildProjectConfigurations]
class Build : NukeBuild, IPublishPack, ICompileExample, IRevitPackageBuilder
Expand All @@ -17,4 +15,16 @@ class Build : NukeBuild, IPublishPack, ICompileExample, IRevitPackageBuilder
string IHazContent.Folder => "Release";
string IHazRelease.Folder => "ReleasePack";
public static int Main() => Execute<Build>(x => x.From<IPublishPack>().Build);
}
}

/*
[CheckBuildProjectConfigurations]
class Build : NukeBuild, IPublishRevit
{
string IHazMainProject.MainName => "RevitAddin.PackageBuilder.Example";
string IHazInput.Folder => "Content";
string IHazContent.Folder => "Content";
string IHazPackageBuilder.Application => "Revit.App";
public static int Main() => Execute<Build>(x => x.From<IPublishRevit>().Build);
}
*/
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ 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).

## [0.0.7] / 2021-12-17
- Exemple Update Version
- Add icon.ico
- Copy InstallationFiles
- Add IHazInstallationFiles
- Add Icon/Image/License on IssRevitBuilder
- Remove `.addin` Example
- Set IHazMainProject on IHazPackageBuilderProject `Name`

## [0.0.6] / 2021-12-17
- Change name to `IRevitPackageBuilder`
- Test Example Release
Expand Down Expand Up @@ -37,6 +46,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: https://github.com/ricaun-io/ricaun.Nuke/compare/1.0.0...HEAD
[0.0.7]: https://github.com/ricaun-io/ricaun.Nuke/compare/0.0.6...0.0.7
[0.0.6]: https://github.com/ricaun-io/ricaun.Nuke/compare/0.0.5...0.0.6
[0.0.5]: https://github.com/ricaun-io/ricaun.Nuke/compare/0.0.4...0.0.5
[0.0.4]: https://github.com/ricaun-io/ricaun.Nuke/compare/0.0.3...0.0.4
[0.0.3]: https://github.com/ricaun-io/ricaun.Nuke/compare/0.0.2...0.0.3
Expand Down
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

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

Expand Down Expand Up @@ -106,8 +106,7 @@
<ItemGroup>
<None Include="Revit\App.cs" />
<None Include="Revit\Commands\Command.cs" />
<None Include="RevitAddin.PackageBuilder.Example.addin" />
<None Include="FodyWeavers.xml"/>
<None Include="FodyWeavers.xml" />
</ItemGroup>


Expand Down
5 changes: 2 additions & 3 deletions ricaun.Nuke.PackageBuilder/Components/IHazInput.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using Nuke.Common;
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.ValueInjection;
using ricaun.Nuke.Extensions;

namespace ricaun.Nuke.Components
{
public interface IHazInput : IHazPackageBuilderProject, IHazSolution, INukeBuild
Expand Down
30 changes: 30 additions & 0 deletions ricaun.Nuke.PackageBuilder/Components/IHazInstallationFiles.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Utilities.Collections;
using Nuke.Common.ValueInjection;

namespace ricaun.Nuke.Components
{
public interface IHazInstallationFiles : IHazPackageBuilderProject, IHazSolution, INukeBuild
{
/// <summary>
/// Folder InstallationFiles
/// </summary>
[Parameter]
string Folder => ValueInjectionUtility.TryGetValue(() => Folder) ?? "InstallationFiles";

/// <summary>
/// Project (default: <seealso cref="IHazPackageBuilderProject.GetPackageBuilderProject"/>)
/// </summary>
[Parameter]
Project Project => ValueInjectionUtility.TryGetValue(() => Project) ?? GetPackageBuilderProject();
AbsolutePath InstallationFilesDirectory => GetInstallationFilesDirectory(Project);
public AbsolutePath GetInstallationFilesDirectory(Project project) => project.Directory / Folder;
public void CopyInstallationFilesTo(AbsolutePath packageBuilderDirectory)
{
PathConstruction.GlobFiles(InstallationFilesDirectory, "*")
.ForEach(file => FileSystemTasks.CopyFileToDirectory(file, packageBuilderDirectory));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
using ricaun.Nuke.Extensions;
namespace ricaun.Nuke.Components
{
public interface IHazPackageBuilderProject : IHazSolution, INukeBuild
public interface IHazPackageBuilderProject : IHazMainProject, IHazSolution, INukeBuild
{
/// <summary>
/// PackageBuilder Project Name
/// </summary>
[Parameter]
string Name => ValueInjectionUtility.TryGetValue(() => Name) ?? Solution.Name;
string Name => ValueInjectionUtility.TryGetValue(() => Name) ?? MainName;
public Project GetPackageBuilderProject() => Solution.GetOtherProject(Name);
}
}
7 changes: 5 additions & 2 deletions ricaun.Nuke.PackageBuilder/Components/IRevitPackageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace ricaun.Nuke.Components
{
public interface IRevitPackageBuilder : IHazPackageBuilderProject, IRelease, ISign, IHazPackageBuilder, IHazInput, IHazOutput, INukeBuild
public interface IRevitPackageBuilder : IHazPackageBuilderProject, IHazInstallationFiles, IRelease, ISign, IHazPackageBuilder, IHazInput, IHazOutput, INukeBuild
{
Target PackageBuilder => _ => _
.TriggeredBy(Sign)
Expand All @@ -33,10 +33,13 @@ public void CreatePackageBuilder(Project project)
new ProjectAddInsBuilder(project, file, Application).Build(file);
});

// CopyInstallationFiles If Exists
CopyInstallationFilesTo(PackageBuilderDirectory);

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

new IssRevitBuilder(project)
new IssRevitBuilder(project, PackageBuilderDirectory)
.CreateFile(PackageBuilderDirectory);

// Deploy File
Expand Down
27 changes: 24 additions & 3 deletions ricaun.Nuke.PackageBuilder/PackageBuilder/IssRevitBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using InnoSetup.ScriptBuilder;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using ricaun.Nuke.Extensions;
using System.IO;
Expand All @@ -7,8 +8,14 @@ namespace ricaun.Nuke.Components
{
public class IssRevitBuilder : IssBuilder
{
private const string IMAGE = "image.bmp";
private const string IMAGESMALL = "imageSmall.bmp";
private const string ICON = "icon.ico";
private const string LICENSE = "License.rtf";
private const string LICENSE_BR = "License-br.rtf";

Project project;
public IssRevitBuilder(Project project)
public IssRevitBuilder(Project project, AbsolutePath packageBuilderDirectory)
{
this.project = project;
var assembly = project.GetAssemblyGreaterVersion();
Expand Down Expand Up @@ -41,6 +48,18 @@ public IssRevitBuilder(Project project)
.DisableDirPage(YesNo.Yes)
.ShowLanguageDialog(YesNo.No);

if (FileSystemTasks.FileExists(packageBuilderDirectory / ICON))
setup.SetupIconFile(ICON);

if (FileSystemTasks.FileExists(packageBuilderDirectory / IMAGE))
setup.WizardImageFile(IMAGE);

if (FileSystemTasks.FileExists(packageBuilderDirectory / IMAGESMALL))
setup.WizardSmallImageFile(IMAGESMALL);

if (FileSystemTasks.FileExists(packageBuilderDirectory / LICENSE))
setup.LicenseFile(LICENSE);

/*
setup
.SetupIconFile("icon.ico")
Expand All @@ -54,8 +73,10 @@ public IssRevitBuilder(Project project)

Languages.CreateEntry(name: "en", messagesFile: @"compiler:Default.isl");

var brLanguage =
Languages.CreateEntry(name: "br", messagesFile: @"compiler:Languages\BrazilianPortuguese.isl");
var brLanguage = Languages.CreateEntry(name: "br", messagesFile: @"compiler:Languages\BrazilianPortuguese.isl");

if (FileSystemTasks.FileExists(packageBuilderDirectory / LICENSE_BR))
brLanguage.LicenseFile(LICENSE_BR);

//brLanguage.LicenseFile("CLUF.rtf");

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>0.0.6</Version>
<Version>0.0.7</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit a4eff01

Please sign in to comment.