forked from jasder/antlr
188 lines
8.0 KiB
XML
188 lines
8.0 KiB
XML
<!--
|
|
[The "BSD licence"]
|
|
Copyright (c) 2013 Sam Harwell
|
|
All rights reserved.
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
modification, are permitted provided that the following conditions
|
|
are met:
|
|
1. Redistributions of source code must retain the above copyright
|
|
notice, this list of conditions and the following disclaimer.
|
|
2. Redistributions in binary form must reproduce the above copyright
|
|
notice, this list of conditions and the following disclaimer in the
|
|
documentation and/or other materials provided with the distribution.
|
|
3. The name of the author may not be used to endorse or promote products
|
|
derived from this software without specific prior written permission.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
-->
|
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
<PropertyGroup>
|
|
<BuildSystem>MSBuild</BuildSystem>
|
|
<TaskVersion>4.0.0.0</TaskVersion>
|
|
<TaskKeyToken>eb42632606e9261f</TaskKeyToken>
|
|
<Antlr4BuildTaskAssemblyName Condition="'$(Antlr4BuildTaskAssemblyName)'==''">Antlr4BuildTasks.v3.5, Version=$(TaskVersion), Culture=neutral, PublicKeyToken=$(TaskKeyToken)</Antlr4BuildTaskAssemblyName>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<LoadTimeSensitiveTargets>
|
|
$(LoadTimeSensitiveTargets);
|
|
Antlr4Compile;
|
|
Antlr4CompileAddFilesGenerated;
|
|
</LoadTimeSensitiveTargets>
|
|
<LoadTimeSensitiveProperties>
|
|
$(LoadTimeSensitiveProperties);
|
|
Antlr4CompileDependsOn;
|
|
Antlr4CompileAddFilesGeneratedDependsOn;
|
|
</LoadTimeSensitiveProperties>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<Antlr4BuildTaskLocation Condition="'$(Antlr4BuildTaskPath)'==''">$(MSBuildBinPath)</Antlr4BuildTaskLocation>
|
|
<Antlr4BuildTaskLocation Condition="'$(Antlr4BuildTaskPath)'!=''">$(Antlr4BuildTaskPath)</Antlr4BuildTaskLocation>
|
|
<Antlr4ToolLocation Condition="'$(Antlr4ToolPath)'==''">$(MSBuildBinPath)\Antlr4\antlr4-csharp-4.0.1-SNAPSHOT-complete.jar</Antlr4ToolLocation>
|
|
<Antlr4ToolLocation Condition="'$(Antlr4ToolPath)'!=''">$(Antlr4ToolPath)</Antlr4ToolLocation>
|
|
|
|
<Antlr4JavaVendor Condition="'$(Antlr4JavaVendor)'==''">JavaSoft</Antlr4JavaVendor>
|
|
<Antlr4JavaInstallation Condition="'$(Antlr4JavaInstallation)'==''">Java Runtime Environment</Antlr4JavaInstallation>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<Antlr4GenCodeFileNames Condition="'$(Antlr4GenCodeFileNames)'==''">$(MSBuildProjectFile).Antlr4GeneratedCodeFileListAbsolute.txt</Antlr4GenCodeFileNames>
|
|
</PropertyGroup>
|
|
|
|
<UsingTask Condition="'$(Antlr4BuildTaskPath)'==''" TaskName="Antlr4.Build.Tasks.Antlr4ClassGenerationTask" AssemblyName="$(Antlr4BuildTaskAssemblyName)" />
|
|
<UsingTask Condition="'$(Antlr4BuildTaskPath)'!=''" TaskName="Antlr4.Build.Tasks.Antlr4ClassGenerationTask" AssemblyFile="$(Antlr4BuildTaskPath)\Antlr4BuildTasks.v3.5.dll" />
|
|
|
|
<PropertyGroup>
|
|
<PrepareResourcesDependsOn>
|
|
Antlr4Compile;
|
|
Antlr4CompileAddFilesGenerated;
|
|
$(PrepareResourcesDependsOn)
|
|
</PrepareResourcesDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<Antlr4CompileDependsOn>
|
|
Antlr4CompileReadGeneratedFileList
|
|
</Antlr4CompileDependsOn>
|
|
<Antlr4CompileAddFilesGeneratedDependsOn>
|
|
Antlr4Compile
|
|
</Antlr4CompileAddFilesGeneratedDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
|
|
<AvailableItemName Include="Antlr4" />
|
|
<AvailableItemName Include="Antlr4Tokens" />
|
|
<AvailableItemName Include="Antlr4AbstractGrammar" />
|
|
</ItemGroup>
|
|
|
|
<ItemDefinitionGroup>
|
|
<Antlr4>
|
|
<Generator>MSBuild:Compile</Generator>
|
|
<CustomToolNamespace>$(RootNamespace)</CustomToolNamespace>
|
|
<TargetLanguage>CSharp</TargetLanguage>
|
|
<Listener>true</Listener>
|
|
<Visitor>true</Visitor>
|
|
<Abstract>false</Abstract>
|
|
<ForceAtn>false</ForceAtn>
|
|
</Antlr4>
|
|
</ItemDefinitionGroup>
|
|
|
|
<Target Name="Antlr4CompileReadGeneratedFileList">
|
|
<ReadLinesFromFile File="$(IntermediateOutputPath)$(Antlr4GenCodeFileNames)">
|
|
<Output TaskParameter="Lines" ItemName="Antlr4OutputCodeFilesList"/>
|
|
</ReadLinesFromFile>
|
|
</Target>
|
|
|
|
<PropertyGroup>
|
|
<!-- Add grammar compilation to the CoreCompileDependsOn so that the IDE inproc compilers (particularly VB)
|
|
can "see" the generated source files. -->
|
|
<CoreCompileDependsOn Condition="'$(BuildingInsideVisualStudio)' == 'true' ">
|
|
Antlr4DesignTimeGrammarCompilation;
|
|
$(CoreCompileDependsOn)
|
|
</CoreCompileDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="Antlr4DesignTimeGrammarCompilation">
|
|
<!-- Only if we are not actually performing a compile i.e. we are in design mode -->
|
|
<CallTarget Condition="'$(BuildingProject)' != 'true'"
|
|
Targets="Antlr4Compile" />
|
|
</Target>
|
|
|
|
<Target Name="Antlr4Compile"
|
|
DependsOnTargets="$(Antlr4CompileDependsOn)"
|
|
Condition="'@(Antlr4)' != ''"
|
|
Inputs="@(Antlr4);@(Antlr4Tokens);@(Antlr4AbstractGrammar)"
|
|
Outputs="@(Antlr4OutputCodeFilesList);
|
|
$(IntermediateOutputPath)$(Antlr4GenCodeFileNames);">
|
|
|
|
<ItemGroup>
|
|
<Antlr4GeneratedCodeFiles Remove="@(Antlr4GeneratedCodeFiles)" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<_IntellisenseOnlyCompile>false</_IntellisenseOnlyCompile>
|
|
<_IntellisenseOnlyCompile Condition="'$(BuildingProject)' != 'true'">true</_IntellisenseOnlyCompile>
|
|
</PropertyGroup>
|
|
<Antlr4ClassGenerationTask
|
|
ToolPath="$(Antlr4ToolLocation)"
|
|
JavaVendor="$(Antlr4JavaVendor)"
|
|
JavaInstallation="$(Antlr4JavaInstallation)"
|
|
BuildTaskPath="$(Antlr4BuildTaskLocation)"
|
|
OutputPath="$(IntermediateOutputPath)"
|
|
TargetLanguage="%(Antlr4.TargetLanguage)"
|
|
TargetFrameworkVersion="$(TargetFrameworkVersion)"
|
|
TargetNamespace="%(Antlr4.CustomToolNamespace)"
|
|
SourceCodeFiles="@(Antlr4 -> '%(FullPath)')"
|
|
ContinueOnError="$(_IntellisenseOnlyCompile)"
|
|
TokensFiles="@(Antlr4Tokens)"
|
|
AbstractGrammarFiles="@(Antlr4AbstractGrammar)"
|
|
LanguageSourceExtensions="$(DefaultLanguageSourceExtension)"
|
|
GenerateListener="%(Antlr4.Listener)"
|
|
GenerateVisitor="%(Antlr4.Visitor)"
|
|
ForceAtn="%(Antlr4.ForceAtn)"
|
|
AbstractGrammar="%(Antlr4.Abstract)">
|
|
|
|
<Output ItemName="Compile" TaskParameter="GeneratedCodeFiles" Condition="'$(_IntellisenseOnlyCompile)' == 'true'" />
|
|
<Output ItemName="Antlr4GeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
|
|
</Antlr4ClassGenerationTask>
|
|
|
|
<WriteLinesToFile
|
|
Condition="'$(_IntellisenseOnlyCompile)' != 'true'"
|
|
File="$(IntermediateOutputPath)$(Antlr4GenCodeFileNames)"
|
|
Lines="@(Antlr4GeneratedCodeFiles)"
|
|
Overwrite="true"/>
|
|
</Target>
|
|
|
|
<Target Name="Antlr4CompileAddFilesGenerated"
|
|
DependsOnTargets="$(Antlr4CompileAddFilesGeneratedDependsOn)"
|
|
Condition="'@(Antlr4)' != ''">
|
|
|
|
<ItemGroup>
|
|
<Antlr4GeneratedCodeFiles Condition="'@(Antlr4GeneratedCodeFiles)' == ''" Include="@(Antlr4OutputCodeFilesList)" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<FileWrites Include="@(Antlr4GeneratedCodeFiles);
|
|
$(IntermediateOutputPath)$(Antlr4GenCodeFileNames);" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<Compile Include="@(Antlr4GeneratedCodeFiles)" />
|
|
<!-- The WinFX "GenerateTemporaryTargetAssembly" target requires generated code files be added here. -->
|
|
<_GeneratedCodeFiles Include="@(Antlr4GeneratedCodeFiles)" />
|
|
</ItemGroup>
|
|
|
|
</Target>
|
|
</Project>
|