Add initial Antlr4BuildTasks project, copied Antlr4.targets from Antlr3.targets

This commit is contained in:
Sam Harwell 2013-02-25 12:12:09 -06:00
parent 9c86e627e3
commit 8cf6be9d89
4 changed files with 295 additions and 0 deletions

View File

@ -15,6 +15,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.Test", "Antlr4.Runtime.Test\Antlr4.Runtime.Test.csproj", "{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4BuildTasks", "Antlr4BuildTasks\Antlr4BuildTasks.csproj", "{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -29,6 +31,10 @@ Global
{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}.Release|Any CPU.Build.0 = Release|Any CPU
{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,169 @@
<!--
[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>3.5.0.1</TaskVersion>
<TaskKeyToken>eb42632606e9261f</TaskKeyToken>
<Antlr4BuildTaskAssemblyName Condition="'$(Antlr4BuildTaskAssemblyName)'==''">Antlr4BuildTask, Version=$(TaskVersion), Culture=neutral, PublicKeyToken=$(TaskKeyToken)</Antlr4BuildTaskAssemblyName>
</PropertyGroup>
<PropertyGroup>
<LoadTimeSensitiveTargets>
$(LoadTimeSensitiveTargets);
Antlr4Compile;
</LoadTimeSensitiveTargets>
<LoadTimeSensitiveProperties>
$(LoadTimeSensitiveProperties);
Antlr4CompileDependsOn;
</LoadTimeSensitiveProperties>
</PropertyGroup>
<PropertyGroup>
<Antlr4BuildTaskLocation Condition="'$(Antlr4BuildTaskPath)'==''">$(MSBuildBinPath)</Antlr4BuildTaskLocation>
<Antlr4BuildTaskLocation Condition="'$(Antlr4BuildTaskPath)'!=''">$(Antlr4BuildTaskPath)</Antlr4BuildTaskLocation>
<Antlr4ToolLocation Condition="'$(Antlr4ToolPath)'==''">$(MSBuildBinPath)\Antlr4\Antlr4.exe</Antlr4ToolLocation>
<Antlr4ToolLocation Condition="'$(Antlr4ToolPath)'!=''">$(Antlr4ToolPath)</Antlr4ToolLocation>
</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)\Antlr4BuildTask.dll" />
<PropertyGroup>
<PrepareResourcesDependsOn>
Antlr4Compile;
Antlr4CompileAddFilesGenerated;
$(PrepareResourcesDependsOn)
</PrepareResourcesDependsOn>
</PropertyGroup>
<PropertyGroup>
<Antlr4CompileDependsOn>
Antlr4CompileReadGeneratedFileList
</Antlr4CompileDependsOn>
</PropertyGroup>
<ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
<AvailableItemName Include="Antlr4" />
<AvailableItemName Include="Antlr4Tokens" />
<AvailableItemName Include="Antlr4AbstractGrammar" />
</ItemGroup>
<ItemDefinitionGroup>
<Antlr4>
<Generator>MSBuild:Compile</Generator>
<TargetLanguage/>
<DebugGrammar>false</DebugGrammar>
<ProfileGrammar>false</ProfileGrammar>
</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' ">
DesignTimeGrammarCompilation;
$(CoreCompileDependsOn)
</CoreCompileDependsOn>
</PropertyGroup>
<Target Name="DesignTimeGrammarCompilation">
<!-- 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
Antlr4ToolPath="$(Antlr4ToolLocation)"
BuildTaskPath="$(Antlr4BuildTaskLocation)"
OutputPath="$(IntermediateOutputPath)"
TargetLanguage="%(Antlr4.TargetLanguage)"
SourceCodeFiles="@(Antlr4)"
ContinueOnError="$(_IntellisenseOnlyCompile)"
TokensFiles="@(Antlr4Tokens)"
AbstractGrammarFiles="@(Antlr4AbstractGrammar)"
LanguageSourceExtensions="$(DefaultLanguageSourceExtension)"
DebugGrammar="%(Antlr4.DebugGrammar)"
ProfileGrammar="%(Antlr4.ProfileGrammar)">
<Output ItemName="Antlr4GeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
</Antlr4ClassGenerationTask>
<WriteLinesToFile
Condition="'$(_IntellisenseOnlyCompile)' != 'true'"
File="$(IntermediateOutputPath)$(Antlr4GenCodeFileNames)"
Lines="@(Antlr4GeneratedCodeFiles)"
Overwrite="true"/>
</Target>
<Target Name="Antlr4CompileAddFilesGenerated"
AfterTargets="Antlr4Compile"
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>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Antlr4BuildTasks</RootNamespace>
<AssemblyName>Antlr4BuildTasks</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Antlr4.targets" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,65 @@
/*
* [The "BSD license"]
* Copyright (c) 2013 Terence Parr
* 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.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Antlr4BuildTasks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Tunnel Vision Laboratories, LLC")]
[assembly: AssemblyProduct("Antlr4BuildTasks")]
[assembly: AssemblyCopyright("Copyright © Sam Harwell 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e79060d9-d211-4367-925a-5541943d3857")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]