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 To 1.1.1
  • Loading branch information
ricaun authored Feb 23, 2022
2 parents 1f4e1d0 + 31f9aab commit c8a1c93
Show file tree
Hide file tree
Showing 11 changed files with 373 additions and 67 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ 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.1] / 2022-02-23
### New Features
- Compile Multiple Examples with EndWith `Name`
### Bug Fixes
- Fix Error When Read AssemblyAttribute
### Changed
- Add XmlnsDefinition on Example to Force Error with AssemblyAttribute
- Remove AssemblyAttribute
- Add RevitAddin Example
- Add Multiple Example Compile

## [1.1.0] / 2022-02-15
- Add GitVersion.CommandLine
- Remove PackageDownload GitVersion.Tool
Expand Down Expand Up @@ -129,6 +140,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[1.1.1]: ../../compare/1.1.0...1.1.1
[1.1.0]: ../../compare/1.0.2...1.1.0
[1.0.2]: ../../compare/1.0.1...1.0.2
[1.0.1]: ../../compare/1.0.0...1.0.1
[1.0.0]: ../../compare/0.0.16...1.0.0
Expand Down
5 changes: 5 additions & 0 deletions ricaun.Nuke.RevitAddin.Example/Proprieties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using System;
using System.Windows.Markup;

[assembly: XmlnsDefinition("http://ricaun.com/example", "ricaun.Example")]
[assembly: XmlnsPrefix("http://ricaun.com/example", "r")]
19 changes: 19 additions & 0 deletions ricaun.Nuke.RevitAddin.Example/Revit/App.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;

namespace ricaun.Nuke.RevitAddin.Example.Revit
{
public class App : IExternalApplication
{
public Result OnStartup(UIControlledApplication application)
{
return Result.Succeeded;
}

public Result OnShutdown(UIControlledApplication application)
{
return Result.Succeeded;
}
}
}
21 changes: 21 additions & 0 deletions ricaun.Nuke.RevitAddin.Example/Revit/Commands/Command.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System.Xaml;
using System;

namespace ricaun.Nuke.RevitAddin.Example.Revit.Commands
{
[Transaction(TransactionMode.Manual)]
public class Command : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
{
UIApplication uiapp = commandData.Application;

_ = typeof(AmbientPropertyValue).Assembly;

return Result.Succeeded;
}
}
}
127 changes: 127 additions & 0 deletions ricaun.Nuke.RevitAddin.Example/ricaun.Nuke.RevitAddin.Example.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<UseWPF>true</UseWPF>
<LangVersion>9</LangVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<Configurations>Debug; Release</Configurations>
</PropertyGroup>

<!-- RevitVersion -->
<Choose>
<When Condition="$(Configuration.Contains('2017'))">
<PropertyGroup>
<RevitVersion>2017</RevitVersion>
<TargetFramework>net46</TargetFramework>
</PropertyGroup>
</When>
<When Condition="$(Configuration.Contains('2018'))">
<PropertyGroup>
<RevitVersion>2018</RevitVersion>
<TargetFramework>net46</TargetFramework>
</PropertyGroup>
</When>
<When Condition="$(Configuration.Contains('2019'))">
<PropertyGroup>
<RevitVersion>2019</RevitVersion>
<TargetFramework>net47</TargetFramework>
</PropertyGroup>
</When>
<When Condition="$(Configuration.Contains('2020'))">
<PropertyGroup>
<RevitVersion>2020</RevitVersion>
<TargetFramework>net47</TargetFramework>
</PropertyGroup>
</When>
<When Condition="$(Configuration.Contains('2021'))">
<PropertyGroup>
<RevitVersion>2021</RevitVersion>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
</When>
<When Condition="$(Configuration.Contains('2022'))">
<PropertyGroup>
<RevitVersion>2022</RevitVersion>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<RevitVersion>2017</RevitVersion>
<TargetFramework>net46</TargetFramework>
</PropertyGroup>
</Otherwise>
</Choose>

<!-- Release -->
<PropertyGroup Condition="!$(Configuration.Contains('Debug'))">
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(RevitVersion)</OutputPath>
<DefineConstants>Revit$(RevitVersion)</DefineConstants>
<NoWarn>MSB3052</NoWarn>
<DebugType>None</DebugType>
</PropertyGroup>

<!-- Debug -->
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;Revit$(RevitVersion)</DefineConstants>
<DebugType>Full</DebugType>
</PropertyGroup>

<PropertyGroup>
<PackageId>ricaun.Nuke.RevitAddin.Example</PackageId>
<Version>1.0.0</Version>
<ProjectGuid>{a030741a-2fd6-48c3-9f92-3ab9f35dd17a}</ProjectGuid>
</PropertyGroup>

<PropertyGroup>
<PackageAssemblyVersion></PackageAssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<Revision>$([System.DateTime]::Now.ToString('ffff'))</Revision>
<PackageAssemblyVersion>.Dev.$(Version).$(Revision)</PackageAssemblyVersion>
</PropertyGroup>

<PropertyGroup>
<Company>ricaun</Company>
<Authors>Luiz Henrique Cassettari</Authors>
<Description>Revit Add-In Description for $(PackageId).</Description>
<CopyrightYears>$([System.DateTime]::Now.ToString('yyyy'))</CopyrightYears>
</PropertyGroup>

<PropertyGroup>
<AssemblyName>$(PackageId)$(PackageAssemblyVersion)</AssemblyName>
<Product>$(PackageId)</Product>
<Copyright>Copyright © $(CopyrightYears) $(Company)</Copyright>
</PropertyGroup>

<ItemGroup>
<None Include="Revit\App.cs" />
<None Include="Revit\Commands\Command.cs" />
</ItemGroup>

<!-- Fody -->
<ItemGroup>
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" IncludeAssets="compile; build" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
<WeaverConfiguration >
<Weavers>
<PropertyChanged/>
</Weavers>
</WeaverConfiguration>
</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" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions ricaun.Nuke.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project", "Project", "{4EED
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ricaun.Nuke.Example", "ricaun.Nuke.Examples\ricaun.Nuke.Example.csproj", "{027171E5-2FB6-4A4C-A8DE-F3E148B47FFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ricaun.Nuke.RevitAddin.Example", "ricaun.Nuke.RevitAddin.Example\ricaun.Nuke.RevitAddin.Example.csproj", "{A030741A-2FD6-48C3-9F92-3AB9F35DD17A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -29,6 +31,10 @@ Global
{BA6C8C29-3519-49C7-9C66-334A7FA69ED6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{027171E5-2FB6-4A4C-A8DE-F3E148B47FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{027171E5-2FB6-4A4C-A8DE-F3E148B47FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A030741A-2FD6-48C3-9F92-3AB9F35DD17A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A030741A-2FD6-48C3-9F92-3AB9F35DD17A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A030741A-2FD6-48C3-9F92-3AB9F35DD17A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A030741A-2FD6-48C3-9F92-3AB9F35DD17A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
23 changes: 14 additions & 9 deletions ricaun.Nuke/Components/ICompileExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@ public interface ICompileExample : IHazExample, ICompile, ISign, IRelease, IHazC
.Before(Sign)
.Executes(() =>
{
Solution.BuildProject(GetExampleProject(), (project) =>
foreach (var example in GetExampleProjects())
{
SignProject(project);
var folder = ExampleDirectory;
var fileName = project.Name;
if (ReleaseExample)
Solution.BuildProject(example, (project) =>
{
var zipFile = ReleaseDirectory / $"{fileName}.zip";
ZipExtension.CreateFromDirectory(folder, zipFile);
}
});
project.ShowInfo();

SignProject(project);
var folder = GetExampleDirectory(project);
var fileName = project.Name;
if (ReleaseExample)
{
var zipFile = ReleaseDirectory / $"{fileName}.zip";
ZipExtension.CreateFromDirectory(folder, zipFile);
}
});
}
});
}
}
14 changes: 5 additions & 9 deletions ricaun.Nuke/Components/IHazExample.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
Expand All @@ -17,10 +18,10 @@ public interface IHazExample : IHazSolution, INukeBuild
string Folder => TryGetValue(() => Folder) ?? "Release";

/// <summary>
/// Example Project Name
/// Example Project Name EndWith
/// </summary>
[Parameter]
string Name => TryGetValue(() => Name) ?? $"{Solution.Name}.Example";
string Name => TryGetValue(() => Name) ?? "Example";

/// <summary>
/// ReleaseExample (default: true)
Expand All @@ -29,15 +30,10 @@ public interface IHazExample : IHazSolution, INukeBuild
bool ReleaseExample => TryGetValue<bool?>(() => ReleaseExample) ?? true;

/// <summary>
/// ExampleDirectory
/// </summary>
AbsolutePath ExampleDirectory => GetExampleDirectory(GetExampleProject());

/// <summary>
/// GetExampleProject
/// GetExampleProjects
/// </summary>
/// <returns></returns>
public Project GetExampleProject() => Solution.GetOtherProject(Name);
public IEnumerable<Project> GetExampleProjects() => Solution.GetOtherProjects(Name);

/// <summary>
/// GetExampleDirectory
Expand Down
Loading

0 comments on commit c8a1c93

Please sign in to comment.