Repository navigation
Expand file tree
/
Copy pathOutWit.Database.Parser.csproj
More file actions
84 lines (71 loc) · 4.13 KB
/
Copy pathOutWit.Database.Parser.csproj
File metadata and controls
84 lines (71 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AntlrScriptPath>$(MSBuildProjectDirectory)\MakeInternal.ps1</AntlrScriptPath>
<_AntlrVendoredJar>$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)/../../../build/antlr/antlr4-4.13.1-complete.jar'))</_AntlrVendoredJar>
<Version>14.0.1</Version>
<Description>SQL parser for WitDatabase. ANTLR4-based parser for WitSQL dialect with full SQL-92 compatibility and .NET type extensions.</Description>
<PackageTags>OutWit;database;sql;parser;antlr;witsql;query;syntax</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.13.1" />
<!--
Antlr4BuildTasks is a build-time MSBuild task package: it generates the parser and has no
runtime role. Without PrivateAssets=all it was a public dependency of this package, so every
consumer of the SQL engine - down to a plain console app - restored MSBuild assemblies into
bin/. ExcludeAssets=compile keeps its types out of our own compilation, which never used them.
-->
<PackageReference Include="Antlr4BuildTasks" Version="12.11.0"
PrivateAssets="all" ExcludeAssets="compile" />
<PackageReference Include="OutWit.Common" Version="1.4.0" />
<PackageReference Include="OutWit.Common.MemoryPack" Version="1.1.6" />
</ItemGroup>
<ItemGroup>
<!--
MakeInternal.ps1 rewrites the ANTLR-generated classes to `internal` so that the parse tree
never reaches the public API. The phase-3 grammar harnesses need to construct the parser
directly, to set PredictionMode and attach an ambiguity listener - neither of which is
reachable through WitSql.Parse. Granting the test assembly access keeps the public surface
unchanged, which is the point of the internalisation in the first place.
-->
<InternalsVisibleTo Include="OutWit.Database.Parser.Tests" />
<!--
And to the engine's tests, for one corpus: KnownFunctionCorpusTests asks the generated lexer
which tokens can head a function call, and checks every one of them against the set of
functions the engine can actually evaluate. The question spans both assemblies - the grammar
admits the name, the engine implements it - so the fixture has to live with the engine and
still see the vocabulary. Taking the list from the lexer rather than maintaining one by hand
is the whole point: a function added to the grammar tomorrow is covered without anyone
remembering.
-->
<InternalsVisibleTo Include="OutWit.Database.Tests" />
</ItemGroup>
<!--
Antlr4BuildTasks reads the tool jar from the %(Antlr4.AntlrToolJar) item
metadata. Set it INLINE on the item rather than via an ItemDefinitionGroup:
the package's own Antlr4BuildTasks.targets defines an ItemDefinitionGroup
default of <AntlrToolJar></AntlrToolJar> (empty) and is imported AFTER this
project body, so an IDG here can be overridden to empty depending on SDK
evaluation order - which silently fell back to a network jar download (flaky
on CI). Inline item metadata always wins over any ItemDefinitionGroup, so the
committed jar is used deterministically with no download.
-->
<ItemGroup>
<Antlr4 Include="Grammars\**\*.g4">
<Language>CSharp</Language>
<Package>OutWit.Database.Parser.Generated</Package>
<AntlrToolJar>$(_AntlrVendoredJar)</AntlrToolJar>
</Antlr4>
</ItemGroup>
<Target Name="MakeAntlrGeneratedCodeInternal" AfterTargets="Antlr4Compile">
<PropertyGroup>
<PowerShellCmd Condition=" '$(OS)' != 'Windows_NT' ">pwsh</PowerShellCmd>
<PowerShellCmd Condition=" '$(OS)' == 'Windows_NT' ">powershell</PowerShellCmd>
<AntlrGenDir>$(MSBuildProjectDirectory)\$(IntermediateOutputPath.TrimEnd('\'))</AntlrGenDir>
</PropertyGroup>
<Message Text="[ANTLR Internalizer] Target Dir: $(AntlrGenDir)" Importance="high" />
<Exec Command="$(PowerShellCmd) -NoProfile -ExecutionPolicy Bypass -File "$(AntlrScriptPath)" "$(AntlrGenDir)"" />
</Target>
</Project>