// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // In this section you declare the used plugins // community plugins plugins { id "me.champeau.gradle.antlr4" version "0.1" // antlr4 community plugin. } // internal plugins apply plugin: 'java' apply plugin: 'maven' // only needed to generate POM or to upload artifacts to maven repos. apply plugin: 'eclipse' // Eclipse integration apply plugin: 'idea' // InteliJ IDEA integration apply plugin: 'project-report' //general properties jar { baseName = 'kiaraparser' version = '0.1.0' } description = """""" // java plugin properties sourceCompatibility = 1.8 targetCompatibility = 1.8 // additional compile options (linters) tasks.withType(JavaCompile) { options.compilerArgs.add('-Xlint:deprecation') options.compilerArgs.add('-Xlint:unchecked') } // maven-plugin properties group = 'com.eprosima.idl' // antlr4-plugin configuration // make the Java compile task depend on the antlr4 task compileJava.dependsOn antlr4 // add the generated source files to the list of java sources sourceSets.main.java.srcDirs += antlr4.output // add antlr4 to classpath configurations { compile.extendsFrom antlr4 } // In this section you declare where to find the dependencies of your project // see also: http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html#N10621 repositories { // You can declare any Maven/Ivy/file repository here. // e.g. for 'jcenter.bintray.com' for resolving your dependencies use: // jcenter() // and/or use the standard mavenCentral repositoy: mavenCentral() // and/or use use a custom maven repository: // maven { url "http://repo.mycompany.com/maven2" } } dependencies { compile group: 'org.antlr', name: 'antlr4', version:'4.5' compile group: 'org.antlr', name: 'stringtemplate', version:'3.2' } antlr4.source = project.file("src/main/antlr4/kiara") antlr4.listener = true antlr4.visitor = true antlr4.extraArgs=['-package', 'com.eprosima.idl.parser.grammar'] // make the Java compile task depend on the antlr4 task compileJava.dependsOn antlr4 // add the generated source files to the list of java sources sourceSets.main.java.srcDirs += antlr4.output // add antlr4 to classpath configurations { compile.extendsFrom antlr4 }