Merge branch 'master' into warnings
This commit is contained in:
@@ -52,9 +52,10 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="RevitAPIIFC, Version=21.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Reference Include="RevitAPIIFC">
|
||||
<HintPath>.\RevitAPIIFC.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#region Namespaces
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
using Autodesk.Revit.UI;
|
||||
#endregion
|
||||
@@ -11,6 +15,22 @@ namespace xUnitRevit
|
||||
{
|
||||
a.ControlledApplication.ApplicationInitialized += ControlledApplication_ApplicationInitialized;
|
||||
|
||||
string path = typeof(App).Assembly.Location;
|
||||
RibbonPanel ribbonPanel = a.CreateRibbonPanel("xUnitRevit by Speckle");
|
||||
|
||||
var xUnitRevitButton = ribbonPanel.AddItem(new PushButtonData("Test Runner", "Test Runner", typeof(App).Assembly.Location, typeof(Command).FullName)) as PushButton;
|
||||
|
||||
if (xUnitRevitButton != null)
|
||||
{
|
||||
xUnitRevitButton.Image = LoadPngImgSource("xUnitRevit.Assets.icon16.png", path);
|
||||
xUnitRevitButton.LargeImage = LoadPngImgSource("xUnitRevit.Assets.icon32.png", path);
|
||||
xUnitRevitButton.ToolTipImage = LoadPngImgSource("xUnitRevit.Assets.icon32.png", path);
|
||||
xUnitRevitButton.ToolTip = "xUnit Test runner for Revit";
|
||||
xUnitRevitButton.AvailabilityClassName = typeof(CmdAvailabilityViews).FullName;
|
||||
xUnitRevitButton.SetContextualHelp(new ContextualHelp(ContextualHelpType.Url, "https://speckle.systems"));
|
||||
}
|
||||
|
||||
|
||||
return Result.Succeeded;
|
||||
}
|
||||
|
||||
@@ -29,5 +49,20 @@ namespace xUnitRevit
|
||||
{
|
||||
return Result.Succeeded;
|
||||
}
|
||||
|
||||
private ImageSource LoadPngImgSource(string sourceName, string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var assembly = Assembly.LoadFrom(Path.Combine(path));
|
||||
var icon = assembly.GetManifestResourceStream(sourceName);
|
||||
PngBitmapDecoder m_decoder = new PngBitmapDecoder(icon, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
|
||||
ImageSource m_source = m_decoder.Frames[0];
|
||||
return (m_source);
|
||||
}
|
||||
catch { }
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -10,10 +10,6 @@ namespace xUnitRevit
|
||||
[Transaction(TransactionMode.Manual)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
static object consoleLock = new object();
|
||||
static ManualResetEvent finished = new ManualResetEvent(false);
|
||||
static Result result = Result.Succeeded;
|
||||
|
||||
public Result Execute(
|
||||
ExternalCommandData commandData,
|
||||
ref string message,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<!--<AddIn Type="Command">
|
||||
<Text>xUnitRevit</Text>
|
||||
<Description>xUnitRevit</Description>
|
||||
<Assembly>xUnitRevit\xUnitRevit.dll</Assembly>
|
||||
@@ -8,9 +8,9 @@
|
||||
<ClientId>9d179887-9fae-41f9-940a-697b59cafe4a</ClientId>
|
||||
<VendorId>speckle</VendorId>
|
||||
<VendorDescription>Speckle</VendorDescription>
|
||||
</AddIn>
|
||||
</AddIn>-->
|
||||
<AddIn Type="Application">
|
||||
<Name>Application xUnitRevit</Name>
|
||||
<Name>xUnitRevit Runner</Name>
|
||||
<Assembly>xUnitRevit\xUnitRevit.dll</Assembly>
|
||||
<FullClassName>xUnitRevit.App</FullClassName>
|
||||
<ClientId>d9c9ed6f-7b2a-4c47-8f87-a6f33a553d50</ClientId>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
None
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
None
|
||||
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
@@ -139,16 +139,16 @@
|
||||
<None Include="config_sample.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<!--
|
||||
<None Include="config.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<!--
|
||||
<None Include="config.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
-->
|
||||
<None Include="xUnitRevit.addin" />
|
||||
</ItemGroup>
|
||||
<!-- SWITCH REVIT NUGETS -->
|
||||
<Choose>
|
||||
<When Condition="'$(Configuration)' == 'Debug2019' Or '$(Configuration)' == 'Release2019'">
|
||||
<When Condition="$(Configuration.Contains('2019'))">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ModPlus.Revit.API.2019">
|
||||
<Version>1.0.0</Version>
|
||||
@@ -162,7 +162,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)' == 'Debug2020' Or '$(Configuration)' == 'Release2020'">
|
||||
<When Condition="$(Configuration.Contains('2020'))">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ModPlus.Revit.API.2020">
|
||||
<Version>1.0.0</Version>
|
||||
@@ -176,7 +176,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)' == 'Debug2021' Or '$(Configuration)' == 'Release2021'">
|
||||
<When Condition="$(Configuration.Contains('2021'))">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ModPlus.Revit.API.2021">
|
||||
<Version>4.0.0</Version>
|
||||
@@ -191,10 +191,10 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)' == 'Debug2022' Or '$(Configuration)' == 'Release2022'">
|
||||
<When Condition="$(Configuration.Contains('2022'))">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ModPlus.Revit.API.2022">
|
||||
<Version>1.0.0</Version>
|
||||
<PackageReference Include="Speckle.Revit.API">
|
||||
<Version>2022.0.2.1</Version>
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
@@ -205,10 +205,10 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)' == 'Debug2023' Or '$(Configuration)' == 'Release2023'">
|
||||
<When Condition="$(Configuration.Contains('2023'))">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ModPlus.Revit.API.2023">
|
||||
<Version>1.0.0</Version>
|
||||
<PackageReference Include="Speckle.Revit.API">
|
||||
<Version>2023.0.0</Version>
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
@@ -226,6 +226,11 @@
|
||||
<Version>1.0.9</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\icon.png" />
|
||||
<EmbeddedResource Include="Assets\icon16.png" />
|
||||
<EmbeddedResource Include="Assets\icon32.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
@@ -233,8 +238,8 @@
|
||||
</PropertyGroup>
|
||||
<!-- MULTIVERSION POST BUILD EVENTS START -->
|
||||
<Target Name="AfterBuild">
|
||||
<CallTarget Condition="'$(Configuration)' == 'Debug2021' Or '$(Configuration)' == 'Debug2020' Or '$(Configuration)' == 'Debug2019'" Targets="AfterBuildDebug" />
|
||||
<CallTarget Condition="'$(Configuration)' == 'Release2021' Or '$(Configuration)' == 'Release2020' Or '$(Configuration)' == 'Release2019'" Targets="AfterBuildRelease" />
|
||||
<CallTarget Condition="$(Configuration.Contains('Debug'))" Targets="AfterBuildDebug" />
|
||||
<CallTarget Condition="$(Configuration.Contains('Release'))" Targets="AfterBuildRelease" />
|
||||
</Target>
|
||||
<Target Name="AfterBuildDebug">
|
||||
<ItemGroup>
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Speckle.Revit.API" Version="2023.0.0" />
|
||||
<PackageReference Include="Speckle.Revit.API" Version="2023.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user