Skip to content

Commit 409adf5

Browse files
committed
Imageflow.NativeRuntime and Imageflow.NativeTool now only use a .targets file for win-x86, win-x64, win-arm64, and that target file only copies when TargetFrameworkIdentifier != '.NETCoreApp'. Target file no longer sets pack=true on copied content file.
1 parent ebf01cf commit 409adf5

11 files changed

+33
-36
lines changed

dotnet/nuget/native/Imageflow.NativeTool.Common.targets

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121
<EnableDefaultContentItems>false</EnableDefaultContentItems>
2222

2323
<!-- Ensure the RID-specific parent project sets ImageflowNugetRid -->
24-
<NativeToolFileName Condition="'$(OS)' == 'Windows_NT'">imageflow_tool.exe</NativeToolFileName>
25-
<NativeToolFileName Condition="'$(OS)' != 'Windows_NT'">imageflow_tool</NativeToolFileName>
24+
<NativeToolFileName Condition="'$(IsWindowsRid)' == 'true'">imageflow_tool.exe</NativeToolFileName>
25+
<NativeToolFileName Condition="'$(IsWindowsRid)' != 'true'">imageflow_tool</NativeToolFileName>
2626
<FullNativeToolPath Condition="Exists('$(NativeArtifactBasePath)/$(ImageflowNugetRid)/$(NativeToolFileName)')">$(NativeArtifactBasePath)/$(ImageflowNugetRid)/$(NativeToolFileName)</FullNativeToolPath>
2727

28-
<!-- Determine if .targets file should be included (Windows x86/x64/arm64) -->
28+
<!-- Determine if .targets file should be included in '/build/' (Windows x86/x64/arm64) -->
2929
<IncludeTargets Condition=" '$(IsWindowsRid)' == 'true' ">true</IncludeTargets>
3030
<IncludeTargets Condition=" '$(IncludeTargets)' == '' ">false</IncludeTargets>
31-
<IncludeTransitiveTargets Condition=" '$(IncludeTransitiveTargets)' == '' ">true</IncludeTransitiveTargets>
31+
<!-- Determine if .targets file should be included in '/buildTransitive/' (Windows x86/x64/arm64) -->
32+
<IncludeTransitiveTargets Condition=" '$(IncludeTransitiveTargets)' == 'true' ">true</IncludeTransitiveTargets>
33+
34+
3235
<!-- disable CS2008: No source files specified -->
3336
<NoWarn>$(NoWarn);CS2008</NoWarn>
3437
<!-- Error out if the expected native tool isn't found -->

dotnet/nuget/native/targets/Imageflow.NativeRuntime.win-arm64.targets

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
<!-- This file is included by Imageflow.NativeRuntime.Common.targets when ImageflowNugetRid is win-arm64 -->
44
<!-- It includes the native libraries in the build output and NuGet package. -->
55

6-
7-
<!-- If RID is set, let the system copy it instead. Only copy on Windows. -->
8-
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(OS)' == 'Windows_NT' ">
6+
<!-- If RID is set, let the system copy it instead. Only copy if the current project is not .NET Core. -->
7+
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp' ">
98
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/win-arm64/native/*">
109
<Link>runtimes/win-arm64/native/imageflow.dll</Link>
1110
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1211
<Visible>False</Visible>
1312
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
14-
<Pack>true</Pack>
13+
<Pack>False</Pack>
1514
<PackagePath>runtimes/win-arm64/native/imageflow.dll</PackagePath>
1615
</Content>
1716
</ItemGroup>

dotnet/nuget/native/targets/Imageflow.NativeRuntime.win-x64.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<!-- This file is included by Imageflow.NativeRuntime.Common.targets when ImageflowNugetRid is win-x64 -->
44
<!-- It includes the native libraries in the build output and NuGet package. -->
55

6-
<!-- If RID is set, let the system copy it instead. Only copy on Windows. -->
7-
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(OS)' == 'Windows_NT' ">
6+
<!-- If RID is set, let the system copy it instead. Only copy if the current project is not .NET Core. -->
7+
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp' ">
88
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/win-x64/native/*">
99
<Link>runtimes/win-x64/native/imageflow.dll</Link>
1010
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1111
<Visible>False</Visible>
1212
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
13-
<Pack>true</Pack>
13+
<Pack>False</Pack>
1414
<PackagePath>runtimes/win-x64/native/imageflow.dll</PackagePath>
1515
</Content>
1616
</ItemGroup>

dotnet/nuget/native/targets/Imageflow.NativeRuntime.win-x86.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<!-- This file is included by Imageflow.NativeRuntime.Common.targets when ImageflowNugetRid is win-x86 -->
44
<!-- It includes the native libraries in the build output and NuGet package. -->
55

6-
<!-- If RID is set, let the system copy it instead. Only copy on Windows. -->
7-
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(OS)' == 'Windows_NT' ">
6+
<!-- If RID is set, let the system copy it instead. Only copy if the current project is not .NET Core. -->
7+
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp' ">
88
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/win-x86/native/*">
99
<Link>runtimes/win-x86/native/imageflow.dll</Link>
1010
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1111
<Visible>False</Visible>
1212
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
13-
<Pack>true</Pack>
13+
<Pack>False</Pack>
1414
<PackagePath>runtimes/win-x86/native/imageflow.dll</PackagePath>
1515
</Content>
1616
</ItemGroup>

dotnet/nuget/native/targets/Imageflow.NativeTool.linux-arm64.targets

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2+
<!-- useless file because: .NET core always copies it for us -->
23
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
4-
5-
6-
<!-- Copy when RID is not set and target framework is not .NET Framework. Or, when RID matches-->
4+
<!-- Copy when RID is not set and target framework is not .NET Core. Or, when RID matches-->
75
<PropertyGroup>
8-
<NativeToolMightBeNeeded Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETFramework' ">true</NativeToolMightBeNeeded>
6+
<NativeToolMightBeNeeded Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp' ">true</NativeToolMightBeNeeded>
97
</PropertyGroup>
108

119
<ItemGroup Condition=" '$(NativeToolMightBeNeeded)' == 'true' OR '$(RuntimeIdentifier)' == 'linux-arm64' ">

dotnet/nuget/native/targets/Imageflow.NativeTool.linux-x64.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2+
<!-- useless file because: .NET core always copies it for us -->
23
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
44
<!-- Copy when RID is not set and target framework is not .NET Framework. Or, when RID matches-->
55
<PropertyGroup>
66
<NativeToolMightBeNeeded Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETFramework' ">true</NativeToolMightBeNeeded>

dotnet/nuget/native/targets/Imageflow.NativeTool.osx-arm64.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2+
<!-- useless file because: .NET core always copies it for us -->
23
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
4+
45
<!-- Copy when RID is not set and target framework is not .NET Framework. Or, when RID matches-->
56
<PropertyGroup>
67
<NativeToolMightBeNeeded Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETFramework' ">true</NativeToolMightBeNeeded>

dotnet/nuget/native/targets/Imageflow.NativeTool.osx-x64.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2+
<!-- useless file because: .NET core always copies it for us -->
23
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
34

45
<!-- Copy when RID is not set and target framework is not .NET Framework. Or, when RID matches-->

dotnet/nuget/native/targets/Imageflow.NativeTool.win-arm64.targets

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!-- We only need to copy when .NET won't copy dependency 'runtime/[rid]/native/**' automatically to build/publish -->
34

45
<!-- Copy when RID is not set and target framework is not .NET Framework. Or, when RID matches-->
5-
<PropertyGroup>
6-
<NativeToolMightBeNeeded Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETFramework' ">true</NativeToolMightBeNeeded>
7-
</PropertyGroup>
8-
9-
<ItemGroup Condition=" '$(NativeToolMightBeNeeded)' == 'true' OR '$(RuntimeIdentifier)' == 'win-arm64' ">
6+
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp' ">
107
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/win-arm64/native/*">
118
<Link>runtimes/win-arm64/native/imageflow_tool.exe</Link>
129
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<!-- Copy when RID is not set or when RID matches (we want to copy for all dotnets)-->
3+
<!-- We only need to copy when .NET won't copy dependency 'runtime/[rid]/native/**' automatically to build/publish -->
44

5-
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' OR '$(RuntimeIdentifier)' == 'win-x64' ">
5+
<!-- Basically, is this .NET Framework running the show? If so, copy. If running .NET Core+, we don't need to copy -->
6+
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp' ">
67
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/win-x64/native/*">
78
<Link>runtimes/win-x64/native/imageflow_tool.exe</Link>
89
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
910
<Visible>False</Visible>
1011
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
11-
<Pack>true</Pack>
12+
<Pack>False</Pack>
1213
<PackagePath>runtimes/win-x64/native/imageflow_tool.exe</PackagePath>
1314
</Content>
1415
</ItemGroup>
15-
16-
1716
</Project>

0 commit comments

Comments
 (0)