Skip to content

Commit b123c5e

Browse files
authored
Merge pull request #1234 from LucaMaccarini/fix-issue-#382
Fix issue #382 (multiple publish output files with same relative path)
2 parents cc46c13 + ce4113f commit b123c5e

8 files changed

Lines changed: 170 additions & 186 deletions

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,7 @@ site/
351351
**/appsettings.Local.json
352352
/LLama/runtimes/deps
353353
/LLama/runtimes/deps.zip
354-
/LLama/runtimes/release_id.txt
354+
/LLama/runtimes/release_id.txt
355+
/Llama.Mobile/Resources/Raw
356+
/nuget_pack.bat
357+
/temp

LLama/runtimes/build/LLamaSharp.Backend.Cpu.Android.nuspec

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
<files>
1919
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Cpu.Android.props" />
2020

21-
<file src="runtimes/deps/android-arm64-v8a/libllama.so" target="runtimes\android-arm64-v8a\native\libllama.so" />
22-
<file src="runtimes/deps/android-arm64-v8a/libggml.so" target="runtimes\android-arm64-v8a\native\libggml.so" />
23-
<file src="runtimes/deps/android-arm64-v8a/libggml-base.so" target="runtimes\android-arm64-v8a\native\libggml-base.so" />
24-
<file src="runtimes/deps/android-arm64-v8a/libggml-cpu.so" target="runtimes\android-arm64-v8a\native\libggml-cpu.so" />
25-
<file src="runtimes/deps/android-arm64-v8a/libmtmd.so" target="runtimes\android-arm64-v8a\native\libmtmd.so" />
21+
<file src="runtimes/deps/android-arm64-v8a/libllama.so" target="LLamaSharpRuntimes\android-arm64-v8a\native\libllama.so" />
22+
<file src="runtimes/deps/android-arm64-v8a/libggml.so" target="LLamaSharpRuntimes\android-arm64-v8a\native\libggml.so" />
23+
<file src="runtimes/deps/android-arm64-v8a/libggml-base.so" target="LLamaSharpRuntimes\android-arm64-v8a\native\libggml-base.so" />
24+
<file src="runtimes/deps/android-arm64-v8a/libggml-cpu.so" target="LLamaSharpRuntimes\android-arm64-v8a\native\libggml-cpu.so" />
25+
<file src="runtimes/deps/android-arm64-v8a/libmtmd.so" target="LLamaSharpRuntimes\android-arm64-v8a\native\libmtmd.so" />
2626

27-
<file src="runtimes/deps/android-x86_64/libllama.so" target="runtimes\android-x86_64\native\libllama.so" />
28-
<file src="runtimes/deps/android-x86_64/libggml.so" target="runtimes\android-x86_64\native\libggml.so" />
29-
<file src="runtimes/deps/android-x86_64/libggml-base.so" target="runtimes\android-x86_64\native\libggml-base.so" />
30-
<file src="runtimes/deps/android-x86_64/libggml-cpu.so" target="runtimes\android-x86_64\native\libggml-cpu.so" />
31-
<file src="runtimes/deps/android-x86_64/libmtmd.so" target="runtimes\android-x86_64\native\libmtmd.so" />
27+
<file src="runtimes/deps/android-x86_64/libllama.so" target="LLamaSharpRuntimes\android-x86_64\native\libllama.so" />
28+
<file src="runtimes/deps/android-x86_64/libggml.so" target="LLamaSharpRuntimes\android-x86_64\native\libggml.so" />
29+
<file src="runtimes/deps/android-x86_64/libggml-base.so" target="LLamaSharpRuntimes\android-x86_64\native\libggml-base.so" />
30+
<file src="runtimes/deps/android-x86_64/libggml-cpu.so" target="LLamaSharpRuntimes\android-x86_64\native\libggml-cpu.so" />
31+
<file src="runtimes/deps/android-x86_64/libmtmd.so" target="LLamaSharpRuntimes\android-x86_64\native\libmtmd.so" />
3232

3333
<file src="icon512.png" target="icon512.png" />
3434
</files>

LLama/runtimes/build/LLamaSharp.Backend.Cpu.nuspec

Lines changed: 100 additions & 100 deletions
Large diffs are not rendered by default.

LLama/runtimes/build/LLamaSharp.Backend.Cuda12.Linux.nuspec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
</metadata>
2121

2222
<files>
23-
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Cuda12.props" />
23+
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Cuda12.Linux.props" />
2424

25-
<file src="runtimes/deps/cu12.4.0/libggml.so" target="runtimes/linux-x64/native/cuda12/libggml.so" />
26-
<file src="runtimes/deps/cu12.4.0/libggml-base.so" target="runtimes/linux-x64/native/cuda12/libggml-base.so" />
27-
<file src="runtimes/deps/cu12.4.0/libggml-cuda.so" target="runtimes/linux-x64/native/cuda12/libggml-cuda.so" />
25+
<file src="runtimes/deps/cu12.4.0/libggml.so" target="LLamaSharpRuntimes/linux-x64/native/cuda12/libggml.so" />
26+
<file src="runtimes/deps/cu12.4.0/libggml-base.so" target="LLamaSharpRuntimes/linux-x64/native/cuda12/libggml-base.so" />
27+
<file src="runtimes/deps/cu12.4.0/libggml-cuda.so" target="LLamaSharpRuntimes/linux-x64/native/cuda12/libggml-cuda.so" />
2828

29-
<file src="runtimes/deps/cu12.4.0/libllama.so" target="runtimes/linux-x64/native/cuda12/libllama.so" />
30-
<file src="runtimes/deps/cu12.4.0/libmtmd.so" target="runtimes/linux-x64/native/cuda12/libmtmd.so" />
29+
<file src="runtimes/deps/cu12.4.0/libllama.so" target="LLamaSharpRuntimes/linux-x64/native/cuda12/libllama.so" />
30+
<file src="runtimes/deps/cu12.4.0/libmtmd.so" target="LLamaSharpRuntimes/linux-x64/native/cuda12/libmtmd.so" />
3131

3232
<file src="icon512.png" target="icon512.png" />
3333
</files>

LLama/runtimes/build/LLamaSharp.Backend.Cuda12.Windows.nuspec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
</metadata>
2121

2222
<files>
23-
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Cuda12.props" />
23+
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Cuda12.Windows.props" />
2424

25-
<file src="runtimes/deps/cu12.4.0/ggml.dll" target="runtimes\win-x64\native\cuda12\ggml.dll" />
26-
<file src="runtimes/deps/cu12.4.0/ggml-base.dll" target="runtimes\win-x64\native\cuda12\ggml-base.dll" />
27-
<file src="runtimes/deps/cu12.4.0/ggml-cuda.dll" target="runtimes\win-x64\native\cuda12\ggml-cuda.dll" />
25+
<file src="runtimes/deps/cu12.4.0/ggml.dll" target="LLamaSharpRuntimes\win-x64\native\cuda12\ggml.dll" />
26+
<file src="runtimes/deps/cu12.4.0/ggml-base.dll" target="LLamaSharpRuntimes\win-x64\native\cuda12\ggml-base.dll" />
27+
<file src="runtimes/deps/cu12.4.0/ggml-cuda.dll" target="LLamaSharpRuntimes\win-x64\native\cuda12\ggml-cuda.dll" />
2828

29-
<file src="runtimes/deps/cu12.4.0/llama.dll" target="runtimes\win-x64\native\cuda12\llama.dll" />
30-
<file src="runtimes/deps/cu12.4.0/mtmd.dll" target="runtimes\win-x64\native\cuda12\mtmd.dll" />
29+
<file src="runtimes/deps/cu12.4.0/llama.dll" target="LLamaSharpRuntimes\win-x64\native\cuda12\llama.dll" />
30+
<file src="runtimes/deps/cu12.4.0/mtmd.dll" target="LLamaSharpRuntimes\win-x64\native\cuda12\mtmd.dll" />
3131

3232
<file src="icon512.png" target="icon512.png" />
3333
</files>

LLama/runtimes/build/LLamaSharp.Backend.Vulkan.Linux.nuspec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
</metadata>
2121

2222
<files>
23-
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Vulkan.props" />
23+
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Vulkan.Linux.props" />
2424

25-
<file src="runtimes/deps/vulkan/libggml.so" target="runtimes/linux-x64/native/vulkan/libggml.so" />
26-
<file src="runtimes/deps/vulkan/libggml-base.so" target="runtimes/linux-x64/native/vulkan/libggml-base.so" />
27-
<file src="runtimes/deps/vulkan/libggml-vulkan.so" target="runtimes/linux-x64/native/vulkan/libggml-vulkan.so" />
25+
<file src="runtimes/deps/vulkan/libggml.so" target="LLamaSharpRuntimes/linux-x64/native/vulkan/libggml.so" />
26+
<file src="runtimes/deps/vulkan/libggml-base.so" target="LLamaSharpRuntimes/linux-x64/native/vulkan/libggml-base.so" />
27+
<file src="runtimes/deps/vulkan/libggml-vulkan.so" target="LLamaSharpRuntimes/linux-x64/native/vulkan/libggml-vulkan.so" />
2828

29-
<file src="runtimes/deps/vulkan/libllama.so" target="runtimes/linux-x64/native/vulkan/libllama.so" />
30-
<file src="runtimes/deps/vulkan/libmtmd.so" target="runtimes/linux-x64/native/vulkan/libmtmd.so" />
29+
<file src="runtimes/deps/vulkan/libllama.so" target="LLamaSharpRuntimes/linux-x64/native/vulkan/libllama.so" />
30+
<file src="runtimes/deps/vulkan/libmtmd.so" target="LLamaSharpRuntimes/linux-x64/native/vulkan/libmtmd.so" />
3131

3232
<file src="icon512.png" target="icon512.png" />
3333
</files>

LLama/runtimes/build/LLamaSharp.Backend.Vulkan.Windows.nuspec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
</metadata>
2121

2222
<files>
23-
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Vulkan.props" />
23+
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.Vulkan.Windows.props" />
2424

25-
<file src="runtimes/deps/vulkan/ggml.dll" target="runtimes\win-x64\native\vulkan\ggml.dll" />
26-
<file src="runtimes/deps/vulkan/ggml-base.dll" target="runtimes\win-x64\native\vulkan\ggml-base.dll" />
27-
<file src="runtimes/deps/vulkan/ggml-vulkan.dll" target="runtimes\win-x64\native\vulkan\ggml-vulkan.dll" />
25+
<file src="runtimes/deps/vulkan/ggml.dll" target="LLamaSharpRuntimes\win-x64\native\vulkan\ggml.dll" />
26+
<file src="runtimes/deps/vulkan/ggml-base.dll" target="LLamaSharpRuntimes\win-x64\native\vulkan\ggml-base.dll" />
27+
<file src="runtimes/deps/vulkan/ggml-vulkan.dll" target="LLamaSharpRuntimes\win-x64\native\vulkan\ggml-vulkan.dll" />
2828

29-
<file src="runtimes/deps/vulkan/llama.dll" target="runtimes\win-x64\native\vulkan\llama.dll" />
30-
<file src="runtimes/deps/vulkan/mtmd.dll" target="runtimes\win-x64\native\vulkan\mtmd.dll" />
29+
<file src="runtimes/deps/vulkan/llama.dll" target="LLamaSharpRuntimes\win-x64\native\vulkan\llama.dll" />
30+
<file src="runtimes/deps/vulkan/mtmd.dll" target="LLamaSharpRuntimes\win-x64\native\vulkan\mtmd.dll" />
3131

3232
<file src="icon512.png" target="icon512.png" />
3333
</files>

LLama/runtimes/build/LLamaSharpBackend.props

Lines changed: 32 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,54 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

3-
<!--
4-
NuGet packages.config doesn't support native assemblies automatically,
5-
so copy the native assemblies to the output directory.
6-
-->
7-
<ItemGroup Condition="Exists('packages.config') OR
8-
Exists('$(MSBuildProjectName).packages.config') OR
9-
Exists('packages.$(MSBuildProjectName).config')">
10-
<Content Include="$(MSBuildThisFileDirectory)\..\..\runtimes\**\*.*">
11-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
12-
<Visible>false</Visible>
13-
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
14-
</Content>
15-
</ItemGroup>
3+
<!--
4+
NuGet packages.config doesn't support native assemblies automatically,
5+
so copy the native assemblies to the output directory.
6+
-->
7+
8+
<!--import only the assemblies for the corresponding operating system / runtime environment.-->
9+
<ItemGroup Condition="Exists('$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\$(RuntimeIdentifier)')">
10+
<Content Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\$(RuntimeIdentifier)\**">
11+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
12+
<Visible>false</Visible>
13+
<Link>runtimes\$(RuntimeIdentifier)\%(RecursiveDir)%(Filename)%(Extension)</Link>
14+
</Content>
15+
</ItemGroup>
1616

17-
<!-- Start Android-->
18-
<ItemGroup
19-
Condition="$(AndroidSupportedAbis.Contains('x86')) or $(RuntimeIdentifiers.Contains('android-x86'))">
20-
<AndroidNativeLibrary Visible="false"
21-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86\native\libllama.so">
22-
<Link>runtimes\android-x86\native\libllama.so</Link>
23-
<Abi>x86</Abi>
24-
</AndroidNativeLibrary>
25-
<AndroidNativeLibrary Visible="false"
26-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86\native\libggml.so">
27-
<Link>runtimes\android-x86\native\libggml.so</Link>
28-
<Abi>x86</Abi>
29-
</AndroidNativeLibrary>
30-
<AndroidNativeLibrary Visible="false"
31-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86\native\libggml-base.so">
32-
<Link>runtimes\android-x86\native\libggml-base.so</Link>
33-
<Abi>x86</Abi>
34-
</AndroidNativeLibrary>
35-
<AndroidNativeLibrary Visible="false"
36-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86\native\libggml-cpu.so">
37-
<Link>runtimes\android-x86\native\libggml-cpu.so</Link>
38-
<Abi>x86</Abi>
39-
</AndroidNativeLibrary>
40-
<AndroidNativeLibrary Visible="false"
41-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86\native\libmtmd.so">
42-
<Link>runtimes\android-x86\native\libmtmd.so</Link>
43-
<Abi>x86</Abi>
44-
</AndroidNativeLibrary>
17+
<!-- Fallback for when RuntimeIdentifier is not specified -->
18+
<ItemGroup Condition="!Exists('$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\$(RuntimeIdentifier)')">
19+
<Content Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\**\*.*">
20+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
21+
<Visible>false</Visible>
22+
<Link>runtimes\%(RecursiveDir)%(Filename)%(Extension)</Link>
23+
</Content>
4524
</ItemGroup>
4625

26+
27+
<!-- Start Android-->
4728
<ItemGroup
4829
Condition="$(AndroidSupportedAbis.Contains('x86_64')) or $(RuntimeIdentifiers.Contains('android-x64'))">
4930
<AndroidNativeLibrary Visible="false"
50-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86_64\native\libllama.so">
31+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-x86_64\native\libllama.so">
5132
<Link>lib\x86_64\libllama.so</Link>
5233
<Abi>x86_64</Abi>
5334
</AndroidNativeLibrary>
5435
<AndroidNativeLibrary Visible="false"
55-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86_64\native\libggml.so">
36+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-x86_64\native\libggml.so">
5637
<Link>lib\x86_64\libggml.so</Link>
5738
<Abi>x86_64</Abi>
5839
</AndroidNativeLibrary>
5940
<AndroidNativeLibrary Visible="false"
60-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86_64\native\libggml-base.so">
41+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-x86_64\native\libggml-base.so">
6142
<Link>lib\x86_64\libggml-base.so</Link>
6243
<Abi>x86_64</Abi>
6344
</AndroidNativeLibrary>
6445
<AndroidNativeLibrary Visible="false"
65-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86_64\native\libggml-cpu.so">
46+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-x86_64\native\libggml-cpu.so">
6647
<Link>lib\x86_64\libggml-cpu.so</Link>
6748
<Abi>x86_64</Abi>
6849
</AndroidNativeLibrary>
6950
<AndroidNativeLibrary Visible="false"
70-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-x86_64\native\libmtmd.so">
51+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-x86_64\native\libmtmd.so">
7152
<Link>lib\x86_64\libmtmd.so</Link>
7253
<Abi>x86_64</Abi>
7354
</AndroidNativeLibrary>
@@ -76,27 +57,27 @@
7657
<ItemGroup
7758
Condition="$(AndroidSupportedAbis.Contains('arm64-v8a')) or $(RuntimeIdentifiers.Contains('android-arm64'))">
7859
<AndroidNativeLibrary Visible="false"
79-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-arm64-v8a\native\libllama.so">
60+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-arm64-v8a\native\libllama.so">
8061
<Link>lib\arm64-v8a\libllama.so</Link>
8162
<Abi>arm64-v8a</Abi>
8263
</AndroidNativeLibrary>
8364
<AndroidNativeLibrary Visible="false"
84-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-arm64-v8a\native\libggml.so">
65+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-arm64-v8a\native\libggml.so">
8566
<Link>lib\arm64-v8a\libggml.so</Link>
8667
<Abi>arm64-v8a</Abi>
8768
</AndroidNativeLibrary>
8869
<AndroidNativeLibrary Visible="false"
89-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-arm64-v8a\native\libggml-base.so">
70+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-arm64-v8a\native\libggml-base.so">
9071
<Link>lib\arm64-v8a\libggml-base.so</Link>
9172
<Abi>arm64-v8a</Abi>
9273
</AndroidNativeLibrary>
9374
<AndroidNativeLibrary Visible="false"
94-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-arm64-v8a\native\libggml-cpu.so">
75+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-arm64-v8a\native\libggml-cpu.so">
9576
<Link>lib\arm64-v8a\libggml-cpu.so</Link>
9677
<Abi>arm64-v8a</Abi>
9778
</AndroidNativeLibrary>
9879
<AndroidNativeLibrary Visible="false"
99-
Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-arm64-v8a\native\libmtmd.so">
80+
Include="$(MSBuildThisFileDirectory)..\..\LLamaSharpRuntimes\android-arm64-v8a\native\libmtmd.so">
10081
<Link>lib\arm64-v8a\libmtmd.so</Link>
10182
<Abi>arm64-v8a</Abi>
10283
</AndroidNativeLibrary>

0 commit comments

Comments
 (0)