Home | History | Annotate | Download | only in runtime
      1 /*
      2  * Copyright (C) 2016 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 import android.support.LibraryVersions
     18 import android.support.SupportLibraryExtension
     19 
     20 apply plugin: android.support.FlatfootAndroidLibraryPlugin
     21 
     22 android {
     23     compileSdkVersion tools.current_sdk
     24     buildToolsVersion tools.build_tools_version
     25 
     26     defaultConfig {
     27         minSdkVersion flatfoot.min_sdk
     28         targetSdkVersion tools.current_sdk
     29 
     30         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
     31 
     32     }
     33 
     34     buildTypes.all {
     35         consumerProguardFiles 'proguard-rules.pro'
     36     }
     37 
     38     testOptions {
     39         unitTests.returnDefaultValues = true
     40     }
     41     compileOptions {
     42         sourceCompatibility JavaVersion.VERSION_1_7
     43         targetCompatibility JavaVersion.VERSION_1_7
     44     }
     45 }
     46 
     47 dependencies {
     48     api project(":room:common")
     49     api project(":persistence:db-framework")
     50     api project(":persistence:db")
     51     api project(":arch:runtime")
     52     provided project(":paging:common")
     53     provided project(":lifecycle:runtime")
     54     provided project(":lifecycle:extensions")
     55     compile libs.support.core_utils, libs.support_exclude_config
     56 
     57     testCompile project(":arch:core-testing")
     58     testCompile libs.junit
     59     testCompile libs.mockito_core
     60     testCompile libs.support.annotations
     61 
     62     androidTestImplementation libs.junit
     63     androidTestImplementation libs.test_runner,      { exclude module: 'support-annotations' }
     64     androidTestImplementation libs.espresso_core,    { exclude module: 'support-annotations' }
     65 }
     66 
     67 createAndroidCheckstyle(project)
     68 
     69 android.libraryVariants.all { variant ->
     70     def name = variant.buildType.name
     71     def suffix = name.capitalize()
     72     project.tasks.create(name: "jar${suffix}", type: Jar){
     73         dependsOn variant.javaCompile
     74         from variant.javaCompile.destinationDir
     75         destinationDir new File(project.buildDir, "libJar")
     76     }
     77 }
     78 
     79 version = LibraryVersions.ROOM.toString()
     80 supportLibrary {
     81     name 'Android Room-Runtime'
     82     publish true
     83     inceptionYear '2017'
     84     description "Android Room-Runtime"
     85     url SupportLibraryExtension.ARCHITECTURE_URL
     86 }