forked from eProsima/IDL-Parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkiara.gradle
90 lines (76 loc) · 2.81 KB
/
kiara.gradle
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
85
86
87
88
89
90
// 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
}