Skip to content

Commit 4616467

Browse files
authored
Rework nuget packaging (#149)
1 parent 6f4af7c commit 4616467

File tree

4 files changed

+145
-46
lines changed

4 files changed

+145
-46
lines changed

nanoFirmwareFlasher.Library/nanoFirmwareFlasher.Library.csproj

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
<GenerateDocumentationFile>True</GenerateDocumentationFile>
3030
</PropertyGroup>
3131

32+
<Target Name="CopyToolsContent" AfterTargets="Build">
33+
<ItemGroup>
34+
<LibSourceFiles Include="$(MSBuildThisFileDirectory)\..\lib\**\*.*"/>
35+
</ItemGroup>
36+
<Copy SourceFiles="@(LibSourceFiles)" DestinationFiles="$(TargetDir)\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="True"/>
37+
</Target>
38+
3239
<ItemGroup>
3340
<None Include="..\README.md">
3441
<Pack>True</Pack>
@@ -42,7 +49,10 @@
4249
<Pack>True</Pack>
4350
<PackagePath></PackagePath>
4451
</None>
45-
52+
<Content Include="nanoFramework.Tools.FirmwareFlasher.targets">
53+
<Pack>true</Pack>
54+
<PackagePath>build</PackagePath>
55+
</Content>
4656
</ItemGroup>
4757

4858
<ItemGroup>
@@ -53,73 +63,62 @@
5363
<PackageReference Include="System.Net.Http" Version="4.3.4" />
5464
</ItemGroup>
5565

66+
<PropertyGroup>
67+
<!-- set this to 'empty' to package contents in 'any' folder -->
68+
<PackageTfmSubFolder></PackageTfmSubFolder>
69+
</PropertyGroup>
70+
71+
<Import Project="nugetcontent.targets" />
72+
73+
<!-- ************************************************************************************************************************* -->
74+
<!-- WARNING: when changing or adding any include path for an external tool, make sure to add/update in 'nugetcontent.targets' -->
75+
<!-- ************************************************************************************************************************* -->
76+
77+
<!-- esptool executables for all platforms -->
5678
<ItemGroup>
57-
<None Include="..\lib\esptool\esptoolWin\**" Link="esptool\esptoolWin\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
58-
<Pack>True</Pack>
59-
<PackagePath>content\esptool\esptoolWin</PackagePath>
79+
<None Include="..\lib\esptool\esptoolWin\**" Link="esptool\esptoolWin\%(RecursiveDir)%(Filename)%(Extension)">
6080
</None>
61-
<None Include="..\lib\esptool\esptoolMac\**" Link="esptool\esptoolMac\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
62-
<Pack>True</Pack>
63-
<PackagePath>content\esptool\esptoolMac</PackagePath>
81+
<None Include="..\lib\esptool\esptoolMac\**" Link="esptool\esptoolMac\%(RecursiveDir)%(Filename)%(Extension)">
6482
</None>
65-
<None Include="..\lib\esptool\esptoolLinux\**" Link="esptool\esptoolLinux\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
66-
<Pack>True</Pack>
67-
<PackagePath>content\esptool\esptoolLinux</PackagePath>
83+
<None Include="..\lib\esptool\esptoolLinux\**" Link="esptool\esptoolLinux\%(RecursiveDir)%(Filename)%(Extension)">
6884
</None>
6985
</ItemGroup>
7086

87+
<!-- ESP32 nanoFramework bootloader files -->
7188
<ItemGroup>
72-
<None Include="..\lib\esp32bootloader\**" Link="esp32bootloader\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
73-
<Pack>True</Pack>
74-
<PackagePath>content\esp32bootloader</PackagePath>
89+
<None Include="..\lib\esp32bootloader\**" Link="esp32bootloader\%(RecursiveDir)%(Filename)%(Extension)">
7590
</None>
76-
</ItemGroup>
77-
<ItemGroup>
78-
<None Include="..\lib\esp32s2bootloader\**" Link="esp32s2bootloader\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
79-
<Pack>True</Pack>
80-
<PackagePath>content\esp32s2bootloader</PackagePath>
91+
<None Include="..\lib\esp32s2bootloader\**" Link="esp32s2bootloader\%(RecursiveDir)%(Filename)%(Extension)">
8192
</None>
8293
</ItemGroup>
94+
95+
<!-- STLink executables for all platforms -->
8396
<ItemGroup>
84-
<None Include="..\lib\stlink\**" Link="stlink\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
85-
<Pack>True</Pack>
86-
<PackagePath>content\stlink</PackagePath>
97+
<None Include="..\lib\stlink\**" Link="stlink\%(RecursiveDir)%(Filename)%(Extension)">
8798
</None>
88-
<None Include="..\lib\stlinkMac\**" Link="stlinkMac\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
89-
<Pack>True</Pack>
90-
<PackagePath>content\stlinkMac</PackagePath>
91-
</None>
92-
<None Include="..\lib\stlinkLinux\**" Link="stlinkLinux\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
93-
<Pack>True</Pack>
94-
<PackagePath>content\stlinkLinux</PackagePath>
99+
<None Include="..\lib\stlinkMac\**" Link="stlinkMac\%(RecursiveDir)%(Filename)%(Extension)">
100+
</None>
101+
<None Include="..\lib\stlinkLinux\**" Link="stlinkLinux\%(RecursiveDir)%(Filename)%(Extension)">
95102
</None>
96103
</ItemGroup>
104+
105+
<!-- J-Link executables for all platforms -->
97106
<ItemGroup>
98-
<None Include="..\lib\jlinkCmds\**" Link="jlinkCmds\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
99-
<Pack>True</Pack>
100-
<PackagePath>content\jlinkCmds</PackagePath>
107+
<None Include="..\lib\jlinkCmds\**" Link="jlinkCmds\%(RecursiveDir)%(Filename)%(Extension)">
101108
</None>
102-
<None Include="..\lib\jlink\**" Link="jlink\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
103-
<Pack>True</Pack>
104-
<PackagePath>content\jlink</PackagePath>
109+
<None Include="..\lib\jlink\**" Link="jlink\%(RecursiveDir)%(Filename)%(Extension)">
105110
</None>
106-
<None Include="..\lib\jlinkMac\**" Link="jlinkMac\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
107-
<Pack>True</Pack>
108-
<PackagePath>content\jlinkMac</PackagePath>
111+
<None Include="..\lib\jlinkMac\**" Link="jlinkMac\%(RecursiveDir)%(Filename)%(Extension)">
109112
</None>
110-
<None Include="..\lib\jlinkLinux\**" Link="jlinkLinux\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
111-
<Pack>True</Pack>
112-
<PackagePath>content\jlinkLinux</PackagePath>
113+
<None Include="..\lib\jlinkLinux\**" Link="jlinkLinux\%(RecursiveDir)%(Filename)%(Extension)">
113114
</None>
114-
<None Include="..\lib\silink\**" Link="silink\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
115-
<Pack>True</Pack>
116-
<PackagePath>content\silink</PackagePath>
115+
<None Include="..\lib\silink\**" Link="silink\%(RecursiveDir)%(Filename)%(Extension)">
117116
</None>
118117
</ItemGroup>
118+
119+
<!-- TI Uniflash tool -->
119120
<ItemGroup>
120-
<None Include="..\lib\uniflash\**" Link="uniflash\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="Always">
121-
<Pack>True</Pack>
122-
<PackagePath>content\uniflash</PackagePath>
121+
<None Include="..\lib\uniflash\**" Link="uniflash\%(RecursiveDir)%(Filename)%(Extension)">
123122
</None>
124123
</ItemGroup>
125124

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Target Name="CopyToolsContent" AfterTargets="Build" Condition="'$(TF_BUILD)' == ''">
3+
<ItemGroup>
4+
<LibSourceFiles Include="$(PkgnanoFramework_Tools_FirmwareFlasher)\tools\any\**\*.*"/>
5+
</ItemGroup>
6+
<Copy SourceFiles="@(LibSourceFiles)" DestinationFiles="$(TargetDir)\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="True" />
7+
</Target>
8+
</Project>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<!-- esptool executables for all platforms -->
3+
<ItemGroup>
4+
<Content Include="..\lib\esptool\esptoolWin\**">
5+
<Pack>true</Pack>
6+
<PackagePath>tools\$(PackageTfmSubFolder)any\esptool\esptoolWin</PackagePath>
7+
</Content>
8+
<Content Include="..\lib\esptool\esptoolMac\**">
9+
<Pack>true</Pack>
10+
<PackagePath>tools\$(PackageTfmSubFolder)any\esptool\esptoolMac</PackagePath>
11+
</Content>
12+
<Content Include="..\lib\esptool\esptoolLinux\**">
13+
<Pack>true</Pack>
14+
<PackagePath>tools\$(PackageTfmSubFolder)any\esptool\esptoolLinux</PackagePath>
15+
</Content>
16+
</ItemGroup>
17+
18+
<!-- ESP32 nanoFramework bootloader files -->
19+
<ItemGroup>
20+
<Content Include="..\lib\esp32bootloader\**">
21+
<Pack>true</Pack>
22+
<PackagePath>tools\$(PackageTfmSubFolder)any\esp32bootloader</PackagePath>
23+
</Content>
24+
<Content Include="..\lib\esp32s2bootloader\**">
25+
<Pack>true</Pack>
26+
<PackagePath>tools\$(PackageTfmSubFolder)any\esp32s2bootloader</PackagePath>
27+
</Content>
28+
</ItemGroup>
29+
30+
<!-- STLink executables for all platforms -->
31+
<ItemGroup>
32+
<Content Include="..\lib\stlink\**">
33+
<Pack>true</Pack>
34+
<PackagePath>tools\$(PackageTfmSubFolder)any\stlink</PackagePath>
35+
</Content>
36+
<Content Include="..\lib\stlinkMac\**">
37+
<Pack>true</Pack>
38+
<PackagePath>tools\$(PackageTfmSubFolder)any\stlinkMac</PackagePath>
39+
</Content>
40+
<Content Include="..\lib\stlinkLinux\**">
41+
<Pack>true</Pack>
42+
<PackagePath>tools\$(PackageTfmSubFolder)any\stlinkLinux</PackagePath>
43+
</Content>
44+
</ItemGroup>
45+
46+
<!-- J-Link executables for all platforms -->
47+
<ItemGroup>
48+
<Content Include="..\lib\jlinkCmds\**">
49+
<Pack>true</Pack>
50+
<PackagePath>tools\$(PackageTfmSubFolder)any\jlinkCmds</PackagePath>
51+
</Content>
52+
<Content Include="..\lib\jlink\**">
53+
<Pack>true</Pack>
54+
<PackagePath>tools\$(PackageTfmSubFolder)any\jlink</PackagePath>
55+
</Content>
56+
<Content Include="..\lib\jlinkMac\**">
57+
<Pack>true</Pack>
58+
<PackagePath>tools\$(PackageTfmSubFolder)any\jlinkMac</PackagePath>
59+
</Content>
60+
<Content Include="..\lib\jlinkLinux\**">
61+
<Pack>true</Pack>
62+
<PackagePath>tools\$(PackageTfmSubFolder)any\jlinkLinux</PackagePath>
63+
</Content>
64+
<Content Include="..\lib\silink\**">
65+
<Pack>true</Pack>
66+
<PackagePath>tools\$(PackageTfmSubFolder)any\silink</PackagePath>
67+
</Content>
68+
</ItemGroup>
69+
70+
<!-- TI Uniflash tool -->
71+
<ItemGroup>
72+
<Content Include="..\lib\uniflash\**">
73+
<Pack>true</Pack>
74+
<PackagePath>tools\$(PackageTfmSubFolder)any\uniflash</PackagePath>
75+
</Content>
76+
</ItemGroup>
77+
78+
</Project>

nanoFirmwareFlasher.Tool/nanoFirmwareFlasher.Tool.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,18 @@
6161
<ProjectReference Include="..\nanoFirmwareFlasher.Library\nanoFirmwareFlasher.Library.csproj" />
6262
</ItemGroup>
6363

64+
<Target Name="CopyToolsContent" AfterTargets="Build">
65+
<ItemGroup>
66+
<LibSourceFiles Include="$(MSBuildThisFileDirectory)\..\lib\**\*.*"/>
67+
</ItemGroup>
68+
<Copy SourceFiles="@(LibSourceFiles)" DestinationFiles="$(TargetDir)\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="True"/>
69+
</Target>
70+
71+
<PropertyGroup>
72+
<!-- set this to 'net6.0\' to package contents in this TFM folder -->
73+
<PackageTfmSubFolder>net6.0\</PackageTfmSubFolder>
74+
</PropertyGroup>
75+
76+
<Import Project="..\nanoFirmwareFlasher.Library\nugetcontent.targets" />
77+
6478
</Project>

0 commit comments

Comments
 (0)