Skip to content

Commit 7f05c7b

Browse files
author
dse
committed
NetCoreApp 2.0 target added, compile issues fixed, CI system improved.
1 parent 6cebb5d commit 7f05c7b

15 files changed

+140
-26
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ install:
169169
script:
170170
- python -m pytest
171171
- mono $NUNIT_PATH src/embed_tests/bin/Python.EmbeddingTest.dll
172+
- if [[ $BUILD_OPTS == --xplat ]]; then dotnet src/embed_tests/bin/netcoreapp2.0_publish/Python.EmbeddingTest.dll; fi
172173

173174
after_script:
174175
# Uncomment if need to geninterop, ie. py37 final

appveyor.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,23 @@ environment:
3030
BUILD_OPTS: --xplat
3131
- PYTHON_VERSION: 3.6
3232
BUILD_OPTS: --xplat
33-
33+
matrix:
34+
exclude:
35+
- PYTHON_VERSION: 2.7
36+
BUILD_OPTS: --xplat
37+
platform: x86
38+
- PYTHON_VERSION: 3.3
39+
BUILD_OPTS: --xplat
40+
platform: x86
41+
- PYTHON_VERSION: 3.4
42+
BUILD_OPTS: --xplat
43+
platform: x86
44+
- PYTHON_VERSION: 3.5
45+
BUILD_OPTS: --xplat
46+
platform: x86
47+
- PYTHON_VERSION: 3.6
48+
BUILD_OPTS: --xplat
49+
platform: x86
3450
init:
3551
# Update Environment Variables based on matrix/platform
3652
- set PY_VER=%PYTHON_VERSION:.=%
@@ -43,6 +59,8 @@ init:
4359
install:
4460
- pip install --upgrade -r requirements.txt --quiet
4561
- choco install vswhere -y
62+
# - cmd: curl -O https://download.microsoft.com/download/5/6/B/56BFEF92-9045-4414-970C-AB31E0FC07EC/dotnet-runtime-2.0.0-win-x86.exe
63+
# - cmd: dotnet-runtime-2.0.0-win-x86.exe /install /quiet /norestart /log install.log
4664

4765
# Install OpenCover. Can't put on `packages.config`, not Mono compatible
4866
- .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages -Verbosity quiet

ci/appveyor_run_tests.ps1

+17
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@ if ($CS_STATUS -ne 0) {
4444
Write-Host "Embedded tests failed" -ForegroundColor "Red"
4545
}
4646

47+
if ($env:BUILD_OPTS -eq "--xplat"){
48+
if ($env:PLATFORM -eq "x64") {
49+
$DOTNET_CMD = "dotnet"
50+
}
51+
else{
52+
$DOTNET_CMD = "c:\Program Files (x86)\dotnet\dotnet"
53+
}
54+
55+
# Run Embedded tests for netcoreapp2.0 (OpenCover currently does not supports dotnet core)
56+
Write-Host ("Starting embedded tests for netcoreapp2.0") -ForegroundColor "Green"
57+
&$DOTNET_CMD .\src\embed_tests\bin\netcoreapp2.0_publish\Python.EmbeddingTest.dll
58+
$CS_STATUS = $LastExitCode
59+
if ($CS_STATUS -ne 0) {
60+
Write-Host "Embedded tests for netcoreapp2.0 failed" -ForegroundColor "Red"
61+
}
62+
}
63+
4764
# Set exit code to fail if either Python or Embedded tests failed
4865
if ($PYTHON_STATUS -ne 0 -or $CS_STATUS -ne 0) {
4966
Write-Host "Tests failed" -ForegroundColor "Red"

setup.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,11 @@ def build_extension(self, ext):
257257

258258
subprocess.check_call(" ".join(cmd + ["/t:Clean"]), shell=use_shell)
259259
subprocess.check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
260-
260+
if DEVTOOLS == "MsDev15":
261+
subprocess.check_call(" ".join(cmd + ["/t:Console_15:publish;Python_EmbeddingTest_15:publish", "/p:TargetFramework=netcoreapp2.0"]), shell=use_shell)
262+
elif DEVTOOLS == "dotnet":
263+
subprocess.check_call(" ".join(cmd + ["/t:publish", "/p:TargetFramework=netcoreapp2.0"]), shell=use_shell)
264+
261265
if DEVTOOLS == "Mono" or DEVTOOLS == "dotnet":
262266
self._build_monoclr()
263267

src/clrmodule/clrmodule.15.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<NoWarn>1591</NoWarn>
2323
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
2424
<PythonBuildDir Condition=" '$(PythonBuildDir)' == '' ">$(SolutionDir)\bin\</PythonBuildDir>
25+
<PythonBuildDir Condition="'$(TargetFramework)'!='net40'">$(PythonBuildDir)\$(TargetFramework)\</PythonBuildDir>
2526
<LangVersion>6</LangVersion>
2627
<ErrorReport>prompt</ErrorReport>
2728
<CustomDefineConstants Condition="'$(CustomDefineConstants)' == ''">$(PYTHONNET_DEFINE_CONSTANTS)</CustomDefineConstants>

src/console/Console.15.csproj

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
33
<PropertyGroup>
4-
<TargetFrameworks>net40</TargetFrameworks>
4+
<TargetFrameworks>net40;netcoreapp2.0</TargetFrameworks>
55
<Platforms>x64;x86</Platforms>
66
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
77
<OutputType>Exe</OutputType>
@@ -15,12 +15,14 @@
1515
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1616
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
1717
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
18-
<DocumentationFile>bin\nPython.xml</DocumentationFile>
1918
<OutputPath>bin\</OutputPath>
20-
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
19+
<AppendTargetFrameworkToOutputPath Condition="'$(TargetFramework)'=='net40'">false</AppendTargetFrameworkToOutputPath>
20+
<DocumentationFile Condition="'$(TargetFramework)'=='net40'">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
21+
<DocumentationFile Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
2122
<NoWarn>1591</NoWarn>
2223
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
2324
<PythonBuildDir Condition=" '$(PythonBuildDir)' == '' ">$(SolutionDir)\bin\</PythonBuildDir>
25+
<PublishDir Condition="'$(TargetFramework)'!='net40'">$(PythonBuildDir)\$(TargetFramework)\</PublishDir>
2426
<LangVersion>6</LangVersion>
2527
<ApplicationIcon>python-clear.ico</ApplicationIcon>
2628
<ErrorReport>prompt</ErrorReport>
@@ -88,7 +90,7 @@
8890
</ItemGroup>
8991
<ItemGroup>
9092
<Content Include="python-clear.ico" />
91-
<EmbeddedResource Include="$(PythonBuildDir)\Python.Runtime.dll">
93+
<EmbeddedResource Condition="'$(TargetFramework)'=='net40'" Include="$(PythonBuildDir)\Python.Runtime.dll">
9294
<LogicalName>Python.Runtime.dll</LogicalName>
9395
</EmbeddedResource>
9496
</ItemGroup>
@@ -99,6 +101,6 @@
99101
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
100102

101103
<Target Name="AfterBuild">
102-
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PythonBuildDir)" />
104+
<Copy Condition="'$(TargetFramework)'=='net40'" SourceFiles="$(TargetPath)" DestinationFolder="$(PythonBuildDir)" />
103105
</Target>
104106
</Project>

src/console/pythonconsole.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ namespace Python.Runtime
1616
/// </remarks>
1717
public sealed class PythonConsole
1818
{
19+
#if NET40
1920
private static AssemblyLoader assemblyLoader = new AssemblyLoader();
20-
21+
#endif
2122
private PythonConsole()
2223
{
2324
}
2425

2526
[STAThread]
2627
public static int Main(string[] args)
2728
{
29+
// Only net40 is capable to safely inject python.runtime.dll into resources.
30+
#if NET40
2831
// reference the static assemblyLoader to stop it being optimized away
2932
AssemblyLoader a = assemblyLoader;
30-
33+
#endif
3134
string[] cmd = Environment.GetCommandLineArgs();
3235
PythonEngine.Initialize();
3336

@@ -37,6 +40,7 @@ public static int Main(string[] args)
3740
return i;
3841
}
3942

43+
#if NET40
4044
// Register a callback function to load embedded assemblies.
4145
// (Python.Runtime.dll is included as a resource)
4246
private sealed class AssemblyLoader
@@ -73,5 +77,6 @@ public AssemblyLoader()
7377
};
7478
}
7579
}
80+
#endif
7681
}
7782
}

src/embed_tests/Program.cs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
3+
using NUnit.Common;
4+
5+
using NUnitLite;
6+
7+
namespace Python.EmbeddingTest
8+
{
9+
public class Program
10+
{
11+
public static int Main(string[] args)
12+
{
13+
return new AutoRun(typeof(Program).Assembly).Execute(
14+
args,
15+
new ExtendedTextWrapper(Console.Out),
16+
Console.In);
17+
}
18+
}
19+
}

src/embed_tests/Python.EmbeddingTest.15.csproj

+15-7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>net40</TargetFrameworks>
5+
<TargetFrameworks>net40;netcoreapp2.0</TargetFrameworks>
66
<Platforms>x64;x86</Platforms>
77
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
8-
<AssetTargetFallback Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">net45</AssetTargetFallback>
8+
<OutputType Condition="'$(TargetFramework)' != 'net40' OR '$(PYTHONNET_VS_ENV)' == 'true'">Exe</OutputType>
9+
<GenerateProgramFile>false</GenerateProgramFile>
910
<AssemblyName>Python.EmbeddingTest</AssemblyName>
1011
<RootNamespace>Python.EmbeddingTest</RootNamespace>
1112
<PackageId>Python.EmbeddingTest</PackageId>
@@ -15,16 +16,19 @@
1516
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1617
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1718
<OutputPath>bin\</OutputPath>
18-
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
19-
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
19+
<AppendTargetFrameworkToOutputPath Condition="'$(TargetFramework)'=='net40'">false</AppendTargetFrameworkToOutputPath>
20+
<DocumentationFile Condition="'$(TargetFramework)'=='net40'">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
21+
<DocumentationFile Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
2022
<NoWarn>1591</NoWarn>
2123
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
22-
<PythonBuildDir Condition=" '$(PythonBuildDir)' == '' ">$(SolutionDir)\bin\</PythonBuildDir>
24+
<PythonBuildDir Condition="'$(TargetFramework)'=='net40' AND '$(PythonBuildDir)' == ''">$(SolutionDir)\bin\</PythonBuildDir>
25+
<PublishDir Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)_publish</PublishDir>
2326
<LangVersion>6</LangVersion>
2427
<ErrorReport>prompt</ErrorReport>
2528
<CustomDefineConstants Condition="'$(CustomDefineConstants)' == ''">$(PYTHONNET_DEFINE_CONSTANTS)</CustomDefineConstants>
2629
<BaseDefineConstants>XPLAT</BaseDefineConstants>
2730
<DefineConstants>$(DefineConstants);$(CustomDefineConstants);$(BaseDefineConstants);</DefineConstants>
31+
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(DefineConstants);NETCOREAPP</DefineConstants>
2832
<FrameworkPathOverride Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">$(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.5\1.0.1\lib\net45\</FrameworkPathOverride>
2933
</PropertyGroup>
3034
<PropertyGroup Condition=" '$(Platform)' == 'x86'">
@@ -87,8 +91,12 @@
8791
<ItemGroup>
8892
<PackageReference Include="NUnit" Version="3.7.1" />
8993
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" />
94+
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
95+
<PackageReference Include="NUnitLite" Version="3.7.2" />
96+
</ItemGroup>
97+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
98+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
9099
</ItemGroup>
91-
92100
<ItemGroup>
93101
<ProjectReference Include="..\runtime\Python.Runtime.15.csproj" />
94102
</ItemGroup>
@@ -113,7 +121,7 @@
113121
</PropertyGroup>
114122

115123
<Target Name="AfterBuild">
116-
<Copy SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
124+
<Copy Condition="'$(TargetFramework)'=='net40'" SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
117125
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
118126
</Target>
119127

src/embed_tests/pyimport.cs

+4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ public void SetUp()
3030
/* Append the tests directory to sys.path
3131
* using reflection to circumvent the private
3232
* modifiers placed on most Runtime methods. */
33+
#if NETCOREAPP
34+
const string s = "../../fixtures";
35+
#else
3336
const string s = "../fixtures";
37+
#endif
3438
string testPath = Path.Combine(TestContext.CurrentContext.TestDirectory, s);
3539

3640
IntPtr str = Runtime.Runtime.PyString_FromString(testPath);

src/runtime/Python.Runtime.15.csproj

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
33
<PropertyGroup>
4-
<TargetFrameworks>net40</TargetFrameworks>
4+
<TargetFrameworks>net40;netcoreapp2.0</TargetFrameworks>
55
<Platforms>AnyCPU</Platforms>
66
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
77
<AssetTargetFallback Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">net45</AssetTargetFallback>
@@ -16,17 +16,20 @@
1616
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
1717
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
1818
<OutputPath>bin\</OutputPath>
19-
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
20-
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
19+
<AppendTargetFrameworkToOutputPath Condition="'$(TargetFramework)'=='net40'">false</AppendTargetFrameworkToOutputPath>
20+
<DocumentationFile Condition="'$(TargetFramework)'=='net40'">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
21+
<DocumentationFile Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
2122
<NoWarn>1591;NU1701</NoWarn>
2223
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
23-
<PythonBuildDir Condition=" '$(PythonBuildDir)' == '' ">$(SolutionDir)\bin\</PythonBuildDir>
24+
<PythonBuildDir Condition="'$(PythonBuildDir)' == ''">$(SolutionDir)\bin\</PythonBuildDir>
25+
<PublishDir Condition="'$(TargetFramework)'!='net40'">$(PythonBuildDir)\$(TargetFramework)\</PublishDir>
2426
<LangVersion>6</LangVersion>
2527
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
2628
<AssemblyOriginatorKeyFile>..\pythonnet.snk</AssemblyOriginatorKeyFile>
2729
<CustomDefineConstants Condition="'$(CustomDefineConstants)' == ''">$(PYTHONNET_DEFINE_CONSTANTS)</CustomDefineConstants>
2830
<BaseDefineConstants>XPLAT</BaseDefineConstants>
2931
<DefineConstants>$(DefineConstants);$(CustomDefineConstants);$(BaseDefineConstants);</DefineConstants>
32+
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(DefineConstants);NETCOREAPP</DefineConstants>
3033
<FrameworkPathOverride Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">$(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.5\1.0.1\lib\net45\</FrameworkPathOverride>
3134
</PropertyGroup>
3235

@@ -98,6 +101,12 @@
98101
</EmbeddedResource>
99102
</ItemGroup>
100103

104+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
105+
<PackageReference Include="System.Security.Permissions">
106+
<Version>4.4.0</Version>
107+
</PackageReference>
108+
</ItemGroup>
109+
101110
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
102111
<Reference Include="Microsoft.CSharp" />
103112
</ItemGroup>
@@ -118,7 +127,7 @@
118127
<Exec Command="cp $(NuGetPackageRoot)/microsoft.targetingpack.netframework.v4.5/1.0.1/lib/net45/System.XML.dll $(NuGetPackageRoot)/microsoft.targetingpack.netframework.v4.5/1.0.1/lib/net45/System.Xml.dll" />
119128
</Target>
120129
<Target Name="AfterBuild">
121-
<Copy SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
130+
<Copy Condition="'$(TargetFramework)'=='net40'" SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
122131
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
123132
</Target>
124133
</Project>

src/runtime/nativecall.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,19 @@ private static void GenerateThunk(TypeBuilder tb, MethodInfo method)
106106

107107
il.Emit(OpCodes.Ldarg_1);
108108

109+
#if NETCOREAPP
110+
il.EmitCalli(OpCodes.Calli,
111+
CallingConventions.ExplicitThis,
112+
method.ReturnType,
113+
nargs, null
114+
);
115+
#else
109116
il.EmitCalli(OpCodes.Calli,
110117
CallingConvention.Cdecl,
111118
method.ReturnType,
112119
nargs
113120
);
114-
121+
#endif
115122
il.Emit(OpCodes.Ret);
116123

117124
tb.DefineMethodOverride(mb, method);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Reflection;
3+
using System.Reflection.Emit;
4+
5+
namespace Python.Runtime
6+
{
7+
public static class ReflectionPolifills
8+
{
9+
#if NETCOREAPP
10+
public static AssemblyBuilder DefineDynamicAssembly(this AppDomain appDomain, AssemblyName assemblyName, AssemblyBuilderAccess assemblyBuilderAccess)
11+
{
12+
return AssemblyBuilder.DefineDynamicAssembly(assemblyName, assemblyBuilderAccess);
13+
}
14+
#endif
15+
}
16+
}

src/testing/Python.Test.15.csproj

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<Project>
22
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
33
<PropertyGroup>
4-
<TargetFrameworks>net40</TargetFrameworks>
4+
<TargetFrameworks>net40;netcoreapp2.0</TargetFrameworks>
55
<Platforms>x64;x86</Platforms>
66
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
77
<AssemblyName>Python.Test</AssemblyName>
88
<RootNamespace>Python.Test</RootNamespace>
99
<PackageId>Python.Test</PackageId>
1010
<VersionPrefix>2.4.0</VersionPrefix>
11-
<DocumentationFile>bin\Python.Test.xml</DocumentationFile>
1211
<OutputPath>bin\</OutputPath>
13-
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
12+
<AppendTargetFrameworkToOutputPath Condition="'$(TargetFramework)'=='net40'">false</AppendTargetFrameworkToOutputPath>
13+
<DocumentationFile Condition="'$(TargetFramework)'=='net40'">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
14+
<DocumentationFile Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
1415
<NoWarn>1591,0067</NoWarn>
1516
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
1617
<PythonBuildDir Condition=" '$(PythonBuildDir)' == '' ">$(SolutionDir)\bin\</PythonBuildDir>
18+
<PythonBuildDir Condition="'$(TargetFramework)'!='net40'">$(PythonBuildDir)\$(TargetFramework)\</PythonBuildDir>
1719
<LangVersion>6</LangVersion>
1820
<SignAssembly>false</SignAssembly>
1921
<AssemblyOriginatorKeyFile>..\pythonnet.snk</AssemblyOriginatorKeyFile>
@@ -85,7 +87,8 @@
8587
<TargetAssemblyPdb>$(TargetDir)$(TargetName).pdb</TargetAssemblyPdb>
8688
</PropertyGroup>
8789
<Target Name="AfterBuild">
88-
<Copy SourceFiles="$(TargetAssembly)" DestinationFolder="$(SolutionDir)\src\tests\fixtures" />
90+
<Copy Condition="'$(TargetFramework)'=='net40'" SourceFiles="$(TargetAssembly)" DestinationFolder="$(SolutionDir)\src\tests\fixtures" />
91+
<Copy Condition="'$(TargetFramework)'!='net40'" SourceFiles="$(TargetAssembly)" DestinationFolder="$(SolutionDir)\src\tests\fixtures\$(TargetFramework)" />
8992
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
9093
</Target>
9194
</Project>

src/tests/fixtures/netcoreapp2.0/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)