Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to .NET8 #41

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<FileAlignment>512</FileAlignment>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> <!-- Disable default inclusion of all *.cs files to avoid duplicate compile item errors. -->
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <!-- Prevent generation of AssemblyInfo.cs to avoid duplicate attributes. -->
<EnableDefaultPageItems>false</EnableDefaultPageItems> <!-- Disable default inclusion of all *.xaml files to avoid duplicate page item errors. -->
</PropertyGroup>

<PropertyGroup>
<DynamoPackageVersion>3.2.1.5366</DynamoPackageVersion>
<MSTestVersion>1.3.2</MSTestVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
</Project>
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TuneUp is in `beta`.

TuneUp is a view extension for analyzing the performance of Dynamo graphs. TuneUp allows you to see overall graph execution time, per-node execution time, and other helpful information about what's happening under the hood, e.g. nodes run in the current execution v.s. nodes run in the previous execution (which were skipped during the most recent graph run for optimization/ caching).

Here is a short demo of how to utilize it as of now:
Here is a short demo of how to utilize it as of now (now loading from the Extensions menu):
![TuneUp](design/gifs/TuneUpScroll.gif)

Here is a mock up of the future design:
Expand All @@ -16,8 +16,8 @@ Here is a mock up of the future design:

### Recommended Build Environment

- VisualStudio 2019
- .Net Framework 4.7 Developer Pack
- VisualStudio 2022 or later
- .NET 8.0 Developer Pack
- Dynamo repository cloned and built on the same level of TuneUp repository which means your Dynamo repo and TuneUp repo should exist under the same parent folder.

### Result Binaries
Expand All @@ -32,7 +32,7 @@ Under `TuneUp\dist\TuneUp`, there is a sample package wrapped up ready for publi

- TuneUp does not work with .dyfs (custom nodes) yet.
- TuneUp binaries are not semantically versioned and are not intended to be built on top of as an API. Do not treat these binaries like DynamoCore.
- TuneUp requires Dynamo 2.5 or higher for access to new extension APIs.
- TuneUp requires Dynamo 3.0 or higher for access to new extension APIs.
- When user have TuneUp open, after switching workspace in Dynamo, the first graph run does not give execution time and nodes order.
- Although it's not an issue by itself, TuneUp profiles the execution of graphs even if not showing on the extension bar.
- In some cases TuneUp may calculate incorrect execution times for nodes, we cannot reproduce this consistently, if you see this occur and can reproduce it please file an issue!
Expand All @@ -43,7 +43,7 @@ Under `TuneUp\dist\TuneUp`, there is a sample package wrapped up ready for publi

Please check out known issues before trying to setup testing.

- Download DynamoCoreRuntime 2.5.0 (or higher) from [dynamobuilds.com](https://dynamobuilds.com/). Alternatively, you can build Dynamo from Dynamo repository and use the bin folder equivalently.
- Download DynamoCoreRuntime 3.0.0 (or higher) from [dynamobuilds.com](https://dynamobuilds.com/). Alternatively, you can build Dynamo from Dynamo repository and use the bin folder equivalently.
- Copy all contents of the DynamoCoreRuntime to `TuneUp\TuneUpTests\bin\Debug\`. If you are building Dynamo locally, copy all contents of Dynamo from `Dynamo/bin/AnyCPU/Debug` to `TuneUp\TuneUpTests\bin\Debug\`
- Copy `TuneUp_ViewExtensionDefinition.xml` from `TuneUp\TuneUp\manifests\` to `TuneUp\TuneUpTests\bin\Debug\viewExtensions\`
- Open the copied `TuneUp_ViewExtensionDefinition.xml` and change the assemply path to `..\TuneUp.dll`
Expand All @@ -52,6 +52,6 @@ Please check out known issues before trying to setup testing.

### Running TuneUp Unit Tests

- Install NUnit 2 Test Adapter from VisualStudio->Extensions->Manage Extensions->Online.
- Install NUnit3TestAdapter from VisualStudio->Extensions->Manage Extensions->Online.
- Open Test Explorer from VisualStudio->Test->Test Explorer. Now you should see a list of TuneUpTests.
- Click the target test to run or run them all.
85 changes: 40 additions & 45 deletions TuneUp/TuneUp.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<!-- Default properties for the project -->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6FF12D3A-025E-49A5-A773-D99AB82778A3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>net8.0-windows</TargetFramework>
<RootNamespace>TuneUp</RootNamespace>
<AssemblyName>TuneUp</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<OutputType>Library</OutputType>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\Dynamo\Dynamo Core\2\DynamoSandbox.exe</StartProgram>
<FileAlignment>512</FileAlignment>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<TargetFrameworkProfile />
<StartProgram>C:\Program Files\Dynamo\Dynamo Core\3.2\DynamoSandbox.exe</StartProgram>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<!-- Properties specific to Debug configuration -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand All @@ -26,14 +19,16 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<!-- Properties specific to Release configuration -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<!-- References to other assemblies -->
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand All @@ -48,62 +43,61 @@
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<!-- Source code files to be compiled -->
<ItemGroup>
<Compile Include="ProfiledNodeViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TuneUpViewExtension.cs" />
<Compile Include="TuneUpWindowViewModel.cs" />
<Compile Include="TuneUpWindow.xaml.cs">
<DependentUpon>TuneUpWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<!-- XAML files to be compiled -->
<ItemGroup>
<Page Include="TuneUpWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<!-- Package references -->
<ItemGroup>
<PackageReference Include="DynamoVisualProgramming.Core">
<Version>2.12.0.5650</Version>
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.DynamoServices">
<Version>2.12.0.5650</Version>
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.WpfUILibrary">
<Version>2.12.0.5650</Version>
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.Core" Version="$(DynamoPackageVersion)">
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to explicitly add which assets to include here? Other projects don't do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is in master. Given the brief I thought of keeping the same logic .
Will correct.

</PackageReference>
<PackageReference Include="DynamoVisualProgramming.Tests" Version="$(DynamoPackageVersion)">
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.WpfUILibrary" Version="$(DynamoPackageVersion)">
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="$(DynamoPackageVersion)">
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="manifests\pkg.json" />
<None Include="manifests\TuneUp_ViewExtensionDefinition.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<!-- Including Custom Properties, PreBuildEvent, and Import -->
<PropertyGroup>
<DynamoVersion>2.12</DynamoVersion>
<DynamoVersion>3.2</DynamoVersion>
<PackageName>TuneUp</PackageName>
<PackageFolder>$(ProjectDir)dist\$(PackageName)\</PackageFolder>
<BinFolder>$(PackageFolder)bin\</BinFolder>
<ExtraFolder>$(PackageFolder)extra\</ExtraFolder>
<DyfFolder>$(PackageFolder)dyf\</DyfFolder>
</PropertyGroup>
<!-- Pre-build events -->
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- Post-build events to handle package deployment -->
<Target Name="AfterBuild">
<ItemGroup>
<Dlls Include="$(OutDir)TuneUp.dll" />
Expand All @@ -116,10 +110,11 @@
<Copy SourceFiles="@(Xmls)" DestinationFolder="$(BinFolder)" />
<Copy SourceFiles="@(ViewExtensionDefs)" DestinationFolder="$(ExtraFolder)" />
<Copy SourceFiles="@(PackageJson)" DestinationFolder="$(PackageFolder)" />
<MakeDir Directories="$(ExtraFolder)" Condition="!Exists($(ExtraFolder))"/>
<MakeDir Directories="$(DyfFolder)" Condition="!Exists($(DyfFolder))"/>
<MakeDir Directories="$(ExtraFolder)" Condition="!Exists($(ExtraFolder))" />
<MakeDir Directories="$(DyfFolder)" Condition="!Exists($(DyfFolder))" />
<CallTarget Condition="'$(Configuration)' == 'Debug'" Targets="PackageDeploy" />
</Target>
<!-- Target for package deployment -->
<Target Name="PackageDeploy">
<ItemGroup>
<SourcePackage Include="$(PackageFolder)**\*" />
Expand All @@ -135,7 +130,7 @@
<Message Importance="high" Text="Dynamo Revit Package Folder = $(DynamoRevit)" />
<Copy SourceFiles="@(SourcePackage)" Condition="Exists($(DynamoCore))" DestinationFolder="$(DynamoCore)\$(PackageName)\%(RecursiveDir)" />
<Copy SourceFiles="@(SourcePackage)" Condition="Exists($(DynamoRevit))" DestinationFolder="$(DynamoRevit)\$(PackageName)\%(RecursiveDir)" />
<MakeDir Directories="$(PackageExtraFolder)" Condition="!Exists($(PackageExtraFolder))"/>
<MakeDir Directories="$(PackageDyfFolder)" Condition="!Exists($(PackageDyfFolder))"/>
<MakeDir Directories="$(PackageExtraFolder)" Condition="!Exists($(PackageExtraFolder))" />
<MakeDir Directories="$(PackageDyfFolder)" Condition="!Exists($(PackageDyfFolder))" />
</Target>
</Project>
6 changes: 5 additions & 1 deletion TuneUp/TuneUpViewExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public override void Loaded(ViewLoadedParams p)

// Add this view extension's menu item to the Extensions tab or View tab accordingly.
var dynamoMenuItems = p.dynamoMenu.Items.OfType<MenuItem>();
var extensionsMenuItem = dynamoMenuItems.Where(item => item.Header.ToString() == "_Extensions");
// TODO: Investigate why TuneUpMenuItem is not added to the specified MenuItem
// When _Extensions is specified, TuneUpMenuItem goes to the View menu in Dynamo 3.0-
// and does not appear in Dynamo 3.1+.
// We need to specify _View for TuneUpMenuItem to be added to the Extensions menu
var extensionsMenuItem = dynamoMenuItems.Where(item => item.Header.ToString() == "_View");
reddyashish marked this conversation as resolved.
Show resolved Hide resolved

if (extensionsMenuItem.Count() > 0)
{
Expand Down
7 changes: 4 additions & 3 deletions TuneUpTests/TuneUpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using Dynamo.Graph.Workspaces;
Expand Down Expand Up @@ -30,7 +31,7 @@ internal TuneUpViewExtension GetTuneUpViewExtension()
return tuneUpVE as TuneUpViewExtension;
}

[Test, RequiresSTA]
[Test, Apartment(ApartmentState.STA)]
public void TuneUpCreatesProfilingDataForEveryNodeInWorkspace()
{
// Open test graph
Expand Down Expand Up @@ -63,7 +64,7 @@ public void TuneUpCreatesProfilingDataForEveryNodeInWorkspace()
}
}

[Test, RequiresSTA]
[Test, Apartment(ApartmentState.STA)]
public void TuneUpMaintainsProfiledNodeState()
{
// Open test graph
Expand Down Expand Up @@ -122,7 +123,7 @@ public void TuneUpMaintainsProfiledNodeState()
}
}

[Test, RequiresSTA]
[Test, Apartment(ApartmentState.STA)]
public void TuneUpDeterminesCorrectNodeExecutionOrder()
{
// Expected execution order
Expand Down
75 changes: 34 additions & 41 deletions TuneUpTests/TuneUpTests.csproj
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.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')" />

<Project Sdk="Microsoft.NET.Sdk">
<!-- Default properties for the project -->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B6817785-AFD9-4AF5-9562-5808E74B53E7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>net8.0-windows</TargetFramework>
<RootNamespace>TuneUpTests</RootNamespace>
<AssemblyName>TuneUpTests</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<!-- Properties specific to Debug configuration -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<!-- Properties specific to Release configuration -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<!-- References to other assemblies -->
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand All @@ -53,39 +46,39 @@
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<!-- Source code files to be compiled -->
<ItemGroup>
<Compile Include="TuneUpTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<!-- Reference to the main project -->
<ItemGroup>
<ProjectReference Include="..\TuneUp\TuneUp.csproj">
<Project>{6ff12d3a-025e-49a5-a773-d99ab82778a3}</Project>
<Name>TuneUp</Name>
</ProjectReference>
</ItemGroup>
<!-- Package references -->
<ItemGroup>
<PackageReference Include="DynamoVisualProgramming.Core">
<Version>2.12.0.5650</Version>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.DynamoServices">
<Version>2.12.0.5650</Version>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.Tests">
<Version>2.12.0.5650</Version>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary">
<Version>2.12.0.5650</Version>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>1.3.2</Version>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>1.3.2</Version>
</PackageReference>
<PackageReference Include="NUnitTestAdapter">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.Core" Version="$(DynamoPackageVersion)">
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
reddyashish marked this conversation as resolved.
Show resolved Hide resolved
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.Tests" Version="$(DynamoPackageVersion)">
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.WpfUILibrary" Version="$(DynamoPackageVersion)">
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="$(DynamoPackageVersion)">
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestVersion)" />
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" />
</ItemGroup>
<!-- Import necessary for test tools -->
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>