| buildscript { |
| repositories { |
| mavenCentral() |
| jcenter() |
| } |
| dependencies { |
| classpath 'com.android.tools.build:gradle:2.1.3' |
| classpath files('license/license-gradle-plugin-0.12.1.jar') |
| classpath files('license/maven-license-plugin-1.10.b1.jar') |
| classpath files('license/plexus-utils-3.0.24.jar') |
| classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.5.0' |
| } |
| } |
| |
| |
| plugins { |
| id "com.github.hierynomus.license" version "0.13.1" |
| } |
| |
| apply plugin: 'com.android.library' |
| apply plugin: 'com.github.hierynomus.license' |
| apply plugin: 'checkstyle' |
| |
| ext.disableCov = project.hasProperty('disableCov') ? project.getProperty('disableCov') : 'false' |
| if(!disableCov.toBoolean()){ |
| apply plugin: 'com.vanniktech.android.junit.jacoco' |
| junitJacoco { |
| excludes = ['com/taobao/weex/dom/flex/**','com/taobao/weex/ui/view/refresh/circlebar/**'] |
| } |
| } |
| |
| project.ext.set("androidTargetSDK",project.hasProperty('targetSDK') ? project.getProperty('targetSDK') as int : 21 ) |
| |
| task checkstyle(type: Checkstyle) { |
| configFile file("${project.rootDir}/config/quality/checkstyle.xml") // Where my checkstyle config is... |
| // configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath // Where is my suppressions file for checkstyle is... |
| source 'src' |
| include '**/*.java' |
| exclude '**/gen/**' |
| exclude '**/test/**' |
| exclude '**/com/taobao/weex/dom/flex/**' |
| classpath = files() |
| } |
| |
| checkstyle { |
| toolVersion = '6.9' |
| } |
| |
| version = "0.9.4" |
| |
| android { |
| compileSdkVersion 23 |
| buildToolsVersion "23.0.2" |
| resourcePrefix "weex" |
| |
| useLibrary 'org.apache.http.legacy' |
| def line |
| new File(projectDir,"assets/main.js").withReader { line = it.readLine() } |
| def m = line =~ /[A-Z\s]+\s+([0-9\.]+),\s+Build\s+[0-9]+/; |
| def jsfmVersion = m[0][1] |
| println jsfmVersion |
| |
| |
| def ARMEABI_Size = new File(projectDir,"libs/armeabi/libweexv8.so").length(); |
| def X86_Size = new File(projectDir,"libs/x86/libweexv8.so").length(); |
| println "ARMEABI_Size: "+ARMEABI_Size; |
| println "X86_Size:" + X86_Size; |
| |
| |
| defaultConfig { |
| buildConfigField "long", "ARMEABI_Size", "${ARMEABI_Size}" |
| buildConfigField "long", "X86_Size", "${X86_Size}" |
| buildConfigField "String", "buildJavascriptFrameworkVersion", "\"${jsfmVersion}\"" |
| buildConfigField "String", "buildVersion", "\"${version}\"" |
| minSdkVersion 14 |
| targetSdkVersion project.androidTargetSDK |
| versionCode 1 |
| versionName "1.0" |
| ndk { |
| abiFilters "armeabi","x86" |
| } |
| } |
| buildTypes { |
| release { |
| minifyEnabled false |
| proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| buildConfigField "boolean", "ENABLE_TRACE", "false" |
| } |
| |
| debug { |
| testCoverageEnabled true |
| buildConfigField "boolean", "ENABLE_TRACE", "true" |
| } |
| } |
| |
| sourceSets { |
| main { |
| assets.srcDirs = ['assets'] |
| jniLibs.srcDir(['libs']) |
| java { |
| srcDirs = ["src/main/java"]; |
| } |
| } |
| debug.setRoot('build-types/debug') |
| release.setRoot('build-types/release') |
| } |
| |
| compileOptions.encoding = "UTF-8" |
| lintOptions { |
| abortOnError false |
| } |
| compileOptions { |
| sourceCompatibility JavaVersion.VERSION_1_7 |
| targetCompatibility JavaVersion.VERSION_1_7 |
| } |
| testOptions { |
| unitTests.all { |
| maxHeapSize = "1024m" |
| jvmArgs += ['-XX:-UseSplitVerifier', '-noverify','-Xverify:none']/* fix VerifyError */ |
| } |
| } |
| } |
| |
| dependencies { |
| compile fileTree(include: ['*.jar'], dir: 'libs') |
| provided 'com.android.support:recyclerview-v7:23.1.1' |
| provided 'com.android.support:support-v4:23.1.1' |
| provided 'com.android.support:appcompat-v7:23.1.1' |
| provided 'com.alibaba:fastjson:1.1.46.android' |
| |
| testCompile 'com.alibaba:fastjson:1.1.46.android' |
| testCompile 'junit:junit:4.12' |
| testCompile 'org.hamcrest:hamcrest-core:1.3' |
| testCompile 'org.javassist:javassist:3.20.0-GA' |
| testCompile 'org.mockito:mockito-core:1.10.19' |
| testCompile 'org.objenesis:objenesis:2.1' |
| testCompile 'org.powermock:powermock-core:1.6.4' |
| testCompile 'org.powermock:powermock-api-mockito:1.6.4' |
| testCompile 'org.powermock:powermock-module-junit4-common:1.6.4' |
| testCompile 'org.powermock:powermock-module-junit4:1.6.4' |
| testCompile 'org.powermock:powermock-module-junit4-legacy:1.6.4' |
| testCompile 'org.powermock:powermock-module-testng:1.6.4' |
| testCompile 'org.powermock:powermock-classloading-xstream:1.6.4' |
| testCompile "org.powermock:powermock-module-junit4-rule:1.6.4" |
| testCompile 'org.robolectric:robolectric:3.0' |
| testCompile "org.robolectric:shadows-httpclient:3.0" |
| testCompile 'org.json:json:20160212' |
| } |
| |
| task licenseFormatWeex (type:nl.javadude.gradle.plugins.license.License) { |
| source = fileTree(dir: "../", |
| includes: [ |
| "sdk/src/main/java/**/*.java", |
| "common/src/main/java/**/*.java", |
| "playground/app/src/main/java/**/*.java" |
| ], |
| excludes: [ |
| "**/dom/flex/*.java" |
| ]) |
| } |
| |
| license{ |
| header=file("license/LICENSE") |
| } |
| preBuild.dependsOn licenseFormatWeex |
| |
| task wrapper(type: Wrapper) { |
| gradleVersion = '2.10' |
| } |