Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [Android] Support arm64 by upgrading NDK to 16 and Gradle Plugin fo…
Browse files Browse the repository at this point in the history
…r Android to 3.2.1 (#2561)
  • Loading branch information
Darin726 authored and YorkShen committed Jun 18, 2019
1 parent 113f234 commit 61ef256
Show file tree
Hide file tree
Showing 40 changed files with 253 additions and 260 deletions.
47 changes: 21 additions & 26 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/


buildscript {
repositories {
jcenter {
mavenLocal()
maven(){
url 'https://maven.aliyun.com/repository/google'
}
jcenter(){
url 'https://maven.aliyun.com/repository/jcenter'
}
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

Expand All @@ -41,23 +26,33 @@ subprojects {
}
}
repositories {
mavenLocal()
if(project.hasProperty('external_repositories')){
maven {
url external_repositories
}
}
jcenter {
maven(){
url 'https://maven.aliyun.com/repository/google'
}
jcenter(){
url 'https://maven.aliyun.com/repository/jcenter'
}
mavenCentral()
mavenLocal()
}
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
repositories {
mavenLocal()
maven(){
url 'https://maven.aliyun.com/repository/google'
}
jcenter(){
url 'https://maven.aliyun.com/repository/jcenter'
}
}
}
ext {
compileSdkVersion=26
Expand Down
50 changes: 25 additions & 25 deletions android/commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply plugin: 'com.android.library'
android {

compileSdkVersion project.compileSdkVersion
buildToolsVersion project.buildToolsVersion
// buildToolsVersion project.buildToolsVersion
resourcePrefix "weexcomm"

defaultConfig {
Expand Down Expand Up @@ -41,32 +41,32 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':weex_sdk')
compile "com.android.support:support-v4:${project.supportLibVersion}"
compile "com.android.support:appcompat-v7:${project.supportLibVersion}"
// compile project(':weex_sdk')
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.fresco:fresco:0.10.0'
compile 'com.taobao.android.weex_inspection:protocol:1.1.4.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':weex_sdk')
implementation "com.android.support:support-v4:${project.supportLibVersion}"
implementation "com.android.support:appcompat-v7:${project.supportLibVersion}"
// implementation project(':weex_sdk')
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.facebook.fresco:fresco:0.10.0'
implementation 'com.taobao.android.weex_inspection:protocol:1.1.4.1'

provided 'com.taobao.android:weex_analyzer:0.1.0.5'
provided 'com.squareup.okhttp:okhttp:2.3.0'
provided 'com.squareup.okhttp:okhttp-ws:2.3.0'
provided "com.alibaba:fastjson:${project.fastjsonLibVersion}"
compileOnly 'com.taobao.android:weex_analyzer:0.1.0.5'
compileOnly 'com.squareup.okhttp:okhttp:2.3.0'
compileOnly 'com.squareup.okhttp:okhttp-ws:2.3.0'
compileOnly "com.alibaba:fastjson:${project.fastjsonLibVersion}"

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.robolectric:robolectric:3.0-rc3'
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest-core:1.3'
testImplementation 'org.javassist:javassist:3.20.0-GA'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.objenesis:objenesis:2.1'
testImplementation 'org.powermock:powermock-core:1.6.4'
testImplementation 'org.powermock:powermock-api-mockito:1.6.4'
testImplementation 'org.powermock:powermock-module-junit4-common:1.6.4'
testImplementation 'org.powermock:powermock-module-junit4:1.6.4'
testImplementation 'org.powermock:powermock-module-junit4-legacy:1.6.4'
testImplementation 'org.powermock:powermock-module-testng:1.6.4'
testImplementation 'org.robolectric:robolectric:3.0-rc3'
}

if(file('../license/LICENSE').exists()){
Expand Down
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Apr 23 15:37:25 CST 2018
#Tue May 28 20:11:48 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
68 changes: 34 additions & 34 deletions android/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'jacoco'
//apply plugin: 'jacoco'

jacoco {
toolVersion = "0.7.9+"
Expand All @@ -7,37 +7,37 @@ jacoco {
//def sdk_path = '../../sdk'
//println(sdk_path)

def coverageSourceDirs = [
'../app/src/main/java',
'../../../android/sdk/src/main/java']
//def coverageSourceDirs = [
// '../app/src/main/java',
// '../../../android/sdk/src/main/java']

task jacocoTestReport(type: JacocoReport) {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled = true
html.enabled = true
}
classDirectories = fileTree(//"enter code here"
dir: '../../sdk/build/intermediates/classes',
excludes: ['**/R*.class',
'**/*$InjectAdapter.class',
'**/*$ModuleAdapter.class',
'**/*$ViewInjector*.class'
])
sourceDirectories = files(coverageSourceDirs)
File configFile = file('../../../android/sdk/src/main/java')
configFile = file(configFile.absolutePath)
println configFile.path



executionData = files("$buildDir/outputs/code-coverage/connected/coverage.ec")
doFirst {
new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
if (file.name.contains('$$')) {
file.renameTo(file.path.replace('$$', '$'))
}
}
}
}
//task jacocoTestReport(type: JacocoReport) {
// group = "Reporting"
// description = "Generate Jacoco coverage reports after running tests."
// reports {
// xml.enabled = true
// html.enabled = true
// }
// classDirectories = fileTree(//"enter code here"
// dir: '../../sdk/build/intermediates/classes',
// excludes: ['**/R*.class',
// '**/*$InjectAdapter.class',
// '**/*$ModuleAdapter.class',
// '**/*$ViewInjector*.class'
// ])
// sourceDirectories = files(coverageSourceDirs)
// File configFile = file('../../../android/sdk/src/main/java')
// configFile = file(configFile.absolutePath)
// println configFile.path
//
//
//
// executionData = files("$buildDir/outputs/code-coverage/connected/coverage.ec")
// doFirst {
// new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
// if (file.name.contains('$$')) {
// file.renameTo(file.path.replace('$$', '$'))
// }
// }
// }
//}
71 changes: 35 additions & 36 deletions android/playground/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion project.compileSdkVersion
buildToolsVersion project.buildToolsVersion

defaultConfig {
applicationId "com.alibaba.weex"
minSdkVersion project.minSdkVersion
Expand All @@ -17,7 +15,7 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
ndk{
abiFilters "armeabi-v7a","armeabi","x86"
abiFilters "arm64-v8a", "armeabi-v7a", "x86"
}
}
applicationVariants.all { variant ->
Expand Down Expand Up @@ -71,57 +69,58 @@ android {


dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile "com.android.support:support-annotations:${project.supportLibVersion}"
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'org.awaitility:awaitility:3.0.0'
androidTestCompile 'org.awaitility:awaitility-proxy:3.0.0'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2', {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation "com.android.support:support-annotations:${project.supportLibVersion}"
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'org.awaitility:awaitility:3.0.0'
androidTestImplementation 'org.awaitility:awaitility-proxy:3.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestImplementation('com.android.support.test.espresso:espresso-contrib:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'recyclerview-v7'
})
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.squareup.picasso:picasso:2.5.2'
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.squareup.picasso:picasso:2.5.2'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
/*source dependency*/

compile project(':commons')
compile project(':weex_sdk')
implementation project(':commons')
implementation project(':weex_sdk')
//https://github.com/weexteam/weex-analyzer-android
//Weex-Analyzer provides several convenient tools such as Memory Monitor
// to optimize your application. It's not available by default,you can
// set WXAnalyzerDelegate#DEBUG==true to enable it
debugCompile 'com.taobao.android:weex_analyzer:0.1.0.5'
debugImplementation 'com.taobao.android:weex_analyzer:0.1.0.5'


compile 'com.loopj.android:android-async-http:1.4.9@aar'
compile 'com.facebook.fresco:fresco:0.12.0+'
compile 'com.facebook.fresco:animated-gif:0.12.0'
implementation 'com.loopj.android:android-async-http:1.4.9@aar'
implementation 'com.facebook.fresco:fresco:0.12.0+'
implementation 'com.facebook.fresco:animated-gif:0.12.0'

compile 'com.google.zxing:core:3.3.3'
implementation 'com.google.zxing:core:3.3.3'

compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.okhttp:okhttp-ws:2.3.0'
compile 'com.squareup.okio:okio:1.0.1'
compile "com.alibaba:fastjson:${project.fastjsonLibVersion}"
compile "com.android.support:support-v4:${project.supportLibVersion}"
compile "com.android.support:appcompat-v7:${project.supportLibVersion}"
compile "com.android.support:design:${project.supportLibVersion}"
compile "com.android.support:support-annotations:${project.supportLibVersion}"
compile 'com.jakewharton.scalpel:scalpel:1.1.2'
compile 'com.taobao.android.weex_inspection:urlconnection_interceptor:1.0.0'
compile 'com.android.support.test.espresso:espresso-idling-resource:2.2.2'
compile 'com.taobao.android:weex_inspector:0.24.2.4'
//compile project(":weex_inspector")
implementation 'com.squareup.okhttp:okhttp:2.3.0'
implementation 'com.squareup.okhttp:okhttp-ws:2.3.0'
implementation 'com.squareup.okio:okio:1.0.1'
implementation "com.alibaba:fastjson:${project.fastjsonLibVersion}"
implementation "com.android.support:support-v4:${project.supportLibVersion}"
implementation "com.android.support:appcompat-v7:${project.supportLibVersion}"
implementation "com.android.support:design:${project.supportLibVersion}"
implementation "com.android.support:support-annotations:${project.supportLibVersion}"
implementation 'com.jakewharton.scalpel:scalpel:1.1.2'
implementation 'com.taobao.android.weex_inspection:urlconnection_interceptor:1.0.0'
implementation 'com.taobao.android.weex_inspection:protocol:1.1.4.1'
implementation 'com.android.support.test.espresso:espresso-idling-resource:2.2.2'
implementation 'com.taobao.android:weex_inspector:0.24.2.4'
//implementation project(":weex_inspector")

// Bind actions to effects. See https://alibaba.github.io/bindingx/
compile 'com.alibaba.android:bindingx-core:1.1.1.2@aar'
compile 'com.alibaba.android:bindingx_weex_plugin:1.1.1@aar'
implementation 'com.alibaba.android:bindingx-core:1.1.1.2@aar'
implementation 'com.alibaba.android:bindingx_weex_plugin:1.1.1@aar'
}

if(file('../../license/LICENSE').exists()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.support.multidex.MultiDex;

import com.alibaba.android.bindingx.plugin.weex.BindingX;
import com.alibaba.weex.commons.adapter.DefaultWebSocketAdapterFactory;
Expand Down Expand Up @@ -55,7 +56,7 @@ public class WXApplication extends Application {
@Override
public void onCreate() {
super.onCreate();

MultiDex.install(this);
/**
* Set up for fresco usage.
* Set<RequestListener> requestListeners = new HashSet<>();
Expand Down
4 changes: 1 addition & 3 deletions android/playground/app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@
android:summary="@string/preferences_remember_duplicates_summary"/>
<CheckBoxPreference
android:key="preferences_history"
android:defaultValue="true"
android:title="@string/preferences_history_title"
android:summary="@string/preferences_history_summary"/>
android:defaultValue="true"/>
<CheckBoxPreference
android:key="preferences_supplemental"
android:defaultValue="true"
Expand Down
Loading

0 comments on commit 61ef256

Please sign in to comment.