From e8af185a3d78ab8a578fa9ced616050c46bf4d14 Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Wed, 18 Jul 2018 20:48:38 +0800 Subject: [PATCH] Build a AAR archive alongside the APK --- python/servo/package_commands.py | 6 +- support/android/apk/build.gradle | 67 ++++- support/android/apk/jni/Android.mk | 2 +- support/android/apk/jni/Application.mk | 2 +- support/android/apk/servoapp/build.gradle | 245 ++--------------- .../java/com/mozilla/servo/MainActivity.java | 17 +- support/android/apk/servoview/build.gradle | 258 ++++++++++++++++++ .../android/apk/servoview/proguard-rules.pro | 21 ++ .../src/googlevr/AndroidManifest.xml | 2 +- .../servoview/src/main/AndroidManifest.xml | 2 + .../com/mozilla/servoview/NativeServo.java | 0 .../mozilla/servoview/ServoGLRenderer.java | 0 .../java/com/mozilla/servoview/ServoView.java | 1 - .../servoview/src/main/res/values/strings.xml | 3 + .../src/oculusvr/AndroidManifest.xml | 2 +- support/android/apk/settings.gradle | 2 +- 16 files changed, 395 insertions(+), 235 deletions(-) create mode 100644 support/android/apk/servoview/build.gradle create mode 100644 support/android/apk/servoview/proguard-rules.pro rename support/android/apk/{servoapp => servoview}/src/googlevr/AndroidManifest.xml (95%) create mode 100644 support/android/apk/servoview/src/main/AndroidManifest.xml rename support/android/apk/{servoapp => servoview}/src/main/java/com/mozilla/servoview/NativeServo.java (100%) rename support/android/apk/{servoapp => servoview}/src/main/java/com/mozilla/servoview/ServoGLRenderer.java (100%) rename support/android/apk/{servoapp => servoview}/src/main/java/com/mozilla/servoview/ServoView.java (99%) create mode 100644 support/android/apk/servoview/src/main/res/values/strings.xml rename support/android/apk/{servoapp => servoview}/src/oculusvr/AndroidManifest.xml (91%) diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 57fd986fe1a1..f84ba4669e09 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -214,10 +214,12 @@ def package(self, release=False, dev=False, android=None, debug=False, debugger= if flavor is not None: flavor_name = flavor.title() - task_name = "assemble" + flavor_name + build_type + build_mode + variant = ":assemble" + flavor_name + build_type + build_mode + apk_task_name = ":servoapp" + variant + aar_task_name = ":servoview" + variant try: with cd(path.join("support", "android", "apk")): - subprocess.check_call(["./gradlew", "--no-daemon", task_name], env=env) + subprocess.check_call(["./gradlew", "--no-daemon", apk_task_name, aar_task_name], env=env) except subprocess.CalledProcessError as e: print("Packaging Android exited with return value %d" % e.returncode) return e.returncode diff --git a/support/android/apk/build.gradle b/support/android/apk/build.gradle index 8a93ba9b041d..262b81ff55de 100644 --- a/support/android/apk/build.gradle +++ b/support/android/apk/build.gradle @@ -1,4 +1,5 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. +import org.apache.tools.ant.taskdefs.condition.Os + buildscript { repositories { jcenter() @@ -17,6 +18,68 @@ allprojects { } google() } +} + +// Utility methods +String getTargetDir(boolean debug, String arch) { + def basePath = project.rootDir.getParentFile().getParentFile().getParentFile().absolutePath + return basePath + '/target/' + getSubTargetDir(debug, arch) +} + +String getSubTargetDir(boolean debug, String arch) { + return getRustTarget(arch) + '/' + (debug ? 'debug' : 'release') +} + +String getJniLibsPath(boolean debug, String arch) { + return getTargetDir(debug, arch) + '/apk/jniLibs' +} + +static String getRustTarget(String arch) { + switch (arch.toLowerCase()) { + case 'arm' : return 'arm-linux-androideabi' + case 'armv7' : return 'armv7-linux-androideabi' + case 'arm64' : return 'aarch64-linux-android' + case 'x86' : return 'i686-linux-android' + default: throw new GradleException("Invalid target architecture " + arch) + } +} - buildDir = rootDir.absolutePath + "/../../../target/gradle" +static String getNDKAbi(String arch) { + switch (arch.toLowerCase()) { + case 'arm' : return 'armeabi' + case 'armv7' : return 'armeabi-v7a' + case 'arm64' : return 'arm64-v8a' + case 'x86' : return 'x86' + default: throw new GradleException("Invalid target architecture " + arch) + } +} + +String getNdkDir() { + // Read environment variable used in rust build system + String ndkDir = System.getenv('ANDROID_NDK') + if (ndkDir == null) { + ndkDir = System.getenv('ANDROID_NDK_HOME') + } + if (ndkDir == null) { + ndkDir = System.getenv('ANDROID_NDK_ROOT') + } + if (ndkDir == null) { + // Fallback to ndkDir in local.properties + def rootDir = project.rootDir + def localProperties = new File(rootDir, "local.properties") + Properties properties = new Properties() + localProperties.withInputStream { instr -> + properties.load(instr) + } + + ndkDir = properties.getProperty('ndk.dir') + } + + def cmd = Os.isFamily(Os.FAMILY_WINDOWS) ? 'ndk-build.cmd' : 'ndk-build' + def ndkbuild = new File(ndkDir + '/' + cmd) + if (!ndkbuild.exists()) { + throw new GradleException("Please set a valid NDK_HOME environment variable" + + "or ndk.dir path in local.properties file"); + } + return ndkbuild.absolutePath } diff --git a/support/android/apk/jni/Android.mk b/support/android/apk/jni/Android.mk index b16da56f57ea..eac2eac79a37 100644 --- a/support/android/apk/jni/Android.mk +++ b/support/android/apk/jni/Android.mk @@ -17,6 +17,6 @@ MY_LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_PATH:= $(SERVO_TARGET_DIR) -LOCAL_MODULE := servo +LOCAL_MODULE := servojni LOCAL_SRC_FILES := libsimpleservo.so include $(PREBUILT_SHARED_LIBRARY) diff --git a/support/android/apk/jni/Application.mk b/support/android/apk/jni/Application.mk index f54d4b98c016..3d71715554b5 100644 --- a/support/android/apk/jni/Application.mk +++ b/support/android/apk/jni/Application.mk @@ -1,4 +1,4 @@ NDK_TOOLCHAIN_VERSION := 4.9 -APP_MODULES := c++_shared servo +APP_MODULES := c++_shared servojni APP_PLATFORM := android-18 APP_STL:= c++_shared diff --git a/support/android/apk/servoapp/build.gradle b/support/android/apk/servoapp/build.gradle index 5568bd9e065b..45b3f57db464 100644 --- a/support/android/apk/servoapp/build.gradle +++ b/support/android/apk/servoapp/build.gradle @@ -1,7 +1,5 @@ apply plugin: 'com.android.application' -import groovy.io.FileType -import org.apache.tools.ant.taskdefs.condition.Os import java.util.regex.Matcher import java.util.regex.Pattern @@ -9,6 +7,8 @@ android { compileSdkVersion 27 buildToolsVersion '27.0.3' + buildDir = rootDir.absolutePath + "/../../../target/gradle/servoapp" + defaultConfig { applicationId "com.mozilla.servo" minSdkVersion 18 @@ -17,24 +17,12 @@ android { versionName "1.0.0" } - compileOptions { - incremental false - } - - splits { - density { - enable false - } - abi { - enable false - } - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + // Share all of that with servoview flavorDimensions "default" productFlavors { @@ -48,41 +36,25 @@ android { } } + splits { + density { + enable false + } + abi { + enable false + } + } + sourceSets { main { java.srcDirs = ['src/main/java'] assets.srcDirs = ['../../../../resources'] } - armDebug { - jniLibs.srcDirs = [getJniLibsPath(true, 'arm')] - } - armRelease { - jniLibs.srcDirs = [getJniLibsPath(false, 'arm')] - } - armv7Debug { - jniLibs.srcDirs = [getJniLibsPath(true, 'armv7')] - } - armv7Release { - jniLibs.srcDirs = [getJniLibsPath(false, 'armv7')] - } - arm64Debug { - jniLibs.srcDirs = [getJniLibsPath(true, 'arm64')] - } - arm64Release { - jniLibs.srcDirs = [getJniLibsPath(false, 'arm64')] - } - x86Debug { - jniLibs.srcDirs = [getJniLibsPath(true, 'x86')] - } - x86Release { - jniLibs.srcDirs = [getJniLibsPath(false, 'x86')] - } } + buildTypes { - // Default debug and release build types are used as templates debug { - jniDebuggable true } release { @@ -94,51 +66,28 @@ android { // Custom build types armDebug { initWith(debug) - ndk { - abiFilters getNDKAbi('arm') - } } + armRelease { initWith(release) - ndk { - abiFilters getNDKAbi('arm') - } } armv7Debug { initWith(debug) - ndk { - abiFilters getNDKAbi('armv7') - } } armv7Release { initWith(release) - ndk { - abiFilters getNDKAbi('armv7') - } } arm64Debug { initWith(debug) - ndk { - abiFilters getNDKAbi('arm64') - } } arm64Release { initWith(release) - ndk { - abiFilters getNDKAbi('arm64') - } } x86Debug { initWith(debug) - ndk { - abiFilters getNDKAbi('x86') - } } x86Release { initWith(release) - ndk { - abiFilters getNDKAbi('x86') - } } } @@ -149,165 +98,31 @@ android { } } - // Define apk output directory - applicationVariants.all { variant -> - variant.outputs.all { output -> + project.afterEvaluate { + android.applicationVariants.all { variant -> Pattern pattern = Pattern.compile(/^[\w\d]+([A-Z][\w\d]+)(Debug|Release)/) Matcher matcher = pattern.matcher(variant.name) if (!matcher.find()) { - throw "Invalid variant name for output" + throw new GradleException("Invalid variant name for output: " + variant.name) } def arch = matcher.group(1) def debug = variant.name.contains("Debug") - def path = "../../../../../" + getSubTargetDir(debug, arch) + "/servoapp.apk"; - outputFileName = new File(path) - } - } - - // Call our custom NDK Build task using flavor parameters - tasks.all { - compileTask -> - Pattern pattern = Pattern.compile(/^compile[A-Z][\w\d]+([A-Z][\w\d]+)(Debug|Release)/) - Matcher matcher = pattern.matcher(compileTask.name) - if (!matcher.find()) { - return - } - - def taskName = "ndkbuild" + compileTask.name - tasks.create(name: taskName, type: Exec) { - def debug = compileTask.name.contains("Debug") - def arch = matcher.group(1) - commandLine getNdkDir(), - 'APP_BUILD_SCRIPT=../jni/Android.mk', - 'NDK_APPLICATION_MK=../jni/Application.mk', - 'NDK_LIBS_OUT=' + getJniLibsPath(debug, arch), - 'NDK_OUT=' + getTargetDir(debug, arch) + '/apk/obj', - 'NDK_DEBUG=' + (debug ? '1' : '0'), - 'APP_ABI=' + getNDKAbi(arch), - 'SERVO_TARGET_DIR=' + getTargetDir(debug, arch) - } - - compileTask.dependsOn taskName + def finalFolder = getTargetDir(debug, arch) + def finalFile = new File(finalFolder, "servoapp.apk") + variant.outputs.all { output -> + Task copyAndRenameAPKTask = project.task("copyAndRename${variant.name.capitalize()}APK", type: Copy) { + from output.outputFile.getParent() + into finalFolder + include output.outputFileName + rename(output.outputFileName, finalFile.getName()) + } + variant.assemble.finalizedBy(copyAndRenameAPKTask) + } + } } } dependencies { - //Dependency list - def deps = [ - new ServoDependency("blurdroid.jar", "blurdroid") - ] - // Iterate all build types and dependencies - // For each dependency call the proper implementation command and set the correct dependency path - def list = ['arm', 'armv7', 'arm64', 'x86'] - for (arch in list) { - for (debug in [true, false]) { - String basePath = getTargetDir(debug, arch) + "/build" - String cmd = arch + (debug ? "Debug" : "Release") + "Implementation" - - for (ServoDependency dep : deps) { - String path = findDependencyPath(basePath, dep.fileName, dep.folderFilter) - if (path) { - "${cmd}" files(path) - } - } - } - } - googlevrImplementation 'com.google.vr:sdk-base:1.140.0' - googlevrImplementation(name: 'GVRService', ext: 'aar') - oculusvrImplementation(name: 'OVRService', ext: 'aar') implementation 'com.android.support.constraint:constraint-layout:1.1.2' + implementation project(':servoview') } - -// Utility methods -String getTargetDir(boolean debug, String arch) { - def basePath = project.rootDir.getParentFile().getParentFile().getParentFile().absolutePath - return basePath + '/target/' + getSubTargetDir(debug, arch) -} - -String getSubTargetDir(boolean debug, String arch) { - return getRustTarget(arch) + '/' + (debug ? 'debug' : 'release') -} - -String getJniLibsPath(boolean debug, String arch) { - return getTargetDir(debug, arch) + '/apk/jniLibs' -} - -static String getRustTarget(String arch) { - switch (arch.toLowerCase()) { - case 'arm' : return 'arm-linux-androideabi' - case 'armv7' : return 'armv7-linux-androideabi' - case 'arm64' : return 'aarch64-linux-android' - case 'x86' : return 'i686-linux-android' - default: throw new GradleException("Invalid target architecture " + arch) - } -} - -static String getNDKAbi(String arch) { - switch (arch.toLowerCase()) { - case 'arm' : return 'armeabi' - case 'armv7' : return 'armeabi-v7a' - case 'arm64' : return 'arm64-v8a' - case 'x86' : return 'x86' - default: throw new GradleException("Invalid target architecture " + arch) - } -} - -String getNdkDir() { - // Read environment variable used in rust build system - String ndkDir = System.getenv('ANDROID_NDK') - if (ndkDir == null) { - ndkDir = System.getenv('ANDROID_NDK_HOME') - } - if (ndkDir == null) { - // Fallback to ndkDir in local.properties - def rootDir = project.rootDir - def localProperties = new File(rootDir, "local.properties") - Properties properties = new Properties() - localProperties.withInputStream { instr -> - properties.load(instr) - } - - ndkDir = properties.getProperty('ndk.dir') - } - - def cmd = Os.isFamily(Os.FAMILY_WINDOWS) ? 'ndk-build.cmd' : 'ndk-build' - def ndkbuild = new File(ndkDir + '/' + cmd) - if (!ndkbuild.exists()) { - throw new GradleException("Please set a valid NDK_HOME environment variable" + - "or ndk.dir path in local.properties file"); - } - return ndkbuild.absolutePath -} - -// folderFilter can be used to improve search performance -static String findDependencyPath(String basePath, String filename, String folderFilter) { - File path = new File(basePath); - if (!path.exists()) { - return '' - } - - if (folderFilter) { - path.eachDir { - if (it.name.contains(folderFilter)) { - path = new File(it.absolutePath) - } - } - } - def result = '' - path.eachFileRecurse(FileType.FILES) { - if(it.name.equals(filename)) { - result = it.absolutePath - } - } - - return result -} - -class ServoDependency { - ServoDependency(String fileName, String folderFilter = null) { - this.fileName = fileName; - this.folderFilter = folderFilter; - } - public String fileName; - public String folderFilter; -} \ No newline at end of file diff --git a/support/android/apk/servoapp/src/main/java/com/mozilla/servo/MainActivity.java b/support/android/apk/servoapp/src/main/java/com/mozilla/servo/MainActivity.java index 266bf0ad4df3..addad7873d5b 100644 --- a/support/android/apk/servoapp/src/main/java/com/mozilla/servo/MainActivity.java +++ b/support/android/apk/servoapp/src/main/java/com/mozilla/servo/MainActivity.java @@ -3,17 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - package com.mozilla.servo; import android.app.Activity; import android.content.Context; -import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.system.ErrnoException; import android.system.Os; -import android.util.Log; import android.view.View; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; @@ -44,13 +41,13 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - mServoView = (ServoView)findViewById(R.id.servoview); - mBackButton = (Button)findViewById(R.id.backbutton); - mFwdButton = (Button)findViewById(R.id.forwardbutton); - mReloadButton = (Button)findViewById(R.id.reloadbutton); - mStopButton = (Button)findViewById(R.id.stopbutton); - mUrlField = (EditText)findViewById(R.id.urlfield); - mProgressBar = (ProgressBar)findViewById(R.id.progressbar); + mServoView = findViewById(R.id.servoview); + mBackButton = findViewById(R.id.backbutton); + mFwdButton = findViewById(R.id.forwardbutton); + mReloadButton = findViewById(R.id.reloadbutton); + mStopButton = findViewById(R.id.stopbutton); + mUrlField = findViewById(R.id.urlfield); + mProgressBar = findViewById(R.id.progressbar); mServoView.setClient(this); mBackButton.setEnabled(false); diff --git a/support/android/apk/servoview/build.gradle b/support/android/apk/servoview/build.gradle new file mode 100644 index 000000000000..17ec22830680 --- /dev/null +++ b/support/android/apk/servoview/build.gradle @@ -0,0 +1,258 @@ +apply plugin: 'com.android.library' + +import groovy.io.FileType +import java.util.regex.Matcher +import java.util.regex.Pattern + +android { + compileSdkVersion 27 + buildToolsVersion '27.0.3' + + buildDir = rootDir.absolutePath + "/../../../target/gradle/servoview" + + defaultConfig { + minSdkVersion 18 + targetSdkVersion 27 + versionCode 1 + versionName "1.0" + } + + compileOptions { + incremental false + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + flavorDimensions "default" + + productFlavors { + main { + } + googlevr { + minSdkVersion 21 + } + oculusvr { + minSdkVersion 21 + } + } + + splits { + density { + enable false + } + abi { + enable false + } + } + + + buildTypes { + // Default debug and release build types are used as templates + debug { + jniDebuggable true + } + + release { + signingConfig signingConfigs.debug // Change this to sign with a production key + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + + // Custom build types + armDebug { + initWith(debug) + ndk { + abiFilters getNDKAbi('arm') + } + } + armRelease { + initWith(release) + ndk { + abiFilters getNDKAbi('arm') + } + } + armv7Debug { + initWith(debug) + ndk { + abiFilters getNDKAbi('armv7') + } + } + armv7Release { + initWith(release) + ndk { + abiFilters getNDKAbi('armv7') + } + } + arm64Debug { + initWith(debug) + ndk { + abiFilters getNDKAbi('arm64') + } + } + arm64Release { + initWith(release) + ndk { + abiFilters getNDKAbi('arm64') + } + } + x86Debug { + initWith(debug) + ndk { + abiFilters getNDKAbi('x86') + } + } + x86Release { + initWith(release) + ndk { + abiFilters getNDKAbi('x86') + } + } + } + + sourceSets { + armDebug { + jniLibs.srcDirs = [getJniLibsPath(true, 'arm')] + } + armRelease { + jniLibs.srcDirs = [getJniLibsPath(false, 'arm')] + } + armv7Debug { + jniLibs.srcDirs = [getJniLibsPath(true, 'armv7')] + } + armv7Release { + jniLibs.srcDirs = [getJniLibsPath(false, 'armv7')] + } + arm64Debug { + jniLibs.srcDirs = [getJniLibsPath(true, 'arm64')] + } + arm64Release { + jniLibs.srcDirs = [getJniLibsPath(false, 'arm64')] + } + x86Debug { + jniLibs.srcDirs = [getJniLibsPath(true, 'x86')] + } + x86Release { + jniLibs.srcDirs = [getJniLibsPath(false, 'x86')] + } + } + + // Ignore default 'debug' and 'release' build types + variantFilter { variant -> + if(variant.buildType.name.equals('release') || variant.buildType.name.equals('debug')) { + variant.setIgnore(true); + } + } + + + // Call our custom NDK Build task using flavor parameters + tasks.all { + compileTask -> + Pattern pattern = Pattern.compile(/^compile[A-Z][\w\d]+([A-Z][\w\d]+)(Debug|Release)/) + Matcher matcher = pattern.matcher(compileTask.name) + if (!matcher.find()) { + return + } + + def taskName = "ndkbuild" + compileTask.name + tasks.create(name: taskName, type: Exec) { + def debug = compileTask.name.contains("Debug") + def arch = matcher.group(1) + commandLine getNdkDir(), + 'APP_BUILD_SCRIPT=../jni/Android.mk', + 'NDK_APPLICATION_MK=../jni/Application.mk', + 'NDK_LIBS_OUT=' + getJniLibsPath(debug, arch), + 'NDK_OUT=' + getTargetDir(debug, arch) + '/apk/obj', + 'NDK_DEBUG=' + (debug ? '1' : '0'), + 'APP_ABI=' + getNDKAbi(arch), + 'SERVO_TARGET_DIR=' + getTargetDir(debug, arch) + } + + compileTask.dependsOn taskName + } + + + project.afterEvaluate { + android.libraryVariants.all { variant -> + Pattern pattern = Pattern.compile(/^[\w\d]+([A-Z][\w\d]+)(Debug|Release)/) + Matcher matcher = pattern.matcher(variant.name) + if (!matcher.find()) { + throw new GradleException("Invalid variant name for output: " + variant.name) + } + def arch = matcher.group(1) + def debug = variant.name.contains("Debug") + def finalFolder = getTargetDir(debug, arch) + def finalFile = new File(finalFolder, "servoview.aar") + variant.outputs.all { output -> + Task copyAndRenameAARTask = project.task("copyAndRename${variant.name.capitalize()}AAR", type: Copy) { + from output.outputFile.getParent() + into finalFolder + include output.outputFileName + rename(output.outputFileName, finalFile.getName()) + } + variant.assemble.finalizedBy(copyAndRenameAARTask) + } + } + } +} + +dependencies { + + //Dependency list + def deps = [ + new ServoDependency("blurdroid.jar", "blurdroid") + ] + // Iterate all build types and dependencies + // For each dependency call the proper implementation command and set the correct dependency path + def list = ['arm', 'armv7', 'arm64', 'x86'] + for (arch in list) { + for (debug in [true, false]) { + String basePath = getTargetDir(debug, arch) + "/build" + String cmd = arch + (debug ? "Debug" : "Release") + "Implementation" + + for (ServoDependency dep : deps) { + String path = findDependencyPath(basePath, dep.fileName, dep.folderFilter) + if (path) { + "${cmd}" files(path) + } + } + } + } + + googlevrImplementation 'com.google.vr:sdk-base:1.140.0' + googlevrImplementation(name: 'GVRService', ext: 'aar') + oculusvrImplementation(name: 'OVRService', ext: 'aar') + implementation 'com.android.support.constraint:constraint-layout:1.1.2' +} + +// folderFilter can be used to improve search performance +static String findDependencyPath(String basePath, String filename, String folderFilter) { + File path = new File(basePath); + if (!path.exists()) { + return '' + } + + if (folderFilter) { + path.eachDir { + if (it.name.contains(folderFilter)) { + path = new File(it.absolutePath) + } + } + } + def result = '' + path.eachFileRecurse(FileType.FILES) { + if(it.name.equals(filename)) { + result = it.absolutePath + } + } + + return result +} + +class ServoDependency { + ServoDependency(String fileName, String folderFilter = null) { + this.fileName = fileName; + this.folderFilter = folderFilter; + } + public String fileName; + public String folderFilter; +} diff --git a/support/android/apk/servoview/proguard-rules.pro b/support/android/apk/servoview/proguard-rules.pro new file mode 100644 index 000000000000..f1b424510da5 --- /dev/null +++ b/support/android/apk/servoview/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/support/android/apk/servoapp/src/googlevr/AndroidManifest.xml b/support/android/apk/servoview/src/googlevr/AndroidManifest.xml similarity index 95% rename from support/android/apk/servoapp/src/googlevr/AndroidManifest.xml rename to support/android/apk/servoview/src/googlevr/AndroidManifest.xml index f0bcffd707fd..c656c860e014 100644 --- a/support/android/apk/servoapp/src/googlevr/AndroidManifest.xml +++ b/support/android/apk/servoview/src/googlevr/AndroidManifest.xml @@ -1,6 +1,6 @@ - + diff --git a/support/android/apk/servoapp/src/main/java/com/mozilla/servoview/NativeServo.java b/support/android/apk/servoview/src/main/java/com/mozilla/servoview/NativeServo.java similarity index 100% rename from support/android/apk/servoapp/src/main/java/com/mozilla/servoview/NativeServo.java rename to support/android/apk/servoview/src/main/java/com/mozilla/servoview/NativeServo.java diff --git a/support/android/apk/servoapp/src/main/java/com/mozilla/servoview/ServoGLRenderer.java b/support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoGLRenderer.java similarity index 100% rename from support/android/apk/servoapp/src/main/java/com/mozilla/servoview/ServoGLRenderer.java rename to support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoGLRenderer.java diff --git a/support/android/apk/servoapp/src/main/java/com/mozilla/servoview/ServoView.java b/support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoView.java similarity index 99% rename from support/android/apk/servoapp/src/main/java/com/mozilla/servoview/ServoView.java rename to support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoView.java index 2cf2c257a78c..1dbc76e28aeb 100644 --- a/support/android/apk/servoapp/src/main/java/com/mozilla/servoview/ServoView.java +++ b/support/android/apk/servoview/src/main/java/com/mozilla/servoview/ServoView.java @@ -6,7 +6,6 @@ package com.mozilla.servoview; import android.app.Activity; -import android.os.Build; import android.content.Context; import android.content.res.AssetManager; import android.net.Uri; diff --git a/support/android/apk/servoview/src/main/res/values/strings.xml b/support/android/apk/servoview/src/main/res/values/strings.xml new file mode 100644 index 000000000000..3f959010c8af --- /dev/null +++ b/support/android/apk/servoview/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + servoview + diff --git a/support/android/apk/servoapp/src/oculusvr/AndroidManifest.xml b/support/android/apk/servoview/src/oculusvr/AndroidManifest.xml similarity index 91% rename from support/android/apk/servoapp/src/oculusvr/AndroidManifest.xml rename to support/android/apk/servoview/src/oculusvr/AndroidManifest.xml index 9b8e8817b3d2..c5b9ffdfc7d9 100644 --- a/support/android/apk/servoapp/src/oculusvr/AndroidManifest.xml +++ b/support/android/apk/servoview/src/oculusvr/AndroidManifest.xml @@ -1,6 +1,6 @@ -> +> diff --git a/support/android/apk/settings.gradle b/support/android/apk/settings.gradle index 9c4a80cb7921..196244ebecae 100644 --- a/support/android/apk/settings.gradle +++ b/support/android/apk/settings.gradle @@ -1 +1 @@ -include ':servoapp' +include ':servoapp', ':servoview'