Skip to content

Commit

Permalink
Merge branch 'master' into SetLocaleChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
QilongTang committed Nov 22, 2023
2 parents a314502 + c00af64 commit 3ee94ff
Show file tree
Hide file tree
Showing 55 changed files with 469 additions and 212 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/close_stale_issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- name: Summary # Print markdown list of closed issues or "No Issues" message if no issues were closed
env:
ISSUES_URL: ${{ format('{0}/{1}/issues', github.server_url, github.repository) }}
CLOSED_ISSUES: ${{ steps.close_issues.outputs.closed-issues-prs }}
run: |
echo '# Closed Issues' >> $GITHUB_STEP_SUMMARY
echo '${{ env.CLOSED_ISSUES }}' | jq --raw-output ' if (. == []) then "- No Issues." else .[] | "- \(.title) - [#\(.number)](\(${{ env.ISSUES_URL }})/\(.number))" end' >> $GITHUB_STEP_SUMMARY
echo '${{ steps.close_issues.outputs.closed-issues-prs }}' | jq --raw-output 'if (. == []) then "- No Issues." else .[] | "- \(.title) - [#\(.number)](\(env.ISSUES_URL)/\(.number))" end' >> $GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Install dependencies for windows runtime
run: dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\Dynamo.All.sln --runtime=win10-x64
run: dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\Dynamo.All.sln --runtime=win-x64
- name: Build Dynamo with MSBuild for Windows
run: |
echo "***Continue with the build, Good luck developer!***"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dynamoAllNet6.0_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Install dependencies for windows runtime
run: |
dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win10-x64
dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64
- name: Build Dynamo with MSBuild for Windows
run: |
echo "***Continue with the build, Good luck developer!***"
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/dynamoAllNet8.0_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Build Dynamo using latest VS and DotNET
name: DynamoAllNet8.0-Build
on: [push,pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout Dynamo Repo
uses: actions/checkout@v4
with:
path: Dynamo
repository: DynamoDS/Dynamo
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Disable problem matcher
run: echo "::remove-matcher owner=csc::"

- name: Install dependencies for windows runtime
run: |
dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0
- name: Build Dynamo with MSBuild for Windows
run: |
echo "***Continue with the build, Good luck developer!***"
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe $Env:GITHUB_WORKSPACE\Dynamo\src\Dynamo.All.sln /p:Configuration=Release /p:DotNet=net8.0
# look for Dynamo
- name: Navigate to Dynamo Windows Folder
run: |
cd "$Env:GITHUB_WORKSPACE\Dynamo\bin\AnyCPU\Release"
echo "***Locating DynamoCLI for Windows!***"
test ".\DynamoCLI.exe" && echo "DynamoCLI exists!"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: DynamoSandbox
path: ${{ github.workspace }}\Dynamo\bin\AnyCPU\Release
if-no-files-found: warn
retention-days: 3
4 changes: 2 additions & 2 deletions .github/workflows/dynamoBinDiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: echo "::remove-matcher owner=csc::"
- name: Install dependencies for windows runtime
run: |
dotnet restore $Env:GITHUB_WORKSPACE\net60_Win_Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win10-x64
dotnet restore $Env:GITHUB_WORKSPACE\net60_Win_Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64
- name: Build Dynamo current branch with MSBuild for NET60-Windows
run: |
echo "***Continue with the build, Good luck developer!***"
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
run: echo "::remove-matcher owner=csc::"
- name: Install dependencies for windows runtime
run: |
dotnet restore $Env:GITHUB_WORKSPACE\master_net60_Win_Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win10-x64
dotnet restore $Env:GITHUB_WORKSPACE\master_net60_Win_Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64
- name: Build Dynamo master branch with MSBuild for NET60-Windows
run: |
echo "***Continue with the build, Good luck developer!***"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dynamoNet6.0_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Install dependencies for windows runtime
run: |
dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.sln /p:Configuration=Release --runtime=win10-x64
dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.sln /p:Configuration=Release --runtime=win-x64
- name: Build Dynamo with MSBuild for Windows
run: |
echo "***Continue with the build, Good luck developer!***"
Expand Down
12 changes: 12 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<!--
SolutionDir is mostly useful for running the dotnet list package command
Ex. of generating report of all transitive nuget dependencies in powershell:
(dotnet list $pwd\Dynamo.All.sln package - -include-transitive
Ex. of generating report of unique transitive nuget dependencies in powershell:
(dotnet list $pwd\Dynamo.All.sln package - -include-transitive) -match '^.*>' -replace '^ +> ','' -replace '\s+', ' ' | % { $_.Trim() } | % { [string]::Format("{0} {1}",$_.split(" ")[0],$_.split(" ")[1])} | Sort-Object -Unique
Note: The - -include-transitive should have a double dash without a space in between. -->
<SolutionDir>$(MSBuildThisFileDirectory)src\</SolutionDir>
</PropertyGroup>
</Project>
7 changes: 5 additions & 2 deletions src/Config/CS_SDK.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PlatformTarget >x64</PlatformTarget>
<!--Use the property DotNet to set TargetFramework from commandline without forcing it on all projects-->
<!--Ex. DynamoServices uses TargetFramework netstandard2.0 -->
<DotNet>net6.0</DotNet>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.0</VisualStudioVersion>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>$(DotNet)</TargetFramework>
<FileAlignment>512</FileAlignment>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
Expand Down Expand Up @@ -49,7 +52,7 @@
<GenerateDependencyFile>false</GenerateDependencyFile>
</PropertyGroup>
<PropertyGroup Condition="$(Platform.Contains('AnyCPU'))" >
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DefineConstants>$(DefineConstants);_WINDOWS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(Platform.Contains('Linux'))" >
Expand Down
4 changes: 2 additions & 2 deletions src/DynamoCLI/CommandLineRunner.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -46,7 +46,7 @@ private static XmlDocument RunCommandLineArgs(DynamoModel model, StartupUtils.Co
Console.WriteLine("geometryFilePath option is only available when running DynamoWPFCLI, not DynamoCLI");
}

model.HostAnalyticsInfo = cmdLineArgs.AnalyticsInfo;
DynamoModel.HostAnalyticsInfo = cmdLineArgs.AnalyticsInfo;

cmdLineArgs.ImportedPaths.ToList().ForEach(path =>
{
Expand Down
4 changes: 2 additions & 2 deletions src/DynamoCore/DynamoCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<ItemGroup Label="Common dependencies">
<PackageReference Include="Autodesk.IDSDK" Version="1.1.6" />
<PackageReference Include="Greg" Version="3.0.0.3175" />
<PackageReference Include="DynamoVisualProgramming.LibG_229_0_0" Version="3.0.0.3171" GeneratePathProperty="true" />
<PackageReference Include="DynamoVisualProgramming.LibG_230_0_0" Version="3.0.0.3171" GeneratePathProperty="true" />
<PackageReference Include="DynamoVisualProgramming.LibG_229_0_0" Version="3.0.0.3175" GeneratePathProperty="true" />
<PackageReference Include="DynamoVisualProgramming.LibG_230_0_0" Version="3.0.0.3241" GeneratePathProperty="true" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" CopyXML="true" />
<PackageReference Include="RestSharp" Version="108.0.1" CopyXML="true" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
Expand Down
4 changes: 2 additions & 2 deletions src/DynamoCore/Extensions/ReadyParams.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Dynamo.Graph.Workspaces;
Expand Down Expand Up @@ -78,7 +78,7 @@ public virtual ICommandExecutive CommandExecutive
/// <summary>
/// HostInfo object, Useful to determine what host context Dynamo is running in.
/// </summary>
internal HostAnalyticsInfo HostInfo => dynamoModel.HostAnalyticsInfo;
internal HostAnalyticsInfo HostInfo => DynamoModel.HostAnalyticsInfo;


/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCore/Extensions/StartupParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ internal StartupParams(DynamoModel dynamoModel)
pathManager = dynamoModel.PathManager;
libraryLoader = new ExtensionLibraryLoader(dynamoModel);
customNodeManager = dynamoModel.CustomNodeManager;
dynamoVersion = new Version(dynamoModel.Version);
dynamoVersion = new Version(DynamoModel.Version);
preferences = dynamoModel.PreferenceSettings;
linterManager = dynamoModel.LinterManager;
IsGeometryLibraryLoaded = dynamoModel.IsASMLoaded;
Expand Down
47 changes: 15 additions & 32 deletions src/DynamoCore/Logging/AnalyticsService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Dynamo.Graph.Workspaces;
using Dynamo.Models;
using Autodesk.Analytics.ADP;
using Autodesk.Analytics.Core;
Expand All @@ -9,49 +8,29 @@ namespace Dynamo.Logging
/// <summary>
/// Utility class to support analytics tracking.
/// </summary>
class AnalyticsService
internal class AnalyticsService
{
// Use the Analytics.Core interface so that we do not have to load the ADP assembly at this time.
private static IAnalyticsUI adpAnalyticsUI;

/// <summary>
/// Starts the client when DynamoModel is created. This method initializes
/// Indicates that we don't want to shut down analytics when DynamoModel shuts down.
/// Sometimes we want to keep Analytics service running even when we don't have a DynamoModel started.
/// </summary>
internal static bool KeepAlive { get; set; }

/// <summary>
/// Starts the Analytics client. This method initializes
/// the Analytics service and application life cycle start is tracked.
/// </summary>
/// <param name="model">DynamoModel</param>
/// <param name="isHeadless">Analytics won't be started if IsHeadless, but ADP may be loaded to be disabled.</param>
/// <param name="isTestMode">Analytics won't be started if isTestMode, ADP will not be loaded.</param>
internal static void Start(DynamoModel model, bool isHeadless, bool isTestMode)
internal static void Start()
{
if (isTestMode)
{
if (Analytics.DisableAnalytics)
{
model.Logger.Log("Incompatible configuration: [IsTestMode] and [Analytics disabled] ");
}
return;
}

if (isHeadless)
{
return;
}

// Initialize the concrete class only when we initialize the Service.
// This will also load the Analytics.Net.ADP assembly
// We must initialize the ADPAnalyticsUI instance before the Analytics.Start call.
adpAnalyticsUI = new ADPAnalyticsUI();

Analytics.Start(new DynamoAnalyticsClient(model));
model.WorkspaceAdded += OnWorkspaceAdded;
}

static void OnWorkspaceAdded(WorkspaceModel obj)
{
if (obj is CustomNodeWorkspaceModel)
Analytics.TrackScreenView("CustomWorkspace");
else
Analytics.TrackScreenView("Workspace");
Analytics.Start(new DynamoAnalyticsClient(DynamoModel.HostAnalyticsInfo));
}

/// <summary>
Expand Down Expand Up @@ -99,7 +78,10 @@ internal static bool IsADPAvailable()
/// </summary>
internal static void ShutDown()
{
Analytics.ShutDown();
if (!KeepAlive)
{
Analytics.ShutDown();
}
}

/// <summary>
Expand All @@ -113,6 +95,7 @@ internal static void ShowADPConsentDialog(IntPtr? host)
adpAnalyticsUI.ShowOptInDialog(System.Threading.Thread.CurrentThread.CurrentUICulture.Name, false, host);
}
}

internal static string GetUserIDForSession()
{
if (Analytics.client is DynamoAnalyticsClient dac)
Expand Down
Loading

0 comments on commit 3ee94ff

Please sign in to comment.