Skip to content

Commit

Permalink
works for net6, still need to test net8
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkkirschner committed Dec 6, 2023
1 parent ea0e83c commit b0623e0
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 25 deletions.
7 changes: 7 additions & 0 deletions Config/shared.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!--<OutputPath Condition=" '$(OutputPath)' == '' ">$(SolutionDir)bin\$(Platform)\$(Configuration)</OutputPath>-->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
</Project>
57 changes: 38 additions & 19 deletions DSIronPython/DSIronPython.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{9EEF4F42-6B3B-4358-9A8A-C2701539A822}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DSIronPython</RootNamespace>
<AssemblyName>DSIronPython</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DynamoVisualProgramming.Core" Version="3.0.0-beta7023" />
<PackageReference Include="IronPython" Version="2.7.12" />
<PackageReference Include="IronPython.StdLib" Version="2.7.12" />
<ImportGroup Label="PropertySheets">
<Import Project="$(SolutionDir)Config\shared.props" />
</ImportGroup>
<PropertyGroup>
<OutputPath>$(SolutionDir)\package_output\DSIronPython\bin\</OutputPath>
<ProjectGuid>{9EEF4F42-6B3B-4358-9A8A-C2701539A822}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DSIronPython</RootNamespace>
<AssemblyName>DSIronPython</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DynamoVisualProgramming.Core" Version="3.0.0-beta7023">
<IncludeAssets></IncludeAssets>
<ExcludeAssets>runtime</ExcludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="IronPython" Version="2.7.12" />
<PackageReference Include="IronPython.StdLib" Version="2.7.12" />


</ItemGroup>
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>IronPythonTests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<Target Name="AfterBuildOps" AfterTargets="Build">
<ItemGroup>
<PythonStdLib Include="$(ProjectDir)..\..\packages\IronPython.StdLib.2.7.9\contentFiles\any\any\Lib\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(PythonStdLib)" DestinationFiles="@(PythonStdLib->'$(TargetDir)IronPython.StdLib.2.7.9\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
</Target>

<Target Name="Move python libs to extra" AfterTargets="Build">
<ItemGroup>
<MySourceFiles Include="$(OutputPath)\*lib\**;" />
</ItemGroup>

<Move SourceFiles="@(MySourceFiles)" DestinationFiles="$(OutputPath)..\extra\%(RecursiveDir)%(Filename)%(Extension)" />
</Target>

<Target Name="Remove Lib" AfterTargets="Move python libs to extra">
<RemoveDir Directories="$(OutputPath)\lib" />
</Target>

<Target Name="copypkgjson" AfterTargets="Build">
<Copy SourceFiles="pkg.json" DestinationFolder="$(OutputPath)..\"/>
</Target>
</Project>
6 changes: 3 additions & 3 deletions DSIronPython/pkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"license": "",
"file_hash": null,
"name": "DynamoIronPython2.7",
"version": "2.5.0",
"version": "3.0.0",
"description": "*** This is the official version of the IronPython Extension which will load the IronPython2 evaluation engine for Dynamo. *** \r\n\r\nIf you see the following warning 'The configured Python engine could not be found' when you try to run a Python Script node which is set to use IronPython2, the host application for Dynamo (Such as Revit or Civil 3d) will have chosen to exclude IronPython2 as default installed content and you will need to download this extension in order to enable IronPython2 again.\r\n\r\nYou have the ability to either download this IronPython2 Extension or use the alternative out-of-the-box CPython3 engine and migrate your legacy IronPython2 code to CPython3. While there are differences in language the Python basis is the same and we have provided a Migration Assistant to help you migrate your code to Python3.",
"group": "",
"keywords": [ "python", "ironpython" ],
"dependencies": [],
"host_dependencies": [ "Revit", "Civil 3D", "Alias", "Advance Steel", "FormIt" ],
"contents": "",
"engine_version": "2.13.0",
"engine_version": "3.0.0",
"engine": "dynamo",
"engine_metadata": "This pacakge is compatible with Dynamo2.13.0 release or newer",
"engine_metadata": "Version 3.0 of this pacakge is compatible with Dynamo 3.0.0 release or newer",
"site_url": "https://dynamobim.org/",
"repository_url": "https://github.com/DynamoDS/Dynamo",
"contains_binaries": true,
Expand Down
6 changes: 5 additions & 1 deletion IronPythonExtension/IronPythonExtension.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<ImportGroup Label="PropertySheets">
<Import Project="$(SolutionDir)Config\shared.props" />
</ImportGroup>
<PropertyGroup>
<OutputPath>$(SolutionDir)\package_output\DSIronPython\bin\</OutputPath>
<ProjectGuid>{182FCA4E-B6EF-451F-9EC4-7BF2C622F4F7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
Expand All @@ -17,6 +21,6 @@
<ItemGroup>
<ExtensionDefinition Include="IronPythonExtension_ExtensionDefinition.xml" />
</ItemGroup>
<Copy SourceFiles="@(ExtensionDefinition)" DestinationFolder="$(OutputPath)\extensions\" />
<Copy SourceFiles="@(ExtensionDefinition)" DestinationFolder="$(OutputPath)..\extra" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ExtensionDefinition>
<AssemblyPath>..\IronPythonExtension.dll</AssemblyPath>
<AssemblyPath>..\bin\IronPythonExtension.dll</AssemblyPath>
<TypeName>IronPythonExtension.IronPythonExtension</TypeName>
</ExtensionDefinition>
3 changes: 3 additions & 0 deletions IronPythonTests/IronPythonTests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<ImportGroup Label="PropertySheets">
<Import Project="$(SolutionDir)Config\shared.props" />
</ImportGroup>
<PropertyGroup>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# DSIronPython
# DSIronPython

Contains the DSIronPython package for using the legacy IronPython2 engine in Dynamo.
Building this soluton will produce a dynamo package containing the python engine and an extension to load it.
This repo is a WIP.

0 comments on commit b0623e0

Please sign in to comment.