Skip to content

Commit 7bf51de

Browse files
committed
added references as nuget packages, fixed pkg.json to load dependencies into Dynamo
1 parent af57b7b commit 7bf51de

File tree

7 files changed

+89
-16
lines changed

7 files changed

+89
-16
lines changed

HelloDynamo/Hello/Hello.csproj

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
<WarningLevel>4</WarningLevel>
3232
</PropertyGroup>
3333
<ItemGroup>
34+
<Reference Include="DynamoServices, Version=1.0.0.1431, Culture=neutral, processorArchitecture=MSIL">
35+
<HintPath>..\packages\DynamoVisualProgramming.DynamoServices.1.0.0\lib\net45\DynamoServices.dll</HintPath>
36+
<Private>True</Private>
37+
</Reference>
3438
<Reference Include="System" />
3539
<Reference Include="System.Core" />
3640
<Reference Include="System.Xml.Linq" />
@@ -44,6 +48,9 @@
4448
<Compile Include="SampleFunctions.cs" />
4549
<Compile Include="Properties\AssemblyInfo.cs" />
4650
</ItemGroup>
51+
<ItemGroup>
52+
<None Include="packages.config" />
53+
</ItemGroup>
4754
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
4855
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
4956
Other similar extension points exist, see Microsoft.Common.targets.

HelloDynamo/Hello/SampleFunctions.cs

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
1+
using Autodesk.DesignScript.Runtime;
62

7-
namespace Hello
3+
namespace HelloDynamo.Hello
84
{
9-
public static class SampleFunctions
5+
/// <summary>
6+
/// In order to be executed by the NodeModel AstFactory.BuildFunctionCall
7+
/// these methods have to be in a separate assembly and be loaded by Dynamo separately
8+
/// File pkg.json defines which dll are loaded
9+
/// </summary>
10+
[IsVisibleInDynamoLibrary(false)]
11+
public class SampleFunctions
1012
{
1113
public static double MultiplyTwoNumbers(double a, double b)
1214
{

HelloDynamo/Hello/packages.config

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="DynamoVisualProgramming.DynamoServices" version="1.0.0" targetFramework="net45" />
4+
</packages>

HelloDynamo/HelloNodeModel/HelloNodeModel.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
using System;
22
using System.Collections.Generic;
33
using Dynamo.Graph.Nodes;
4+
using HelloDynamo.Hello;
45
using ProtoCore.AST.AssociativeAST;
56

6-
using Hello;
7-
87
namespace HelloDynamo.HelloNodeModel
98
{
9+
/// <summary>
10+
/// Sample NodeModel
11+
/// In order to execute AstFactory.BuildFunctionCall
12+
/// the methods have to be in a separate assembly and be loaded by Dynamo separately
13+
/// File pkg.json defines which dll are loaded
14+
/// </summary>
1015
[NodeName("HelloNodeModel")]
1116
[NodeDescription("Example Node Model, multiplies AxB")]
1217
[NodeCategory("HelloDynamo")]

HelloDynamo/HelloNodeModel/HelloNodeModel.csproj

+51-6
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,62 @@
3131
<WarningLevel>4</WarningLevel>
3232
</PropertyGroup>
3333
<ItemGroup>
34-
<Reference Include="DynamoCore">
35-
<HintPath>..\..\..\..\Program Files\Dynamo\Dynamo Core\1.0\DynamoCore.dll</HintPath>
34+
<Reference Include="DynamoCore, Version=1.0.0.1431, Culture=neutral, processorArchitecture=MSIL">
35+
<HintPath>..\packages\DynamoVisualProgramming.Core.1.0.0\lib\net45\DynamoCore.dll</HintPath>
3636
<Private>False</Private>
3737
</Reference>
38-
<Reference Include="ProtoCore">
39-
<HintPath>..\..\..\..\Program Files\Dynamo\Dynamo Core\1.0\ProtoCore.dll</HintPath>
38+
<Reference Include="DynamoServices, Version=1.0.0.1431, Culture=neutral, processorArchitecture=MSIL">
39+
<HintPath>..\packages\DynamoVisualProgramming.DynamoServices.1.0.0\lib\net45\DynamoServices.dll</HintPath>
40+
<Private>False</Private>
41+
</Reference>
42+
<Reference Include="DynamoShapeManager, Version=1.0.0.1431, Culture=neutral, processorArchitecture=MSIL">
43+
<HintPath>..\packages\DynamoVisualProgramming.Core.1.0.0\lib\net45\DynamoShapeManager.dll</HintPath>
44+
<Private>False</Private>
45+
</Reference>
46+
<Reference Include="DynamoUnits, Version=1.0.0.1431, Culture=neutral, processorArchitecture=MSIL">
47+
<HintPath>..\packages\DynamoVisualProgramming.ZeroTouchLibrary.1.0.0\lib\net45\DynamoUnits.dll</HintPath>
48+
<Private>False</Private>
49+
</Reference>
50+
<Reference Include="DynamoUtilities, Version=1.0.0.1431, Culture=neutral, processorArchitecture=MSIL">
51+
<HintPath>..\packages\DynamoVisualProgramming.Core.1.0.0\lib\net45\DynamoUtilities.dll</HintPath>
52+
<Private>False</Private>
53+
</Reference>
54+
<Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55+
<HintPath>..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll</HintPath>
56+
<Private>True</Private>
57+
<Private>False</Private>
58+
</Reference>
59+
<Reference Include="Microsoft.Practices.Prism, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
60+
<HintPath>..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll</HintPath>
61+
<Private>False</Private>
62+
</Reference>
63+
<Reference Include="Microsoft.Practices.Prism.Interactivity, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
64+
<HintPath>..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll</HintPath>
65+
<Private>False</Private>
66+
</Reference>
67+
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
68+
<HintPath>..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll</HintPath>
69+
<Private>False</Private>
70+
</Reference>
71+
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
72+
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
73+
<Private>False</Private>
74+
</Reference>
75+
<Reference Include="ProtoCore, Version=1.0.0.1431, Culture=neutral, processorArchitecture=MSIL">
76+
<HintPath>..\packages\DynamoVisualProgramming.Core.1.0.0\lib\net45\ProtoCore.dll</HintPath>
77+
<Private>False</Private>
78+
</Reference>
79+
<Reference Include="ProtoGeometry, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
80+
<HintPath>..\packages\DynamoVisualProgramming.ZeroTouchLibrary.1.0.0\lib\net45\ProtoGeometry.dll</HintPath>
4081
<Private>False</Private>
4182
</Reference>
4283
<Reference Include="System" />
4384
<Reference Include="System.Core" />
85+
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
86+
<HintPath>..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll</HintPath>
87+
<Private>True</Private>
88+
<Private>False</Private>
89+
</Reference>
4490
<Reference Include="System.Xml.Linq" />
4591
<Reference Include="System.Data.DataSetExtensions" />
4692
<Reference Include="Microsoft.CSharp" />
@@ -59,11 +105,10 @@
59105
</ProjectReference>
60106
</ItemGroup>
61107
<ItemGroup>
108+
<None Include="packages.config" />
62109
<None Include="pkg.json" />
63110
</ItemGroup>
64111
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
65-
66-
67112
<Target Name="AfterBuild">
68113
<ItemGroup>
69114
<SourceDlls Include="$(TargetDir)*.dll" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="CommonServiceLocator" version="1.0" targetFramework="net45" />
4+
<package id="DynamoVisualProgramming.Core" version="1.0.0" targetFramework="net45" />
5+
<package id="DynamoVisualProgramming.DynamoServices" version="1.0.0" targetFramework="net45" />
6+
<package id="DynamoVisualProgramming.ZeroTouchLibrary" version="1.0.0" targetFramework="net45" />
7+
<package id="NUnit" version="2.6.3" targetFramework="net45" />
8+
<package id="Prism" version="4.1.0.0" targetFramework="net45" />
9+
</packages>

HelloDynamo/HelloNodeModel/pkg.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"repository_url":"",
1616
"contains_binaries":true,
1717
"node_libraries":[
18-
"HelloNodeModel, Version=1.0.0, Culture=neutral, PublicKeyToken=null"
18+
"HelloNodeModel, Version=1.0.0, Culture=neutral, PublicKeyToken=null",
19+
"Hello, Version=1.0.0, Culture=neutral, PublicKeyToken=null"
1920
]
2021
}

0 commit comments

Comments
 (0)