remove useless stuff and update android gradle plugin to 3.0.1

put google() on top (google recommends it that way)
This commit is contained in:
Unpublished 2018-03-13 09:51:04 +01:00
parent 57ba718e75
commit 5e0169d762
6 changed files with 4 additions and 1533 deletions

1373
CHANGELOG

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
repositories { repositories {
jcenter()
google() google()
jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.0.0' classpath 'com.android.tools.build:gradle:3.0.1'
} }
} }
allprojects { allprojects {
repositories { repositories {
jcenter()
google() google()
jcenter()
} }
} }

View File

@ -1,37 +0,0 @@
#!/bin/bash
# bash is required because we need bash's printf to guarantee a cross-platform
# timestamp format.
set -e
set -x
if [ -z $ANDROID_HOME ]; then
if [ -e ~/.android/bashrc-ant-build ]; then
. ~/.android/bashrc-ant-build
else
echo "ANDROID_HOME must be set!"
exit
fi
fi
if [ -z $ANDROID_NDK_HOME ]; then
if which ndk-build 2>&1 /dev/null; then
ANDROID_NDK_HOME=`which ndk-build | sed 's,/ndk-build,,'`
else
echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH"
exit
fi
fi
# reset version code/name to current date
versionCodeDate=`date +%s`
versionNameDate=`date +%Y-%m-%d_%H.%M.%S`
sed -i \
-e "s,android:versionCode=\"[0-9][0-9]*\",android:versionCode=\"$versionCodeDate\"," \
-e "s,android:versionName=\"\([^\"][^\"]*\)\",android:versionName=\"\1.$versionNameDate\"," \
AndroidManifest.xml
ndk-build
make -C external
./setup-ant

View File

@ -1,103 +0,0 @@
#!/bin/bash
# bash is required because we need bash's printf to guarantee a cross-platform
# timestamp format.
set -e
set -x
# make sure we're on a signed tag that matches the version name
versionName=`sed -n 's,.*versionName="\([^"]*\)".*,\1,p' AndroidManifest.xml`
describe=`git describe`
if [ $versionName != $describe ]; then
echo "WARNING: building $describe, which is not the latest release ($versionName)"
else
# make a clearer warning above by putting this here
set +x
echo ""
echo ""
echo "Checking git tag signature for release build:"
gpg --list-key 9F0FE587374BBE81 || gpg --recv-key 9F0FE587374BBE81
gpg --list-key E9E28DEA00AA5556 || gpg --recv-key E9E28DEA00AA5556
gpg --list-key A801183E69B37AA9 || gpg --recv-key A801183E69B37AA9
git tag -v $versionName
echo ""
echo ""
set -x
fi
if [ -z $ANDROID_HOME ]; then
if [ -e ~/.android/bashrc-ant-build ]; then
. ~/.android/bashrc-ant-build
else
echo "ANDROID_HOME must be set!"
exit
fi
fi
if [ -z $ANDROID_NDK_HOME ]; then
if which ndk-build 2>&1 /dev/null; then
ANDROID_NDK_HOME=`which ndk-build | sed 's,/ndk-build,,'`
else
echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH"
exit
fi
fi
projectroot=`pwd`
projectname=`sed -n 's,.*name="app_name">\(.*\)<.*,\1,p' app/src/main/res/values/strings.xml`
# standardize timezone to reduce build differences
export TZ=UTC
TIMESTAMP=`printf '%(%Y-%m-%d %H:%M:%S)T' \
$(git log -n1 --format=format:%at)`
git reset --hard
git clean -fdx
git submodule foreach git reset --hard
git submodule foreach git clean -fdx
git submodule sync
git submodule foreach git submodule sync
git submodule update --init --recursive
if [ -e ~/.android/ant.properties ]; then
cp ~/.android/ant.properties $projectroot/
else
echo "skipping release ant.properties"
fi
cd $projectroot/orbotservice/src/main
faketime "$TIMESTAMP" $ANDROID_NDK_HOME/ndk-build
cd $projectroot
#clean, build, clean and build!
make -C external clean
APP_ABI=armeabi faketime "$TIMESTAMP" make -C external
#make -C external clean
#APP_ABI=x86 faketime "$TIMESTAMP" make -C external
./gradlew assembleRelease
#./setup-ant
#ant release
#apk=$projectroot/bin/$projectname-v$describe.apk
apk=$projectroot/app/build/outputs/apk/app-release-unsigned.apk
# standardize timestamps in ZIP headers, requires strip-nondeterminism 0.014
if which strip-nondeterminism > /dev/null; then
strip-nondeterminism -t zip -T $(git log -n1 --format=format:%at) $apk
fi
# echo the checksum to build logs
sha256sum $apk
if which gpg > /dev/null; then
if [ -z "`gpg --list-secret-keys`" ]; then
echo "No GPG secret keys found, not signing APK"
else
gpg --armor --detach-sign $apk
fi
else
echo "gpg not found, not signing APK"
fi

View File

@ -27,10 +27,7 @@ android {
} }
dependencies { dependencies {
compile 'com.android.support:appcompat-v7:25.4.0' implementation fileTree(dir: 'libs', include: ['*.jar','*.so'])
compile 'com.jrummyapps:android-shell:1.0.1'
compile fileTree(dir: 'libs', include: ['*.jar','*.so'])
testCompile 'junit:junit:4.12'
} }
apply plugin: 'maven' apply plugin: 'maven'

View File

@ -1,13 +0,0 @@
package org.torproject.android.service;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}