Description:
Preliminary addition of IronPython.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
|
1 | NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -1,4 +1,5 | |||
|
1 | 1 | using System.Collections.Generic; |
|
2 | using System.Threading.Tasks; | |
|
2 | 3 | using System.Linq; |
|
3 | 4 | using Microsoft.Xna.Framework; |
|
4 | 5 | using Microsoft.Xna.Framework.Audio; |
@@ -7,7 +8,6 | |||
|
7 | 8 | using Microsoft.Xna.Framework.Media; |
|
8 | 9 | |
|
9 | 10 | |
|
10 | ||
|
11 | 11 | using System; |
|
12 | 12 | using System.IO; |
|
13 | 13 | using SpriteFontPlus; |
@@ -90,6 +90,18 | |||
|
90 | 90 | #if NETCOREAPP |
|
91 | 91 | DllMap.Initialise(false); |
|
92 | 92 | #endif |
|
93 | Microsoft.Scripting.Hosting.ScriptEngine pythonEngine = IronPython.Hosting.Python.CreateEngine(); | |
|
94 | ||
|
95 | ICollection<string> searchPaths = pythonEngine.GetSearchPaths(); | |
|
96 | // searchPaths.Add("..\\.."); | |
|
97 | searchPaths.Add("..\\..\\.."); | |
|
98 | searchPaths.Add("."); | |
|
99 | pythonEngine.SetSearchPaths(searchPaths); | |
|
100 | ||
|
101 | Microsoft.Scripting.Hosting.ScriptScope scope = IronPython.Hosting.Python.ImportModule(pythonEngine, "Main"); | |
|
102 | ||
|
103 | dynamic print_test = scope.GetVariable("print_test"); | |
|
104 | print_test(); | |
|
93 | 105 | using FNAGame g = new FNAGame(); |
|
94 | 106 | g.Run(); |
|
95 | 107 | } |
@@ -25,6 +25,7 | |||
|
25 | 25 | <Content Include="Content\**\*.*"> |
|
26 | 26 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
|
27 | 27 | </Content> |
|
28 | <Content Include="Main.py" CopyToOutputDirectory="PreserveNewest" /> | |
|
28 | 29 | </ItemGroup> |
|
29 | 30 | <ItemGroup> |
|
30 | 31 | <ProjectReference Include="..\FNA\FNA.Core.csproj" /> |
@@ -51,6 +52,7 | |||
|
51 | 52 | <!-- <Import Project="..\build\CopyFNALibs.targets"/> --> |
|
52 | 53 | <ItemGroup> |
|
53 | 54 | <PackageReference Include="ImGui.NET" Version="1.78.0" /> |
|
55 | <PackageReference Include="IronPython" Version="2.7.11" /> | |
|
54 | 56 | <PackageReference Include="Tracery.Net" Version="1.0.0" /> |
|
55 | 57 | <PackageReference Include="YamlDotNet" Version="9.1.4" /> |
|
56 | 58 | </ItemGroup> |
@@ -85,6 +85,7 | |||
|
85 | 85 | <Content Include="cimgui/win-x64/cimgui.dll" CopyToOutputDirectory="PreserveNewest" /> |
|
86 | 86 | <Content Include="cimgui/osx-x64/cimgui.dylib" CopyToOutputDirectory="PreserveNewest" Link="libcimgui.dylib" /> |
|
87 | 87 | <Content Include="cimgui/linux-x64/cimgui.so" CopyToOutputDirectory="PreserveNewest" Link="libcimgui.so" /> |
|
88 | <Content Include="Main.py" CopyToOutputDirectory="PreserveNewest" /> | |
|
88 | 89 | |
|
89 | 90 | <None Include="fnalibs\README.txt" /> |
|
90 | 91 | <None Include="fnalibs\lib64\libFAudio.so.0" /> |
@@ -166,6 +167,15 | |||
|
166 | 167 | <Reference Include="System.ServiceProcess" /> |
|
167 | 168 | <Reference Include="System.Transactions" /> |
|
168 | 169 | <Reference Include="WindowsBase" /> |
|
170 | <Reference Include="IronPython"> | |
|
171 | <!-- <HintPath>..\packages\IronPython.2.7.11\lib\Net45\IronPython.dll</HintPath> --> | |
|
172 | </Reference> | |
|
173 | <Reference Include="Microsoft.Dynamic"> | |
|
174 | <!-- <HintPath>..\packages\IronPython.2.7.11\lib\Net45\Microsoft.Dynamic.dll</HintPath> --> | |
|
175 | </Reference> | |
|
176 | <Reference Include="Microsoft.Scripting"> | |
|
177 | <!-- <HintPath>..\packages\IronPython.2.7.11\lib\Net45\Microsoft.Scripting.dll</HintPath> --> | |
|
178 | </Reference> | |
|
169 | 179 | </ItemGroup> |
|
170 | 180 | <ItemGroup> |
|
171 | 181 | <Folder Include="Utils\" /> |
@@ -10,5 +10,6 | |||
|
10 | 10 | <package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net461" /> |
|
11 | 11 | <package id="YamlDotNet" version="9.1.4" targetFramework="net461" /> |
|
12 | 12 | <package id="Tracery.Net" version="1.0.0" targetFramework="net461" /> |
|
13 | <package id="IronPython" version="2.7.11" targetFramework="net461" /> | |
|
13 | 14 | <!-- <package id="YamlDotNet" version="4.0.0" targetFramework="net461" /> --> |
|
14 | 15 | </packages> |
You need to be logged in to leave comments.
Login now