Home | History | Annotate | Download | only in emoji-compat
      1 /*
      2  * Copyright (C) 2017 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'
     18 apply plugin: 'org.anarres.jarjar'
     19 apply plugin: 'maven'
     20 
     21 ext {
     22     flatbuffersDir = '../../flatbuffers'
     23 }
     24 
     25 buildscript {
     26     boolean unbundleBuild = (new File("unbundled-build")).exists()
     27     repositories {
     28         maven { url '../../../prebuilts/androidx/external' }
     29         if (unbundleBuild) {
     30             jcenter()
     31         }
     32     }
     33 
     34     dependencies {
     35         classpath 'org.anarres.jarjar:jarjar-gradle:1.0.1'
     36     }
     37 }
     38 
     39 sourceSets {
     40     main {
     41         java.srcDirs = ['src/java']
     42     }
     43 }
     44 
     45 compileJava {
     46     sourceCompatibility = JavaVersion.VERSION_1_7
     47     targetCompatibility = JavaVersion.VERSION_1_7
     48 }
     49 
     50 dependencies {
     51     compile 'com.google.flatbuffers:flatbuffers-java:1.8.0'
     52 }
     53 
     54 jarjar.repackage('rename') {
     55     destinationName "noto-emoji-compat-java.jar"
     56     from 'com.google.flatbuffers:flatbuffers-java:1.8.0'
     57     from files(sourceSets.main.output.classesDirs)
     58     dependsOn sourceSets.main.output
     59     classRename 'com.google.flatbuffers.**', 'androidx.text.emoji.flatbuffer.@1'
     60 }
     61 
     62 configurations {
     63     parser
     64 }
     65 
     66 artifacts {
     67     parser(rename.destinationPath) {
     68         name 'noto-emoji-compat'
     69         type 'jar'
     70         builtBy rename
     71     }
     72 }
     73 
     74 // The "javadoc" task is unused so we don't want it to appear in the output of `./gradlew tasks`
     75 // So, we set the group to null
     76 tasks["javadoc"].group = null
     77