Yigit Boyar | 0cb9fbb | 2015-06-16 02:25:52 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | apply plugin: 'java' |
Yigit Boyar | 63d4789 | 2015-07-10 09:03:05 -0700 | [diff] [blame] | 18 | apply plugin: 'com.android.databinding.bintray' |
Yigit Boyar | 0cb9fbb | 2015-06-16 02:25:52 -0700 | [diff] [blame] | 19 | |
Yigit Boyar | 0cb9fbb | 2015-06-16 02:25:52 -0700 | [diff] [blame] | 20 | sourceCompatibility = config.javaTargetCompatibility |
| 21 | targetCompatibility = config.javaSourceCompatibility |
Yigit Boyar | 0cb9fbb | 2015-06-16 02:25:52 -0700 | [diff] [blame] | 22 | |
| 23 | sourceSets { |
| 24 | main { |
| 25 | java { |
| 26 | srcDir 'src/main/java' |
| 27 | srcDir 'src/main/xml-gen' |
| 28 | srcDir 'src/main/grammar-gen' |
| 29 | } |
| 30 | } |
Yigit Boyar | 731b74f | 2015-06-25 10:50:24 -0700 | [diff] [blame] | 31 | test { |
| 32 | java { |
| 33 | srcDir 'src/test/java' |
| 34 | } |
| 35 | } |
| 36 | |
Yigit Boyar | 0cb9fbb | 2015-06-16 02:25:52 -0700 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | dependencies { |
Yigit Boyar | 24bec1c | 2015-07-09 10:51:54 -0700 | [diff] [blame^] | 40 | testCompile group: 'junit', name: 'junit', version: '4.12' |
Yigit Boyar | 0cb9fbb | 2015-06-16 02:25:52 -0700 | [diff] [blame] | 41 | compile project(':baseLibrary') |
| 42 | compile 'org.apache.commons:commons-lang3:3.3.2' |
Yigit Boyar | 0cb9fbb | 2015-06-16 02:25:52 -0700 | [diff] [blame] | 43 | compile 'com.tunnelvisionlabs:antlr4:4.5' |
| 44 | compile 'commons-io:commons-io:2.4' |
| 45 | } |
| 46 | |
| 47 | project.tasks.create(name : "generateXmlParser", type : JavaExec) { |
| 48 | classpath configurations.runtime |
| 49 | main "org.antlr.v4.Tool" |
| 50 | workingDir projectDir |
| 51 | args "XMLParser.g4", "-visitor", "-o", "src/main/java/android/databinding/parser", "-package", "android.databinding.parser", "-lib", "." |
| 52 | } |
| 53 | |
| 54 | project.tasks.create(name : "generateGrammar", type : JavaExec) { |
| 55 | classpath configurations.runtime |
| 56 | main "org.antlr.v4.Tool" |
| 57 | args "BindingExpression.g4", "-visitor", "-o", "src/main/grammar-gen/android/databinding/parser", "-package", "android.databinding.parser" |
| 58 | } |
| 59 | |