Skip to content

Commit ebf01cf

Browse files
committed
Update Imageflow.NativeTool to add buildTransitive targets on all platforms.
1 parent e2741cf commit ebf01cf

8 files changed

+91
-16
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<!-- Determine if .targets file should be included (Windows x86/x64/arm64) -->
2929
<IncludeTargets Condition=" '$(IsWindowsRid)' == 'true' ">true</IncludeTargets>
3030
<IncludeTargets Condition=" '$(IncludeTargets)' == '' ">false</IncludeTargets>
31-
31+
<IncludeTransitiveTargets Condition=" '$(IncludeTransitiveTargets)' == '' ">true</IncludeTransitiveTargets>
3232
<!-- disable CS2008: No source files specified -->
3333
<NoWarn>$(NoWarn);CS2008</NoWarn>
3434
<!-- Error out if the expected native tool isn't found -->
@@ -64,7 +64,7 @@
6464
PackagePath="build/$(NetClassicVersion)/$(PackageId).targets" />
6565

6666
<None Include="$(MSBuildThisFileDirectory)targets/Imageflow.NativeTool.$(ImageflowNugetRid).targets"
67-
Condition="'$(IncludeTargets)' == 'true' AND Exists('$(MSBuildThisFileDirectory)targets/Imageflow.NativeTool.$(ImageflowNugetRid).targets')"
67+
Condition="'$(IncludeTransitiveTargets)' == 'true' AND Exists('$(MSBuildThisFileDirectory)targets/Imageflow.NativeTool.$(ImageflowNugetRid).targets')"
6868
Pack="true"
6969
PackagePath="buildTransitive/$(NetClassicVersion)/$(PackageId).targets" />
7070

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<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-->
7+
<PropertyGroup>
8+
<NativeToolMightBeNeeded Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFrameworkIdentifier)' != '.NETFramework' ">true</NativeToolMightBeNeeded>
9+
</PropertyGroup>
10+
11+
<ItemGroup Condition=" '$(NativeToolMightBeNeeded)' == 'true' OR '$(RuntimeIdentifier)' == 'linux-arm64' ">
12+
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/linux-arm64/native/*">
13+
<Link>runtimes/linux-arm64/native/imageflow_tool</Link>
14+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
15+
<Visible>False</Visible>
16+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
17+
<Pack>false</Pack>
18+
<PackagePath>runtimes/linux-arm64/native/imageflow_tool</PackagePath>
19+
</Content>
20+
</ItemGroup>
21+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!-- 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)' == 'linux-x64' ">
10+
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/linux-x64/native/*">
11+
<Link>runtimes/linux-x64/native/imageflow_tool</Link>
12+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
13+
<Visible>False</Visible>
14+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
15+
<Pack>false</Pack>
16+
<PackagePath>runtimes/linux-x64/native/imageflow_tool</PackagePath>
17+
</Content>
18+
</ItemGroup>
19+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!-- 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)' == 'osx-arm64' ">
10+
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/osx-arm64/native/*">
11+
<Link>runtimes/osx-arm64/native/imageflow_tool</Link>
12+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
13+
<Visible>False</Visible>
14+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
15+
<Pack>false</Pack>
16+
<PackagePath>runtimes/osx-arm64/native/imageflow_tool</PackagePath>
17+
</Content>
18+
</ItemGroup>
19+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!-- 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)' == 'osx-x64' ">
10+
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/osx-x64/native/*">
11+
<Link>runtimes/osx-x64/native/imageflow_tool</Link>
12+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
13+
<Visible>False</Visible>
14+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
15+
<Pack>false</Pack>
16+
<PackagePath>runtimes/osx-x64/native/imageflow_tool</PackagePath>
17+
</Content>
18+
</ItemGroup>
19+
</Project>

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<!-- This file is included by Imageflow.NativeRuntime.Common.targets when ImageflowNugetRid is win-arm64 -->
4-
<!-- It includes the native libraries in the build output and NuGet package. -->
53

6-
7-
<!-- If RID is set, let the system copy it instead. Only copy on Windows. -->
8-
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(OS)' == 'Windows_NT' ">
4+
<!-- 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' ">
910
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/win-arm64/native/*">
1011
<Link>runtimes/win-arm64/native/imageflow_tool.exe</Link>
1112
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1213
<Visible>False</Visible>
1314
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
14-
<Pack>true</Pack>
15+
<Pack>false</Pack>
1516
<PackagePath>runtimes/win-arm64/native/imageflow_tool.exe</PackagePath>
1617
</Content>
1718
</ItemGroup>

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<!-- This file is included by Imageflow.NativeRuntime.Common.targets when ImageflowNugetRid is win-x64 -->
4-
<!-- It includes the native libraries in the build output and NuGet package. -->
3+
<!-- Copy when RID is not set or when RID matches (we want to copy for all dotnets)-->
54

6-
<!-- If RID is set, let the system copy it instead. Only copy on Windows. -->
7-
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(OS)' == 'Windows_NT' ">
5+
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' OR '$(RuntimeIdentifier)' == 'win-x64' ">
86
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/win-x64/native/*">
97
<Link>runtimes/win-x64/native/imageflow_tool.exe</Link>
108
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<!-- This file is included by Imageflow.NativeRuntime.Common.targets when ImageflowNugetRid is win-x86 -->
4-
<!-- It includes the native libraries in the build output and NuGet package. -->
3+
<!-- Copy when RID is not set or when RID matches (we want to copy for all dotnets)-->
54

6-
<!-- If RID is set, let the system copy it instead. Only copy on Windows. -->
7-
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' AND '$(OS)' == 'Windows_NT' ">
5+
<ItemGroup Condition=" '$(RuntimeIdentifier)' == '' OR '$(RuntimeIdentifier)' == 'win-x86' ">
86
<Content Include="$(MSBuildThisFileDirectory)../../runtimes/win-x86/native/*">
97
<Link>runtimes/win-x86/native/imageflow_tool.exe</Link>
108
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

0 commit comments

Comments
 (0)