diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2016-10-06 18:13:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-06 18:13:09 +0200 |
| commit | f028b7079e1a9b3e3a7ef8f78e54fca315643ef1 (patch) | |
| tree | d96c4dff602309e33d295928244ed97af56577e9 /Source/Android/app | |
| parent | 3c822f2c55a436d1b5c8c1f075dd8e9fad219b6e (diff) | |
| parent | 05eff01229c8552871c3613c0115a91f22cf8dd6 (diff) | |
Merge pull request #4252 from degasus/android
Android: Update the gradle file to use android studio 2.2 cmake.
Diffstat (limited to 'Source/Android/app')
| -rw-r--r-- | Source/Android/app/.gitignore | 1 | ||||
| -rw-r--r-- | Source/Android/app/build.gradle | 209 | ||||
| -rw-r--r-- | Source/Android/app/src/arm_64/res/values/arrays.xml | 18 | ||||
| -rw-r--r-- | Source/Android/app/src/arm_64/res/values/strings.xml | 5 | ||||
| -rw-r--r-- | Source/Android/app/src/main/res/layout/dialog_game_details.xml | 4 | ||||
| -rw-r--r-- | Source/Android/app/src/main/res/values/arrays.xml | 6 | ||||
| -rw-r--r-- | Source/Android/app/src/x86_64/res/values/arrays.xml | 18 |
7 files changed, 27 insertions, 234 deletions
diff --git a/Source/Android/app/.gitignore b/Source/Android/app/.gitignore index 796b96d1c4..0886f94956 100644 --- a/Source/Android/app/.gitignore +++ b/Source/Android/app/.gitignore @@ -1 +1,2 @@ /build +/.externalNativeBuild diff --git a/Source/Android/app/build.gradle b/Source/Android/app/build.gradle index 3cdbade125..f82df2b1d5 100644 --- a/Source/Android/app/build.gradle +++ b/Source/Android/app/build.gradle @@ -2,8 +2,8 @@ apply plugin: 'com.android.application' android { // Leanback support requires >22 - compileSdkVersion 23 - buildToolsVersion '23.0.2' + compileSdkVersion 24 + buildToolsVersion '24.0.3' lintOptions { // This is important as it will run lint but not abort on error @@ -53,213 +53,40 @@ android { applicationIdSuffix ".debug" versionNameSuffix '-debug' jniDebuggable true - - tasks.withType(JavaCompile) { - compileTask -> compileTask.dependsOn(compileNative) - } } } - // Define product flavors, which can be split into categories. Common examples - // of product flavors are paid vs. free, ARM vs. x86, etc. - productFlavors { - arm_64 { - dimension "abi" - ndk { - abiFilter "arm64-v8a" - } + externalNativeBuild { + cmake { + path "../../../CMakeLists.txt" } + } - x86_64 { - dimension "abi" - ndk { - abiFilter "x86_64" + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID_STL=c++_static", "-DCMAKE_BUILD_TYPE=RelWithDebInfo", "-DENABLE_PCH=OFF" // , "-DENABLE_GENERIC=ON" + abiFilters "arm64-v8a" //, "armeabi-v7a", "x86_64", "x86" } } } } dependencies { - compile 'com.android.support:support-v13:23.1.1' - compile 'com.android.support:cardview-v7:23.1.1' - compile 'com.android.support:recyclerview-v7:23.1.1' - compile 'com.android.support:design:23.1.1' + compile 'com.android.support:support-v13:24.2.1' + compile 'com.android.support:cardview-v7:24.2.1' + compile 'com.android.support:recyclerview-v7:24.2.1' + compile 'com.android.support:design:24.2.1' // Android TV UI libraries. - compile 'com.android.support:leanback-v17:23.1.1' + compile 'com.android.support:leanback-v17:24.2.1' // For showing the banner as a circle a-la Material Design Guidelines - compile 'de.hdodenhof:circleimageview:1.2.2' + compile 'de.hdodenhof:circleimageview:2.1.0' // For loading huge screenshots from the disk. compile 'com.squareup.picasso:picasso:2.5.2' // Allows FRP-style asynchronous operations in Android. - compile 'io.reactivex:rxandroid:1.1.0' -} - -task setupCMake(type: Exec) { - // Check if a build properties file exists. - def propsFile = rootProject.file("build.properties") - - // If it does, call CMake. - if (propsFile.canRead()) { - // Read the properties file's contents. - def buildProperties = new Properties() - buildProperties.load(new FileInputStream(propsFile)) - - String abi = getAbi() - - mkdir('build/' + abi) - workingDir 'build/' + abi - - executable getExecutablePath("cmake") - - args "-DANDROID=true", - "-DANDROID_NATIVE_API_LEVEL=android-18", - "-DCMAKE_TOOLCHAIN_FILE=../../../android.toolchain.cmake", - "../../../../..", - "-DGIT_EXECUTABLE=" + getExecutablePath("git"), - "-DANDROID_NDK=" + getNdkPath(), - "-DANDROID_TOOLCHAIN_NAME=" + getToolchainName(), - "-DANDROID_ABI=" + abi - } else { - executable 'echo' - args 'No build.properties found; skipping CMake.' - } + compile 'io.reactivex:rxandroid:1.2.1' } - -task compileNative(type: Exec, dependsOn: 'setupCMake') { - // Check if a build properties file exists. - def propsFile = rootProject.file("build.properties") - - // If it does, call make. - if (propsFile.canRead()) { - // Read the properties file's contents. - def buildProperties = new Properties() - buildProperties.load(new FileInputStream(propsFile)) - - String abi = getAbi() - - workingDir 'build/' + abi - - executable 'make' - - if (buildProperties.makeArgs == null || buildProperties.makeArgs.isEmpty()) { - // TODO - } else { - args buildProperties.makeArgs - } - } else { - executable 'echo' - args 'No build.properties found; skipping native build.' - } -} - -String getExecutablePath(String command) { - def propsFile = rootProject.file("build.properties") - def path = null - - if (propsFile.canRead()) { - def buildProperties = new Properties() - buildProperties.load(new FileInputStream(propsFile)) - println buildProperties - path = buildProperties[command + "Path"] - } - - if (path == null || path.isEmpty()) { - try { - def stdout = new ByteArrayOutputStream() - - exec { - commandLine 'which', command - standardOutput = stdout - } - - path = stdout.toString().trim() - } catch (ignored) { - project.logger.error("Gradle error: Couldn't find " + command + " executable.") - } - } - - if (path != null) { - project.logger.quiet("Gradle: Found " + command + " executuable:" + path) - } - - return path -} - -String getNdkPath() { - def propsFile = rootProject.file("build.properties") - def ndkPath = null - - if (propsFile.canRead()) { - def buildProperties = new Properties() - buildProperties.load(new FileInputStream(propsFile)) - ndkPath = buildProperties.ndkPath - } - - if (ndkPath == null || ndkPath.isEmpty()) { - try { - def stdout = new ByteArrayOutputStream() - - exec { - // ndk-build.cmd is a file unique to the root directory of android-ndk-r10e. - commandLine 'locate', 'ndk-build.cmd' - standardOutput = stdout - } - - def ndkCmdPath = stdout.toString() - ndkPath = ndkCmdPath.substring(0, ndkCmdPath.lastIndexOf('/')) - } catch (ignored) { - project.logger.error("Gradle error: Couldn't find NDK.") - } - } - - if (ndkPath != null) { - project.logger.quiet("Gradle: Found Android NDK: " + ndkPath) - } - return ndkPath -} - -String getAbi() { - String taskName = getGradle().startParameter.taskNames[0] - String abi; - - if (taskName == null) { - return "" - } - - project.logger.quiet("Gradle: Build = " + taskName) - - if (taskName.contains("Arm_64")) { - abi = "arm64-v8a" - } else if (taskName.contains("Arm")) { - abi = "armeabi-v7a" - } else if (taskName.contains("X86_64")) { - abi = "x86_64" - } - - project.logger.quiet("Gradle: ABI name: " + abi) - return abi; -} - -String getToolchainName() { - String taskName = getGradle().startParameter.taskNames[0] - String toolchain; - - if (taskName == null) { - return "" - } - - if (taskName.contains("Arm_64")) { - toolchain = "aarch64-linux-android-4.9" - } else if (taskName.contains("Arm")) { - toolchain = "arm-linux-androideabi-4.9" - } else if (taskName.contains("X86_64")) { - toolchain = "x86_64-4.9" - } - - project.logger.quiet("Gradle: ABI name: " + toolchain) - return toolchain; -}
\ No newline at end of file diff --git a/Source/Android/app/src/arm_64/res/values/arrays.xml b/Source/Android/app/src/arm_64/res/values/arrays.xml deleted file mode 100644 index fb98aa63da..0000000000 --- a/Source/Android/app/src/arm_64/res/values/arrays.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- All lists for ListPreference keys/values are placed here --> -<resources> - - <!-- New UI CPU Core selection - ARM64 --> - <string-array name="string_emu_cores" translatable="false"> - <item>@string/interpreter</item> - <item>@string/cached_interpreter</item> - <item>@string/jit_arm64_recompiler</item> - </string-array> - <integer-array name="int_emu_cores" translatable="false"> - <item>0</item> - <item>5</item> - <item>4</item> - </integer-array> - -</resources>
\ No newline at end of file diff --git a/Source/Android/app/src/arm_64/res/values/strings.xml b/Source/Android/app/src/arm_64/res/values/strings.xml deleted file mode 100644 index c98efb06b6..0000000000 --- a/Source/Android/app/src/arm_64/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <!-- Title of the app --> - <string name="title_new_ui">Dolphin ARM64</string> -</resources>
\ No newline at end of file diff --git a/Source/Android/app/src/main/res/layout/dialog_game_details.xml b/Source/Android/app/src/main/res/layout/dialog_game_details.xml index ca33e56007..68715f82be 100644 --- a/Source/Android/app/src/main/res/layout/dialog_game_details.xml +++ b/Source/Android/app/src/main/res/layout/dialog_game_details.xml @@ -19,8 +19,8 @@ android:layout_marginLeft="16dp" android:layout_marginTop="24dp" tools:src="@drawable/placeholder_banner" - app:border_color="?android:colorAccent" - app:border_width="2dp" + app:civ_border_color="?android:colorAccent" + app:civ_border_width="2dp" /> <ImageView diff --git a/Source/Android/app/src/main/res/values/arrays.xml b/Source/Android/app/src/main/res/values/arrays.xml index c3612eedd4..a536582275 100644 --- a/Source/Android/app/src/main/res/values/arrays.xml +++ b/Source/Android/app/src/main/res/values/arrays.xml @@ -6,10 +6,16 @@ <string-array name="string_emu_cores" translatable="false"> <item>@string/interpreter</item> <item>@string/cached_interpreter</item> + <item>@string/jit_arm64_recompiler</item> + <!--<item>@string/jit64_recompiler</item> + <item>@string/jitil_recompiler</item>--> </string-array> <integer-array name="int_emu_cores" translatable="false"> <item>0</item> <item>5</item> + <item>4</item> + <!--<item>1</item> + <item>2</item>--> </integer-array> <!-- Video backend selection --> diff --git a/Source/Android/app/src/x86_64/res/values/arrays.xml b/Source/Android/app/src/x86_64/res/values/arrays.xml deleted file mode 100644 index d4c65b9b63..0000000000 --- a/Source/Android/app/src/x86_64/res/values/arrays.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- All lists for ListPreference keys/values are placed here --> -<resources> - - <!-- New UI CPU Core selection - x86_64 --> - <string-array name="string_emu_cores" translatable="false"> - <item>@string/interpreter</item> - <item>@string/jit64_recompiler</item> - <item>@string/jitil_recompiler</item> - </string-array> - <integer-array name="int_emu_cores" translatable="false"> - <item>0</item> - <item>1</item> - <item>2</item> - </integer-array> - -</resources>
\ No newline at end of file |
