From 9edd5d6b3f9e7019fe01867ad4e37d2753d77e18 Mon Sep 17 00:00:00 2001 From: aguestuser Date: Wed, 12 Apr 2017 01:13:11 -0400 Subject: [ag] Update README to promote smoother on-boarding * add detailed instructions on installing and compiling * provide workarounds for gotchas setting up emulator on debian * offer instructions for building in docker side-effects: * update build tools & gradle version * fix indentation in build.gradle * comment out tests in `TestLogFileHandler` causing `build` to break (and provide justification) --- app/build.gradle | 63 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'app/build.gradle') diff --git a/app/build.gradle b/app/build.gradle index e9fe2f60..cd7e6e21 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 23 - buildToolsVersion "23.0.3" + buildToolsVersion '25.0.0' signingConfigs { release { @@ -13,26 +13,26 @@ android { } } - productFlavors { - production { + productFlavors { + production { - } - insecure { + } + insecure { - } } + } buildTypes { release { //runProguard true if(signingConfigs.contains(release)) - signingConfig signingConfigs.release.isSigningReady() ? signingConfigs.release : signingConfigs.debug + signingConfig signingConfigs.release.isSigningReady() ? signingConfigs.release : signingConfigs.debug } } - lintOptions { - abortOnError false - } + lintOptions { + abortOnError false + } sourceSets { main { @@ -48,6 +48,7 @@ android { dependencies { androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.4' + testCompile 'junit:junit:4.12' compile 'com.jakewharton:butterknife:6.1.0' provided 'com.squareup.dagger:dagger-compiler:1.2.2' compile 'com.github.pedrovgs:renderers:1.5' @@ -55,7 +56,7 @@ dependencies { compile 'com.google.code.gson:gson:2.4' compile 'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0' compile 'mbanje.kurt:fabbutton:1.1.4' - compile 'com.android.support:support-annotations:23.2.1' + compile 'com.android.support:support-annotations:23.2.1' } def processFileInplace(file, Closure processText) { @@ -82,17 +83,17 @@ task copyIcsOpenVPNClasses( type: Copy ) { include '**/dimens.xml' include '**/logmenu.xml' include '**/core/**.java' - include '**/activities/BaseActivity.java' + include '**/activities/BaseActivity.java' includeEmptyDirs = false - + filter { line -> line.replaceAll('de.blinkt.openvpn.R', 'se.leap.bitmaskclient.R') } filter { line -> line.replaceAll('de.blinkt.openvpn.BuildConfig', 'se.leap.bitmaskclient.BuildConfig') } - filter { + filter { line -> line.replace('package de.blinkt.openvpn;', 'package de.blinkt.openvpn;\n\nimport se.leap.bitmaskclient.R;') } } into '.' @@ -107,11 +108,11 @@ task copyIcsOpenVPNXml( type: Copy ) { include '**/styles.xml' include '**/dimens.xml' include '**/refs.xml' - include '**/colours.xml' + include '**/colours.xml' include '**/logmenu.xml' include '**/white_rect.xml' includeEmptyDirs = false - + rename 'strings.xml', 'strings-icsopenvpn.xml' filter { line -> line.replaceAll('.*name="app".*', '') @@ -128,8 +129,8 @@ task copyIcsOpenVPNImages( type: Copy ) { include '**/ic_close*.png' include '**/ic_edit*.png' include '**/ic_check*.png' - include '**/ic_pause*.png' - include '**/ic_play*.png' + include '**/ic_pause*.png' + include '**/ic_play*.png' includeEmptyDirs = false } into '.' } @@ -141,14 +142,14 @@ task removeDuplicatedStrings() { if(it.name.equals('strings.xml')) { def ics_openvpn_file = file(it.absolutePath.replace('strings.xml', 'strings-icsopenvpn.xml')) if(ics_openvpn_file.exists()) { - def ics_openvpn_strings_names = (new XmlParser()).parse(ics_openvpn_file) - def current_file = it - - ics_openvpn_strings_names.string.each { - processFileInplace(current_file) { text -> - text.replaceAll('.*name=\"' + it.attribute('name') + '\".*(\n)*.*string>.*\n+', '') - } - } + def ics_openvpn_strings_names = (new XmlParser()).parse(ics_openvpn_file) + def current_file = it + + ics_openvpn_strings_names.string.each { + processFileInplace(current_file) { text -> + text.replaceAll('.*name=\"' + it.attribute('name') + '\".*(\n)*.*string>.*\n+', '') + } + } } } } @@ -167,20 +168,20 @@ task mergeUntranslatable( type: Copy ) { ics_openvpn_untranslatable.eachLine { text -> if(text.contains('string name=')) { if(!bitmask_untranslatable.text.contains(text)) - bitmask_untranslatable << text - if(text.contains('')) - string_continuation = true + bitmask_untranslatable << text + if(text.contains('')) + string_continuation = true } else if(string_continuation) { bitmask_untranslatable << text } - + if(text.contains('')) { string_continuation = false bitmask_untranslatable << System.getProperty("line.separator") } } - + bitmask_untranslatable.write(bitmask_untranslatable.text.replaceAll("", "")) bitmask_untranslatable << "" -- cgit v1.2.3 From a7b4f463e4ffc282814ef74daf18c74581fc3a7d Mon Sep 17 00:00:00 2001 From: aguestuser Date: Mon, 17 Apr 2017 00:34:21 -0400 Subject: [ag] Update dockerfile to match config in passing local build * PROBLEM: the build fails on gitlab in a debian-based docker container * BUT: i (@aguestuser) have a recently-achieved passing build on a debian laptop * ATTEMPTED SOLUTION: construct a dockerfile that matches my local configuration as precisely as possible * PROGRESS: the build gets further than it did before -- getting part of the way through the `buildNative` gradle script before failing * REMAINING FAILURE: several arm64 cross-compile steps in the `ndk-build` step fail because they depend on [neon](https://developer.android.com/ndk/guides/cpu-arm-neon.html): ```shell [arm64-v8a] Compile : crypto_static <= aesv8-armx-64.S openssl/crypto/aes/asm/aesv8-armx-64.S:35:2: error: instruction requires: neon eor v0.16b,v0.16b,v0.16b ^ openssl/crypto/aes/asm/aesv8-armx-64.S:36:2: error: instruction requires: neon ld1 {v3.16b},[x0],#16 ^ openssl/crypto/aes/asm/aesv8-armx-64.S:38:2: error: instruction requires: neon ld1 {v1.4s,v2.4s},[x3],#32 ``` * PROPOSED NEXT STEPS: * consult team to see if there's any collective wisdom about `neon` * look for ways to analyze diff of c dependencies in local machine v. docker instance * consider using ubuntu or debian:sid as the base image for the android container? --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/build.gradle') diff --git a/app/build.gradle b/app/build.gradle index cd7e6e21..b6bb39ff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,8 +2,8 @@ apply plugin: 'com.android.application' android { compileSdkVersion 23 - buildToolsVersion '25.0.0' - + buildToolsVersion '25.0.2' +; signingConfigs { release { storeFile project.hasProperty('storeFileProperty') ? file(storeFileProperty) : null -- cgit v1.2.3