blob: bc59c72127727ea34d4453cadc1c0a500b529ba5 [file] [log] [blame]
Yigit Boyar0cb9fbb2015-06-16 02:25:52 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17apply plugin: 'java'
18
19
Yigit Boyar0cb9fbb2015-06-16 02:25:52 -070020sourceCompatibility = config.javaTargetCompatibility
21targetCompatibility = config.javaSourceCompatibility
22repositories {
23 mavenCentral()
24}
25
26sourceSets {
27 main {
28 java {
29 srcDir 'src/main/java'
30 srcDir 'src/main/xml-gen'
31 srcDir 'src/main/grammar-gen'
32 }
33 }
Yigit Boyar731b74f2015-06-25 10:50:24 -070034 test {
35 java {
36 srcDir 'src/test/java'
37 }
38 }
39
Yigit Boyar0cb9fbb2015-06-16 02:25:52 -070040}
41
42dependencies {
43 testCompile group: 'junit', name: 'junit', version: '4.11'
44 compile project(':baseLibrary')
45 compile 'org.apache.commons:commons-lang3:3.3.2'
Yigit Boyar0cb9fbb2015-06-16 02:25:52 -070046 compile 'com.tunnelvisionlabs:antlr4:4.5'
47 compile 'commons-io:commons-io:2.4'
48}
49
50project.tasks.create(name : "generateXmlParser", type : JavaExec) {
51 classpath configurations.runtime
52 main "org.antlr.v4.Tool"
53 workingDir projectDir
54 args "XMLParser.g4", "-visitor", "-o", "src/main/java/android/databinding/parser", "-package", "android.databinding.parser", "-lib", "."
55}
56
57project.tasks.create(name : "generateGrammar", type : JavaExec) {
58 classpath configurations.runtime
59 main "org.antlr.v4.Tool"
60 args "BindingExpression.g4", "-visitor", "-o", "src/main/grammar-gen/android/databinding/parser", "-package", "android.databinding.parser"
61}
62