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

add extra files in nugets #14774

Merged
merged 13 commits into from
Jan 11, 2024
Merged
3 changes: 2 additions & 1 deletion test/Libraries/SystemTestServices/SystemTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ protected virtual void StartDynamo(TestSessionConfiguration testConfig)
StartInTestMode = true,
PathResolver = pathResolver,
GeometryFactoryPath = preloader.GeometryFactoryPath,
ProcessMode = TaskProcessMode.Synchronous
ProcessMode = TaskProcessMode.Synchronous,
DynamoCorePath = testConfig.DynamoCorePath
aparajit-pratap marked this conversation as resolved.
Show resolved Hide resolved
});

ViewModel = DynamoViewModel.Start(
Expand Down
7 changes: 7 additions & 0 deletions test/Libraries/TestServices/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="DynamoBasePath" value=""/>
<add key="RequestedLibraryVersion" value=""/>
pinzart90 marked this conversation as resolved.
Show resolved Hide resolved
</appSettings>
</configuration>
8 changes: 8 additions & 0 deletions tools/NuGet/build_props/DynamoVisualProgramming.Core.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Target Name="Copy_extra_files" AfterTargets="Build">
<ItemGroup>
<Extras Include="$(MSBuildThisFileDirectory)*" />
</ItemGroup>
<Copy SourceFiles="@(Extras)" DestinationFolder="$(OutputPath)" />
</Target>
</Project>
9 changes: 9 additions & 0 deletions tools/NuGet/build_props/DynamoVisualProgramming.Tests.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)TestServices.dll.config">
Copy link
Member

@mjkkirschner mjkkirschner Jan 3, 2024

Choose a reason for hiding this comment

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

when does this props file get used? When packing? When unpacking? At build time in the code that references this package?

Copy link
Member

Choose a reason for hiding this comment

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

I am just curious, is there a simpler way to get this config file to be copied - putting it in the lib subfolder folder does not work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Props files (from nugets) are consumed by the project that references the nuget when running restore.
This is a pretty standard way to have both assemblies and generic files in a nuget pacakge. There is another way to add generic files (as contentFIles) but those seem to be readonly (and we need write access).
https://learn.microsoft.com/en-us/nuget/concepts/msbuild-props-and-targets#packagereference-projects

<Link>TestServices.dll.config</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Visible>True</Visible>
</Content>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Target Name="Copy_extra_files" AfterTargets="Build">
<ItemGroup>
<Extras Include="$(MSBuildThisFileDirectory)*" />
</ItemGroup>
<Copy SourceFiles="@(Extras)" DestinationFolder="$(OutputPath)" />
</Target>
</Project>
36 changes: 23 additions & 13 deletions tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,61 @@
<icon>content\images\logo.png</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>
Assemblies required to start a DynamoModel and execute DesignScript code. Contains the following files:
1) DynamoApplications.dll
2) DynamoCore.dll
3) DynamoInstallDetective.dll
4) DynamoShapeManager.dll
5) DynamoUtilities.dll
6) ProtoCore.dll
7) DesignScriptBuiltin.dll
8) VMDataBridge.dll
9) DSCPython.dll
10) DynamoPackages.dll
Assemblies required to start a DynamoModel and execute DesignScript code.
</description>
<summary>This package contains the core assemblies for Dynamo.</summary>
<copyright>Copyright Autodesk 2023</copyright>
<dependencies>
<!--TODO - why do we reference nunit from dynamo core? This is an odd partial collection of dependencies to mark.-->
<group targetFramework="$TargetFramework$">
<dependency id="NUnit" version="3.13.3"/>
<dependency id="DynamoVisualProgramming.ZeroTouchLibrary" version="$Version$"/>
<dependency id="Newtonsoft.Json" version="13.0.1"/>
Copy link
Member

Choose a reason for hiding this comment

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

do you think this will cause problems?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, removing it would probably cause build issues for some consumers.
NewtonSoft types still seem to be publicly exposed "near" core Dynamo APIs. I will add a task to mark those as obsolete...or move them somewhere more hidden.

Copy link
Member

@mjkkirschner mjkkirschner Jan 9, 2024

Choose a reason for hiding this comment

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

yeah, it's going to be a big lift to get rid of these types as we require users to use those attributes, perhaps if those attributes are also now facaded by system.text.json we can switch it out without breaking previous builds - but needs to be determined. It was something I was hopeful we could do for 3.0, but no dice.

<dependency id="System.Collections.Immutable" version="5.0.0"/>
</group>
</dependencies>
</metadata>
<!--for now we assume that that the working directory root is dynamo/bin/AnyCPU/Release-->
<files>
<file src="DynamoApplications.dll" target="lib\$TargetFramework$" />
<file src="DynamoApplications.xml" target="lib\$TargetFramework$" />
<file src="en-US\DynamoApplications.resources.dll" target="lib\$TargetFramework$\en-US" />

<file src="DynamoCore.dll" target="lib\$TargetFramework$" />
<file src="DynamoCore.xml" target="lib\$TargetFramework$" />
<file src="DynamoCore.dll.config" target="build\$TargetFramework$" />
<file src="en-US\DynamoCore.resources.dll" target="lib\$TargetFramework$\en-US" />
<file src="DynamoCore.customization.dll" target="build\$TargetFramework$" />

<file src="DynamoInstallDetective.dll" target="lib\$TargetFramework$" />

<file src="DynamoShapeManager.dll" target="lib\$TargetFramework$" />
<file src="DynamoShapeManager.xml" target="lib\$TargetFramework$" />
<file src="DynamoShapeManager.dll.config" target="build\$TargetFramework$" />

<file src="DynamoUtilities.dll" target="lib\$TargetFramework$" />
<file src="DynamoUtilities.xml" target="lib\$TargetFramework$" />
<file src="en-US\DynamoUtilities.resources.dll" target="lib\$TargetFramework$\en-US" />

<file src="ProtoCore.dll" target="lib\$TargetFramework$" />
<file src="ProtoCore.xml" target="lib\$TargetFramework$" />
<file src="en-US\ProtoCore.resources.dll" target="lib\$TargetFramework$\en-US" />

<file src="DesignScriptBuiltin.dll" target="lib\$TargetFramework$" />
<file src="DesignScriptBuiltin.xml" target="lib\$TargetFramework$" />
<file src="en-US\DesignScriptBuiltin.resources.dll" target="lib\$TargetFramework$\en-US" />

<file src="VMDataBridge.dll" target="lib\$TargetFramework$" />
<file src="VMDataBridge.xml" target="lib\$TargetFramework$" />

<file src="DSCPython.dll" target="lib\$TargetFramework$" />
<file src="en-US\DSCPython.resources.dll" target="lib\$TargetFramework$\en-US" />

<!--TODO - arguable if DynamoPackages should be in this package-->
<file src="DynamoPackages.dll" target="lib\$TargetFramework$" />
<file src="DynamoPackages.xml" target="lib\$TargetFramework$" />
<file src="en-US\DynamoPackages.resources.dll" target="lib\$TargetFramework$\en-US" />
<file src="DynamoPackages.dll.config" target="build\$TargetFramework$" />

<file src="..\..\..\tools\Nuget\build_props\DynamoVisualProgramming.Core.targets" target="build\$TargetFramework$" />
<file src="..\..\..\doc\distrib\Images\logo_square_32x32.png" target="content\images\logo.png" />
</files>
</package>
14 changes: 11 additions & 3 deletions tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@
<dependencies>
<group targetFramework="$TargetFramework$">
<dependency id="DynamoVisualProgramming.Core" version="$Version$"/>
<dependency id="Microsoft.NET.Test.Sdk" version="17.3.2" />
<dependency id="NUnit" version="3.13.3" />
<dependency id="NUnit3TestAdapter" version="4.2.1" />
</group>
</dependencies>
<contentFiles>
</contentFiles>
</metadata>
<files>
<!--These assemblies are referenced from the bin directory since they are not harvested for the installer-->
<file src="..\..\..\bin\AnyCPU\Release\DynamoCoreTests.dll" target="lib\$TargetFramework$" />
<file src="..\..\..\bin\AnyCPU\Release\SystemTestServices.dll" target="lib\$TargetFramework$" />
<file src="..\..\..\bin\AnyCPU\Release\TestServices.dll" target="lib\$TargetFramework$" />
<file src="..\..\..\bin\AnyCPU\Debug\DynamoCoreTests.dll" target="lib\$TargetFramework$" />
<file src="..\..\..\bin\AnyCPU\Debug\SystemTestServices.dll" target="lib\$TargetFramework$" />
<file src="..\..\..\bin\AnyCPU\Debug\TestServices.dll" target="lib\$TargetFramework$" />
<file src="..\..\..\bin\AnyCPU\Debug\TestServices.dll.config" target="build" />

<file src="..\..\..\tools\Nuget\build_props\DynamoVisualProgramming.Tests.props" target="build" />
<file src="..\..\..\doc\distrib\Images\logo_square_32x32.png" target="content\images\logo.png" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,22 @@
<files>
<file src="DynamoUnits.dll" target="lib\$TargetFramework$" />
<file src="DynamoUnits.xml" target="lib\$TargetFramework$" />

<file src="ProtoGeometry.dll" target="lib\$TargetFramework$" />
<file src="ProtoGeometry.xml" target="lib\$TargetFramework$" />


<file src="en-US\ProtoGeometry.resources.dll" target="lib\$TargetFramework$\en-US" />

<file src="DynamoUnits.dll.config" target="build\$TargetFramework$" />
<file src="DynamoUnits.customization.dll" target="build\$TargetFramework$" />
<file src="DynamoUnits_DynamoCustomization.xml" target="build\$TargetFramework$" />

<file src="ProtoGeometry.config" target="build\$TargetFramework$" />
<file src="ProtoGeometry.customization.dll" target="build\$TargetFramework$" />
<file src="ProtoGeometry_DynamoCustomization.xml" target="build\$TargetFramework$" />
<file src="ProtoGeometry.Migrations.xml" target="build\$TargetFramework$" />

<file src="..\..\..\tools\Nuget\build_props\DynamoVisualProgramming.ZeroTouchLibrary.targets" target="build\$TargetFramework$" />
<file src="..\..\..\doc\distrib\Images\logo_square_32x32.png" target="content\images\logo.png" />
</files>
</package>
Loading