Skip to content

Commit 60397ec

Browse files
committed
Discussion with USB-IF, including the HUT PDF in the Github repo is not covered by the license agreement.
From now on, the PDF will be retrieved from the USB-IF website at compile-time.
1 parent 66dc971 commit 60397ec

3 files changed

Lines changed: 113 additions & 99 deletions

File tree

-4.2 MB
Binary file not shown.
Lines changed: 109 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,112 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4-
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{F6A61745-0A87-435C-A0DC-CAA73F3F8BC7}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Microsoft.HidTools.HidSpecification</RootNamespace>
11-
<AssemblyName>Microsoft.HidTools.HidSpecification</AssemblyName>
12-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<Deterministic>true</Deterministic>
15-
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
24-
</PropertyGroup>
25-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<DebugType>pdbonly</DebugType>
27-
<Optimize>true</Optimize>
28-
<OutputPath>bin\Release\</OutputPath>
29-
<DefineConstants>TRACE</DefineConstants>
30-
<ErrorReport>prompt</ErrorReport>
31-
<WarningLevel>4</WarningLevel>
32-
</PropertyGroup>
33-
<ItemGroup>
34-
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
35-
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
36-
</Reference>
37-
<Reference Include="System" />
38-
<Reference Include="System.Core" />
39-
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
40-
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
41-
</Reference>
42-
<Reference Include="System.Xml.Linq" />
43-
<Reference Include="System.Data.DataSetExtensions" />
44-
<Reference Include="Microsoft.CSharp" />
45-
<Reference Include="System.Data" />
46-
<Reference Include="System.Net.Http" />
47-
<Reference Include="System.Xml" />
48-
<Reference Include="UglyToad.PdfPig, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
49-
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.dll</HintPath>
50-
</Reference>
51-
<Reference Include="UglyToad.PdfPig.Core, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
52-
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Core.dll</HintPath>
53-
</Reference>
54-
<Reference Include="UglyToad.PdfPig.DocumentLayoutAnalysis, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
55-
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.DocumentLayoutAnalysis.dll</HintPath>
56-
</Reference>
57-
<Reference Include="UglyToad.PdfPig.Fonts, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
58-
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Fonts.dll</HintPath>
59-
</Reference>
60-
<Reference Include="UglyToad.PdfPig.Package, Version=0.1.5.0, Culture=neutral, processorArchitecture=MSIL">
61-
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Package.dll</HintPath>
62-
</Reference>
63-
<Reference Include="UglyToad.PdfPig.Tokenization, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
64-
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Tokenization.dll</HintPath>
65-
</Reference>
66-
<Reference Include="UglyToad.PdfPig.Tokens, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
67-
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Tokens.dll</HintPath>
68-
</Reference>
69-
</ItemGroup>
70-
<ItemGroup>
71-
<Compile Include="Extensions.cs" />
72-
<Compile Include="HidConstants.cs" />
73-
<Compile Include="HidSpecificationException.cs" />
74-
<Compile Include="HidUnit.cs" />
75-
<Compile Include="HidUnitDefinitions.cs" />
76-
<Compile Include="HidUsageTableDefinitions.cs" />
77-
<Compile Include="HidUsageGenerator.cs" />
78-
<Compile Include="HidUsageId.cs" />
79-
<Compile Include="HidUsagePage.cs" />
80-
<Compile Include="Properties\AssemblyInfo.cs" />
81-
<Compile Include="Properties\Resources.Designer.cs">
82-
<AutoGen>True</AutoGen>
83-
<DesignTime>True</DesignTime>
84-
<DependentUpon>Resources.resx</DependentUpon>
85-
</Compile>
86-
</ItemGroup>
87-
<ItemGroup>
88-
<EmbeddedResource Include="Properties\Resources.resx">
89-
<Generator>ResXFileCodeGenerator</Generator>
90-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
91-
</EmbeddedResource>
92-
<EmbeddedResource Include="Embedded\hut1_3_0.pdf" />
93-
<None Include="packages.config" />
94-
<AdditionalFiles Include="stylecop.json" />
95-
</ItemGroup>
96-
<ItemGroup>
97-
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
98-
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
99-
</ItemGroup>
100-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{F6A61745-0A87-435C-A0DC-CAA73F3F8BC7}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Microsoft.HidTools.HidSpecification</RootNamespace>
11+
<AssemblyName>Microsoft.HidTools.HidSpecification</AssemblyName>
12+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
35+
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
36+
</Reference>
37+
<Reference Include="System" />
38+
<Reference Include="System.Core" />
39+
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
40+
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
41+
</Reference>
42+
<Reference Include="System.Xml.Linq" />
43+
<Reference Include="System.Data.DataSetExtensions" />
44+
<Reference Include="Microsoft.CSharp" />
45+
<Reference Include="System.Data" />
46+
<Reference Include="System.Net.Http" />
47+
<Reference Include="System.Xml" />
48+
<Reference Include="UglyToad.PdfPig, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
49+
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.dll</HintPath>
50+
</Reference>
51+
<Reference Include="UglyToad.PdfPig.Core, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
52+
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Core.dll</HintPath>
53+
</Reference>
54+
<Reference Include="UglyToad.PdfPig.DocumentLayoutAnalysis, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
55+
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.DocumentLayoutAnalysis.dll</HintPath>
56+
</Reference>
57+
<Reference Include="UglyToad.PdfPig.Fonts, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
58+
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Fonts.dll</HintPath>
59+
</Reference>
60+
<Reference Include="UglyToad.PdfPig.Package, Version=0.1.5.0, Culture=neutral, processorArchitecture=MSIL">
61+
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Package.dll</HintPath>
62+
</Reference>
63+
<Reference Include="UglyToad.PdfPig.Tokenization, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
64+
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Tokenization.dll</HintPath>
65+
</Reference>
66+
<Reference Include="UglyToad.PdfPig.Tokens, Version=0.1.6.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL">
67+
<HintPath>..\packages\PdfPig.0.1.6\lib\net47\UglyToad.PdfPig.Tokens.dll</HintPath>
68+
</Reference>
69+
</ItemGroup>
70+
<ItemGroup>
71+
<Compile Include="Extensions.cs" />
72+
<Compile Include="HidConstants.cs" />
73+
<Compile Include="HidSpecificationException.cs" />
74+
<Compile Include="HidUnit.cs" />
75+
<Compile Include="HidUnitDefinitions.cs" />
76+
<Compile Include="HidUsageTableDefinitions.cs" />
77+
<Compile Include="HidUsageGenerator.cs" />
78+
<Compile Include="HidUsageId.cs" />
79+
<Compile Include="HidUsagePage.cs" />
80+
<Compile Include="Properties\AssemblyInfo.cs" />
81+
<Compile Include="Properties\Resources.Designer.cs">
82+
<AutoGen>True</AutoGen>
83+
<DesignTime>True</DesignTime>
84+
<DependentUpon>Resources.resx</DependentUpon>
85+
</Compile>
86+
</ItemGroup>
87+
<PropertyGroup>
88+
<!--Current HID Usage Tables on USB-IF website-->
89+
<!--When the 'next' HUT is released, only this need be updated-->
90+
<USBIFHUT>https://www.usb.org/sites/default/files/hut1_4.pdf</USBIFHUT>
91+
</PropertyGroup>
92+
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
93+
<!--Due to the license agreement of the HUT document, it may not be published (e.g. included in source-code via Github)-->
94+
<!--To conform with this requirement, it will now be downloaded (on-demand) by the builder-->
95+
<DownloadFile SourceUrl="$(USBIFHUT)" DestinationFolder="obj">
96+
<Output TaskParameter="DownloadedFile" ItemName="EmbeddedResource" />
97+
</DownloadFile>
98+
</Target>
99+
<ItemGroup>
100+
<EmbeddedResource Include="Properties\Resources.resx">
101+
<Generator>ResXFileCodeGenerator</Generator>
102+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
103+
</EmbeddedResource>
104+
<None Include="packages.config" />
105+
<AdditionalFiles Include="stylecop.json" />
106+
</ItemGroup>
107+
<ItemGroup>
108+
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
109+
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
110+
</ItemGroup>
111+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
101112
</Project>

Waratah/HidSpecification/HidUsageTableDefinitions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ public static HidUsageTableDefinitions GetInstance(bool clear = false)
117117

118118
if (string.IsNullOrEmpty(AlternativeHidUsageTablesFilePath))
119119
{
120-
filePath = EmbeddedUsageTablesFilePath;
120+
// It's expected there will only ever be a single embedded .PDF, which will be the most recent HUT.
121+
// Note: The name of this file is 'unknown' here, and is instead determine by the build property.
122+
123+
filePath = Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(x => x.EndsWith("pdf")).First();
121124
fileStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(filePath);
122125
}
123126
else

0 commit comments

Comments
 (0)