Commit bcb18bde authored by Andreas Schildbach's avatar Andreas Schildbach

Update to Gradle 3.3+ and Android Plugin for Gradle 2.3.3.

This also migrates the building of native code to cmake/ninja (included with the Android SDK
Tools), getting rid of the deprecated gradle-experimental plugin.
parent 2a8c0a1f
......@@ -4,9 +4,6 @@ This project contains several sub-projects:
* __wallet__:
The Android app itself. This is probably what you're searching for.
* __native-scrypt__:
Native code implementation for Scrypt. The C files are copied from the
Java Scrypt project at [GitHub](https://github.com/wg/scrypt).
* __market__:
App description and promo material for the Google Play app store.
* __integration-android__:
......
......@@ -4,8 +4,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.android.tools.build:gradle-experimental:0.7.0'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath('fr.avianey.androidsvgdrawable:gradle-plugin:3.0.0') {
exclude group: 'xerces'
}
......
include 'wallet'
include 'integration-android'
include 'sample-integration-android'
include 'native-scrypt'
res/mipmap-*hdpi/
.externalNativeBuild/
......@@ -53,21 +53,21 @@ is world readable/writeable. The goal is to be able to debug easily.
You can probably skip some steps, especially if you built Android apps before.
You'll need git, a Java SDK 6 (or later) and Gradle 2.10 (or later) for this. I'll assume Ubuntu Xenial Linux
You'll need git, a Java6 SDK (or later) and Gradle 3.4 (or later) for this. I'll assume Ubuntu 18.04 LTS (Bionic Beaver)
for the package installs, which comes with slightly more recent versions.
# first time only
sudo apt install git gradle openjdk-8-jdk libstdc++6:i386 zlib1g:i386
sudo apt install git gradle openjdk-8-jdk
Download the [Android SDK Tools](https://developer.android.com/studio/index.html#command-tools)
and unpack to your workspace directory. Point your `ANDROID_HOME` variable to the unpacked Android SDK directory
and switch to it.
Create a directory for the Android SDK (e.g. `android-sdk`) and point the `ANDROID_HOME` variable to it.
Download and install the required Android dependencies:
Download the [Android SDK Tools](https://developer.android.com/studio/index.html#command-tools)
and unpack it to `$ANDROID_HOME/`.
tools/android update sdk --no-ui --force --all --filter tool,platform-tool,build-tools-27.0.3,android-15,android-27
Install the NDK:
Download the [Android NDK](https://developer.android.com/ndk/downloads/), then unpack it to your workspace directory. Point your `ANDROID_NDK_HOME` variable to the unpacked Android NDK directory.
# first time only
$ANDROID_HOME/bin/tools/sdkmanager ndk-bundle
Finally, you can build Bitcoin Wallet and sign it with your development key. Again in your workspace,
use:
......@@ -78,15 +78,12 @@ use:
# each time
cd bitcoin-wallet
git pull
gradle clean :native-scrypt:copy test build
gradle clean test build
To install the app on your Android device, use:
# first time only
sudo apt install android-tools-adb
# each time
adb install wallet/build/outputs/apk/bitcoin-wallet-debug.apk
gradle installDebug
If installation fails, make sure "Developer options" and "USB debugging" are enabled on your Android device, and an ADB
connection is established.
......@@ -106,7 +103,7 @@ separate 'prod' branch that gets rebased against master with each released versi
cd bitcoin-wallet
git fetch origin
git checkout origin/prod
gradle clean :native-scrypt:copy test build
gradle clean test build
### SETTING UP FOR DEVELOPMENT
......
......@@ -45,9 +45,20 @@ android {
defaultConfig {
applicationId 'de.schildbach.wallet_test'
generatedDensities = ['hdpi', 'xhdpi']
dexOptions {
preDexLibraries false
}
ndk {
abiFilters 'armeabi', 'armeabi-v7a', 'x86'
}
externalNativeBuild {
cmake {
cFlags '-DHAVE_CONFIG_H'
}
}
}
buildTypes {
......@@ -74,6 +85,12 @@ android {
}
}
externalNativeBuild {
cmake {
path 'cpp/CMakeLists.txt'
}
}
packagingOptions {
exclude 'lib/x86_64/darwin/libscrypt.dylib'
exclude 'okhttp3/internal/publicsuffix/publicsuffixes.gz'
......
cmake_minimum_required(VERSION 3.6.0)
add_library(scrypt SHARED scrypt_jni.c crypto_scrypt-nosse.c sha256.c)
include_directories(.)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment