weexteam/weex_devtools_android

View on GitHub
inspector/build.gradle

Summary

Maintainability
Test Coverage
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

buildscript {

    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
        classpath "com.github.dcendents:android-maven-gradle-plugin:1.4.1"
    }
}
repositories {
//    flatDir {
//        dirs 'libs'
//    }
    maven { url "http://mvnrepo.alibaba-inc.com/mvn/repository" }
    mavenCentral()
    jcenter()
}



android {
    compileSdkVersion 23
    buildToolsVersion '25.0.0'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        consumerProguardFiles 'proguard-consumer.pro'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    lintOptions {
        abortOnError false
    }

    externalNativeBuild {

        // Encapsulates your CMake build configurations.
        cmake {

            // Provides a relative path to your CMake build script.
            path "CMakeLists.txt"
        }
    }
}

dependencies {
    // compile 'commons-cli:commons-cli:1.2'
    provided 'com.google.code.findbugs:jsr305:2.0.1'
    compile 'com.android.support:appcompat-v7:23.1.1'
    // optional
    testCompile 'junit:junit:4.12'
    testCompile('org.robolectric:robolectric:2.4') {
        exclude module: 'commons-logging'
        exclude module: 'httpclient'
    }
    testCompile 'org.powermock:powermock-api-mockito:1.6.1'
    testCompile 'org.powermock:powermock-module-junit4:1.6.1'
    provided "com.taobao.android:weex_sdk:${WEEX_SDK_VERSION}"
//    debugProvided project(path: ':weex_sdk', configuration: 'debug')
//    releaseProvided project(path: ':weex_sdk', configuration: 'release')
    provided "com.alibaba:fastjson:${FAST_JSON_VERSION}"
    provided "com.taobao.android.weex_inspection:protocol:${PROTOCOL_VERSION}"

    provided 'com.squareup.okhttp:okhttp:2.3.0'
    provided 'com.squareup.okhttp:okhttp-ws:2.3.0'
    provided 'com.android.support:recyclerview-v7:23.1.1'
}

//apply from: rootProject.file('release.gradle')

android.libraryVariants.all { variant ->
    def name = variant.name.capitalize()

    // Ugly kludge to rename license files in the bundled commons-cli
    // dependency so that they do not appear to describe Stetho's license.
//    configurations.compile.each {
//        if (it.getName() == 'commons-cli-1.2.jar') {
//            def depJarPath = it.getPath()
//            task "tidyCommonsCli${name}"(type: Copy) {
//                from zipTree(depJarPath)
//                into "build/commons-cli-tidy-${name}"
//                rename 'LICENSE', 'commons-cli-LICENSE'
//                rename 'NOTICE', 'commons-cli-NOTICE'
//            }
//        }
//    }

    task "metainf${name}"(type: Copy) {
        from rootProject.file('LICENSE')
        into "build/metainf-${name}/META-INF"
    }

    task "fatjar${name}"(type: Jar, dependsOn: ["jar${name}", "tidyCommonsCli${name}", "metainf${name}"]) {
        classifier = 'fatjar'
        from variant.javaCompile.destinationDir
        from "build/commons-cli-tidy-${name}"
        from "build/metainf-${name}"
    }
}


group = 'com.taobao.android'
description = """weex_inspector"""
version '0.17.0'

def siteUrl = 'https://github.com/weexteam/weex_devtools_android'
def gitUrl = 'https://github.com/weexteam/weex_devtools_android.git'


install {
    repositories.mavenInstaller {
        // This generates POM.xml with proper parameters
        pom {
            project {
                packaging 'aar'
                name 'weex_inspector'
                url siteUrl
                licenses {
                    license {
                        name 'The Apache Software License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id 'weex alibaba'
                        name 'weex alibaba'
                        email 'alibabaweex@gmail.com'
                    }
                }
                scm {
                    connection gitUrl
                    developerConnection gitUrl
                    url siteUrl
                }
            }
        }
    }
}

task sourcesJar(type: Jar) {
    from('src/main/java') {
        include '**'
    }
    classifier = 'sources'
}

artifacts {
    archives sourcesJar
}

task androidJavadocs(type: Javadoc) {
    failOnError = false
    options.encoding = "utf-8"
    source = android.sourceSets.main.java.srcDirs
    ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
    classpath += files(ext.androidJar)
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
    user = properties.getProperty("bintray.user")
    key = properties.getProperty("bintray.key")

    configurations = ['archives']
    pkg {
        repo = 'maven'
        name = 'weex_inspector'
        websiteUrl = siteUrl
        vcsUrl = gitUrl
        licenses = ["Apache-2.0"]
        publish = true
    }
}


//apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'