Skip to content

Commit

Permalink
Merge pull request #4 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Version 0.4.0
  • Loading branch information
ricaun authored Jan 31, 2023
2 parents fed736e + c966915 commit 1ddd049
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 74 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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.4.0] / 2023-01-31
### Features
- `ricaun.Revit.Github` without Revit Reference.
- Change to .NET Framework 4.5
- Force dependence in `Newtonsoft.Json`
- Improve `Initialize` documentation

## [0.3.0] / 2023-01-31
### Features
- [x] Add `Directory.Build.props` one file change all the versions with `Condition`
Expand Down Expand Up @@ -43,6 +50,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Add Example

[vNext]: ../../compare/1.0.0...HEAD
[0.4.0]: ../../compare/0.3.0...0.4.0
[0.3.0]: ../../compare/0.2.0...0.3.0
[0.2.0]: ../../compare/0.1.0...0.2.0
[0.1.0]: ../../compare/0.1.0
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>0.3.0</Version>
<Version>0.4.0</Version>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme

Task.Run(async () =>
{
var result = await request.Initialize((text) => { InfoCenterUtils.ShowBalloon(text); });
var result = await request.Initialize((text) => { Console.WriteLine(text); });
InfoCenterUtils.ShowBalloon($"Download: {result}");
});

Expand Down
18 changes: 9 additions & 9 deletions ricaun.Revit.Github/GithubRequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ private Data.BundleModel GetDownloadFile(string folder)
}

/// <summary>
/// Initialize
/// Initialize and download the latest version if it is greater than the current version
/// </summary>
/// <param name="action"></param>
/// <returns></returns>
public Task<bool> Initialize(Action<string> action = null)
/// <param name="callback"></param>
/// <returns>Is downloaded a new version</returns>
public Task<bool> Initialize(Action<string> callback = null)
{
var task = Task.Run(async () =>
{
var bundleModels = await githubBundleService.GetBundleModelsAsync();
action?.Invoke($"Bundles: [{string.Join(" , ", bundleModels)}]");
callback?.Invoke($"Bundles: [{string.Join(" , ", bundleModels)}]");

bundleModels = bundleModels
.Where(e => githubBundleService.IsVersionModel(e, pathBundleService.GetAssembly()));
Expand All @@ -76,16 +76,16 @@ public Task<bool> Initialize(Action<string> action = null)

var bundleModelLatest = bundleModels.FirstOrDefault();

action?.Invoke($"Download: {bundleModelLatest}");
callback?.Invoke($"Download: {bundleModelLatest}");

var result = false;
if (pathBundleService.TryGetPath(out string folder))
{
action?.Invoke($"Download: {bundleModelLatest.DownloadUrl}");
callback?.Invoke($"Download: {bundleModelLatest.DownloadUrl}");
result = await downloadBundleService.DownloadBundleAsync(folder, bundleModelLatest.DownloadUrl);
action?.Invoke($"Download: {folder}");
callback?.Invoke($"Download: {folder}");
}
action?.Invoke($"Download: {result}");
callback?.Invoke($"Download: {result}");
return result;
});

Expand Down
67 changes: 4 additions & 63 deletions ricaun.Revit.Github/ricaun.Revit.Github.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<UseWPF>true</UseWPF>
Expand All @@ -11,63 +12,11 @@
<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>
<When Condition="$(Configuration.Contains('2023'))">
<PropertyGroup>
<RevitVersion>2023</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\</OutputPath>
<DefineConstants>Revit$(RevitVersion)</DefineConstants>
<DefineConstants></DefineConstants>
<NoWarn>MSB3052</NoWarn>
<DebugType>None</DebugType>
</PropertyGroup>
Expand All @@ -76,17 +25,10 @@
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;Revit$(RevitVersion)</DefineConstants>
<DefineConstants>DEBUG;TRACE;</DefineConstants>
<DebugType>Full</DebugType>
</PropertyGroup>

<!-- DebugRevitVersion -->
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<DebugRevitVersion>$(RevitVersion)</DebugRevitVersion>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\Autodesk\Revit $(DebugRevitVersion)\Revit.exe</StartProgram>
</PropertyGroup>

<PropertyGroup>
<PackageId>ricaun.Revit.Github</PackageId>
<Version Condition="'$(Version)' == ''">0.2.0</Version>
Expand Down Expand Up @@ -155,8 +97,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.*" IncludeAssets="build; compile" PrivateAssets="All" />
<PackageReference Include="Revit_All_Main_Versions_API_x64" Version="$(RevitVersion).*" IncludeAssets="build; compile" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="9.*"/>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 1ddd049

Please sign in to comment.