-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathGenerateFiles.props
More file actions
83 lines (76 loc) · 10.6 KB
/
GenerateFiles.props
File metadata and controls
83 lines (76 loc) · 10.6 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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<GSqlTokenTypesCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSqlTokenTypes.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql80.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql90.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql100.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql110.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql120.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql130.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql140.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql150.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql160.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSqlFabricDW.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql170.g" />
<GLexerParserCompile Include="$(SQLSCRIPTDOM)\Parser\TSql\TSql180.g" />
</ItemGroup>
<Target Name="CreateCsGenIntermediateOutputPath" AfterTargets="BuildGenerateSources" BeforeTargets="CoreCompile">
<MakeDir Directories="$(CsGenIntermediateOutputPath)" Condition="!Exists('$(CsGenIntermediateOutputPath)')" />
</Target>
<!-- These target makes sure to download Antlr once instead of
downloading it for each of the frameworks.
-->
<Target Name="InstallAntlr" Condition="!Exists($(AntlrLocation))" BeforeTargets="DispatchToInnerBuilds">
<DownloadFile
SourceUrl= "$(AntlrSourceUrl)"
DestinationFolder="$([System.IO.Path]::GetDirectoryName($(AntlrLocation)))">
<Output TaskParameter="DownloadedFile" ItemName="Content" />
</DownloadFile>
</Target>
<Target Name="GSqlTokenTypesCompile" Condition="'@(GSqlTokenTypesCompile)'!=''" DependsOnTargets="CreateCsGenIntermediateOutputPath;InstallAntlr" BeforeTargets="CoreCompile" Inputs="@(GSqlTokenTypesCompile)" Outputs="@(GSqlTokenTypesCompile->'$(CsGenIntermediateOutputPath)%(filename)_final.cs')">
<Exec Command="java -cp "$(AntlrLocation)" antlr.Tool -o "$(CsGenIntermediateOutputPath.TrimEnd('\'))" "%(GSqlTokenTypesCompile.Identity)"" Condition="'$(OS)' != 'Windows_NT'" />
<Exec Command="pwsh TSqlTokenTypes.ps1 "$(CsGenIntermediateOutputPath)%(GSqlTokenTypesCompile.Filename).cs" "$(CsGenIntermediateOutputPath)%(GSqlTokenTypesCompile.Filename)_final.cs"" Condition="'$(OS)' != 'Windows_NT'" />
<Exec Command=""$(AntlrLocation)" -o "$(CsGenIntermediateOutputPath.TrimEnd('\'))" "%(GSqlTokenTypesCompile.Identity)"" Condition="'$(OS)' == 'Windows_NT'" />
<Exec Command="powershell -NonInteractive -Executionpolicy Unrestricted .\TSqlTokenTypes.ps1 "$(CsGenIntermediateOutputPath)%(GSqlTokenTypesCompile.Filename).cs" "$(CsGenIntermediateOutputPath)%(GSqlTokenTypesCompile.Filename)_final.cs"" Condition="'$(OS)' == 'Windows_NT'" />
<ItemGroup>
<Compile Condition="'$(SqlDomNuget)'!='true'" Include="$(CsGenIntermediateOutputPath)%(GSqlTokenTypesCompile.Filename)_final.cs" />
</ItemGroup>
</Target>
<Target Name="GLexerParserCompile" Condition="'@(GLexerParserCompile)'!=''" DependsOnTargets="CreateCsGenIntermediateOutputPath;InstallAntlr" BeforeTargets="CoreCompile" Inputs="@(GLexerParserCompile)" Outputs="@(GLexerParserCompile->'$(CsGenIntermediateOutputPath)%(filename)ParserInternal_final.cs');@(GLexerParserCompile->'$(CsGenIntermediateOutputPath)%(filename)LexerInternal_final.cs')">
<!--Based on property we either run antlr with all warnings and errors supressed or not-->
<Exec Command="java -cp "$(AntlrLocation)" antlr.Tool -o "$(CsGenIntermediateOutputPath.TrimEnd('\'))" "%(GLexerParserCompile.Identity)" > NUL 2>&1" Condition="'$(OutputErrorInLexerParserCompile)' == 'false' And '$(OS)' != 'Windows_NT'" />
<Exec Command="java -cp "$(AntlrLocation)" antlr.Tool -o "$(CsGenIntermediateOutputPath.TrimEnd('\'))" "%(GLexerParserCompile.Identity)" " Condition="'$(OutputErrorInLexerParserCompile)' == 'true' And '$(OS)' != 'Windows_NT'" />
<Exec Command="pwsh LexerPostProcessing.ps1 "$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)LexerInternal.cs" "$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)LexerInternal_final.cs"" Condition="'$(OS)' != 'Windows_NT'" />
<Exec Command="pwsh ParserPostProcessing.ps1 "$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)ParserInternal.cs" "$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)ParserInternal_final.cs"" Condition="'$(OS)' != 'Windows_NT'" />
<Exec Command=""$(AntlrLocation)" -o "$(CsGenIntermediateOutputPath.TrimEnd('\'))" "%(GLexerParserCompile.Identity)" > NUL 2>&1" Condition="'$(OutputErrorInLexerParserCompile)' == 'false' And '$(OS)' == 'Windows_NT'" />
<Exec Command=""$(AntlrLocation)" -o "$(CsGenIntermediateOutputPath.TrimEnd('\'))" "%(GLexerParserCompile.Identity)" " Condition="'$(OutputErrorInLexerParserCompile)' == 'true' And '$(OS)' == 'Windows_NT'" />
<Exec Command="powershell -NonInteractive -Executionpolicy Unrestricted .\LexerPostProcessing.ps1 "$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)LexerInternal.cs" "$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)LexerInternal_final.cs"" Condition="'$(OS)' == 'Windows_NT'" />
<Exec Command="powershell -NonInteractive -Executionpolicy Unrestricted .\ParserPostProcessing.ps1 "$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)ParserInternal.cs" "$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)ParserInternal_final.cs"" Condition="'$(OS)' == 'Windows_NT'" />
<ItemGroup>
<Compile Condition="'$(SqlDomNuget)'!='true'" Include="$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)LexerInternal_final.cs" />
<Compile Condition="'$(SqlDomNuget)'!='true'" Include="$(CsGenIntermediateOutputPath)%(GLexerParserCompile.Filename)ParserInternal_final.cs" />
</ItemGroup>
</Target>
<Target Name="CreateAST" DependsOnTargets="AfterResolveReferences;GSqlTokenTypesCompile" BeforeTargets="CoreCompile" Inputs="$(SQLSCRIPTDOM)\Parser\TSql\Ast.xml;" Outputs="$(CsGenIntermediateOutputPath)Ast.cs;$(CsGenIntermediateOutputPath)TSqlConcreteFragmentVisitor.codegen.cs">
<Exec Condition="'$(SqlDomNuget)'!='true' And '$(OS)' != 'Windows_NT'" Command=""$(BuildToolsPath)/astgen" "$(SQLSCRIPTDOM)/Parser/TSql/Ast.xml" "$(CsGenIntermediateOutputPath)TSqlFragmentVisitor.codegen.cs" "$(CsGenIntermediateOutputPath)TSqlConcreteFragmentVisitor.codegen.cs" "$(CsGenIntermediateOutputPath)Ast.cs" " />
<Exec Condition="'$(SqlDomNuget)'=='true' And '$(OS)' != 'Windows_NT'" Command=""$(BuildToolsPath)/astgen" "$(SQLSCRIPTDOM)/Parser/TSql/Ast.xml" "$(CsGenIntermediateOutputPath)TSqlFragmentVisitor.codegen.cs" "$(CsGenIntermediateOutputPath)TSqlConcreteFragmentVisitor.codegen.cs" "$(CsGenIntermediateOutputPath)Ast.cs" -test "$(CsGenIntermediateOutputPath)\OverrideSqlScriptGeneratorVisitor.codegen.cs" "" />
<Exec Condition="'$(SqlDomNuget)'!='true' And '$(OS)' == 'Windows_NT'" Command=""$(BuildToolsPath)\AstGen.exe" "$(SQLSCRIPTDOM)\Parser\TSql\Ast.xml" "$(CsGenIntermediateOutputPath)TSqlFragmentVisitor.codegen.cs" "$(CsGenIntermediateOutputPath)TSqlConcreteFragmentVisitor.codegen.cs" "$(CsGenIntermediateOutputPath)Ast.cs" " />
<Exec Condition="'$(SqlDomNuget)'=='true' And '$(OS)' == 'Windows_NT'" Command=""$(BuildToolsPath)\AstGen.exe" "$(SQLSCRIPTDOM)\Parser\TSql\Ast.xml" "$(CsGenIntermediateOutputPath)TSqlFragmentVisitor.codegen.cs" "$(CsGenIntermediateOutputPath)TSqlConcreteFragmentVisitor.codegen.cs" "$(CsGenIntermediateOutputPath)Ast.cs" -test "$(CsGenIntermediateOutputPath)\OverrideSqlScriptGeneratorVisitor.codegen.cs" "" />
<ItemGroup>
<Compile Condition="'$(SqlDomNuget)'!='true'" Include="$(CsGenIntermediateOutputPath)Ast.cs" />
<Compile Condition="'$(SqlDomNuget)'!='true'" Include="$(CsGenIntermediateOutputPath)TSqlConcreteFragmentVisitor.codegen.cs" />
</ItemGroup>
</Target>
<Target Name="GenerateEverything" DependsOnTargets="AfterResolveReferences;GSqlTokenTypesCompile" BeforeTargets="CoreCompile" Inputs="$(SQLSCRIPTDOM)\ScriptDom\SqlServer\Settings\SqlScriptGeneratorOptions.xml" Outputs="$(CsGenIntermediateOutputPath)TSqlTokenTypes.txt;$(CsGenIntermediateOutputPath)TSqlFragmentVisitor.codegen.cs;$(CsGenIntermediateOutputPath)SqlScriptGeneratorOptions.cs;$(CsGenIntermediateOutputPath)ScriptGeneratorSupporter.Generated.cs">
<Exec Condition="'$(OS)' != 'Windows_NT'" Command=""$(BuildToolsPath)/ScriptGenSettingsGenerator" "$(SQLSCRIPTDOM)/ScriptDom/SqlServer/Settings/SqlScriptGeneratorOptions.xml" "$(CsGenIntermediateOutputPath)SqlScriptGeneratorOptions.cs" "$(CsGenIntermediateOutputPath)SqlScriptGeneratorOptionsAdapter.Generated.cs"" />
<Exec Condition="'$(OS)' != 'Windows_NT'" Command=""$(BuildToolsPath)/TokenListGenerator" "$(CsGenIntermediateOutputPath)TSqlTokenTypes.txt" > "$(CsGenIntermediateOutputPath)ScriptGeneratorSupporter.Generated.cs"" />
<Exec Condition="'$(OS)' == 'Windows_NT'" Command=""$(BuildToolsPath)\ScriptGenSettingsGenerator.exe" "$(SQLSCRIPTDOM)\ScriptDom\SqlServer\Settings\SqlScriptGeneratorOptions.xml" "$(CsGenIntermediateOutputPath)SqlScriptGeneratorOptions.cs" "$(CsGenIntermediateOutputPath)SqlScriptGeneratorOptionsAdapter.Generated.cs"" />
<Exec Condition="'$(OS)' == 'Windows_NT'" Command=""$(BuildToolsPath)\TokenListGenerator.exe" "$(CsGenIntermediateOutputPath)TSqlTokenTypes.txt" > "$(CsGenIntermediateOutputPath)ScriptGeneratorSupporter.Generated.cs"" />
<ItemGroup>
<Compile Condition="'$(SqlDomNuget)'!='true'" Include="$(CsGenIntermediateOutputPath)ScriptGeneratorSupporter.Generated.cs" />
<Compile Condition="'$(SqlDomNuget)'!='true'" Include="$(CsGenIntermediateOutputPath)SqlScriptGeneratorOptions.cs" />
<Compile Condition="'$(SqlDomNuget)'!='true'" Include="$(CsGenIntermediateOutputPath)TSqlFragmentVisitor.codegen.cs" />
</ItemGroup>
</Target>
</Project>