Skip to content

Commit

Permalink
version 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Krueger committed Oct 16, 2017
1 parent e8c37ce commit a69c2ed
Show file tree
Hide file tree
Showing 319 changed files with 19,141 additions and 9,104 deletions.
87 changes: 44 additions & 43 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,64 @@
image: hub.silentcircle.org/eng/sc-android-build

stages:
- build
- test
- deploy

dev_build_job:


# Common build settings
.common_build: &ref_common_build
variables:
CI_DEBUG_TRACE: "false"
GIT_SUBMODULE_STRATEGY: recursive
CI_DEBUG_TRACE: "true"
stage: build
except: # Except any tags of format vN.M+ or VN.M-rcX
- /^v\d+\.\d+(\.\d+)*(-rc\d+)?$/
DOCKER_IMAGE_VER: "v0.6"
DOCKER_TAG: "hub.silentcircle.org/eng/sc-android-build:${DOCKER_IMAGE_VER}"
# All these are required by the build script
BUILD_NUMBER_PREFIX: "${CI_COMMIT_REF_SLUG}"
WORKSPACE: "${CI_PROJECT_DIR}"
GRADLE_USER_HOME: "$WORKSPACE/.gradle"
SRC_ROOT: "$WORKSPACE"
JNI_ROOT: "${WORKSPACE}/silentphone2/support"
BUILD_SCRIPT: "silentphone2/.build-release/android-build.sh"
# We want all the files downloaded by Gradle to persist across builds
# for the same branch or tag.
cache:
key: "${CI_COMMIT_REF_NAME}"
paths:
- "${GRADLE_USER_HOME}/caches"
- "${GRADLE_USER_HOME}/wrapper"
image: "${DOCKER_TAG}"
tags:
- docker-debian
script:
- make
artifacts:
name: "dev-${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
when: on_success
expire_in: 8 weeks
paths:
- silentphone2/build/outputs
allow_failure: false

beta_build_job:
variables:
GIT_SUBMODULE_STRATEGY: recursive
CI_DEBUG_TRACE: "true"


# Development build
dev_build_job:
stage: build
only:
- /^v\d+\.\d+(\.\d+)*-rc\d+$/
tags:
- docker-debian
except: # Except any tags of format vN.M+ or VN.M-rcX
- /^v\d+\.\d+(\.\d+)*(-rc\d+)?$/
script:
- make
artifacts:
name: "beta-${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 8 weeks
paths:
- silentphone2/build/outputs
allow_failure: false
- bash -xv $BUILD_SCRIPT DEVELOP
<<: *ref_common_build

prod_build_job:
variables:
GIT_SUBMODULE_STRATEGY: recursive
CI_DEBUG_TRACE: "true"

# Beta/RC build
beta_build_job:
stage: build
only:
- /^v\d+\.\d+(\.\d+)*$/
tags:
- docker-debian
- /^v\d+\.\d+(\.\d+)*-rc\d+$/
script:
- make
artifacts:
name: "prod-${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 8 weeks
paths:
- silentphone2/build/outputs
allow_failure: false
- bash -xv $BUILD_SCRIPT RELEASE
<<: *ref_common_build



# We don't have a prod build job. Prod builds
# are rc (beta) builds that have passed QA and
# are deemed ready for release. They don't get rebuilt
# because that's risky and unnecessary.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ dep:
git submodule update --init --recursive
./buildNativeLibs.sh DEVELOP
./build_ndk
echo "android.useDeprecatedNdk=true" > gradle.properties
echo 'android.useDeprecatedNdk=true' > gradle.properties
echo 'org.gradle.jvmargs=-Xmx3584M' >> gradle.properties
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Silent Phone is Peer-to-peer encrypted calling and video. No keys are stored.

### What's New In This Update

The sources are updated for version 6.0 of the project.
The sources are updated for version 6.1 of the project.

This version of the project includes Silent Contacts as a subproject.

Expand All @@ -20,17 +20,16 @@ To build Silent Phone for Android you will need the following resources:
- the Android Native Development Kit (NDK)
- Android SDK Tools

- Android SDK Tools 26.0.2
- Android SDK Platform-tools 26.0.0
- Android SDK Build-tools 25.0.2
- Android SDK Tools 26.1.1
- Android SDK Platform-tools 26.0.1
- Android SDK Build-tools 26.0.0

- SDK Platform 26 2
- SDK Platform 25 3
- SDK Platform 24 2
- SDK Platform 23 3

- Google Play Services 41
- Google Play Services 45
- Android Support Repository 47
- Google Repository 53
- Google Repository 58

### How to Build

Expand Down
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ext {
compileSdkVersion = 25
buildToolsVersion = "25.0.2"
buildToolsVersion = "26.0.0"
targetSdkVersion = 25
}

Expand All @@ -11,7 +11,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'org.ajoberstar:grgit:1.8.0'
}
Expand All @@ -20,5 +20,8 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon May 22 23:53:59 CDT 2017
#Fri Jul 21 02:32:27 PDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
93 changes: 74 additions & 19 deletions silentphone2/.build-release/android-build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# symbols set by build host:
#
#
# export JAVA_JDK=/opt/jdk1.7.0_45/bin
#
# export ANDROID_ADT=/opt/adt-bundle-linux-x86_64
Expand All @@ -10,17 +10,52 @@
# export ANDROID_NDK=/opt/android-ndk-r9c
#
# export PATH=$JAVA_JDK:$ANDROID_NDK:$ANDROID_ADT:$ANDROID_ANT:$ANDROID_SDK/tools:$PATH
#
#
# export GRADLE_USER_HOME="$WORKSPACE"
# export SRC_ROOT=$WORKSPACE
# export AUTOMATED_BUILD=1
# export JNI_ROOT=$WORKSPACE/support
#
# export BUILD_NUMBER_PREFIX="alpha-"
# which varies depending on build dev-, alpha-, 17-Apr-2014: <- last is release
# which varies depending on build dev-, alpha-, 17-Apr-2014: <- last is release

set -e

die() {
echo $* >&2
exit 1
}

assert_nonempty_var() {
local var_name="$1"; shift
[[ -n "$(eval echo \$$var_name)" ]] || die "$var_name must not be empty"
}

iso8601_timestamp() {
date -u +'%FT%TZ'
}

set_gradle_properties() {
local build_number="$1"; shift
local build_id="$1"; shift
local build_number_prefix="$1"; shift

cat <<end_set_gradle_properties > gradle.properties
org.gradle.jvmargs=-Xmx3584M
build_environment=silentcircle.com
build_version=$build_number_prefix$build_number
build_version_numeric=$build_number
build_commit=$(git log -n 1 --pretty=format:'%h')
build_date=$build_id
build_debug=true
build_partners=Vertu
## Next is required for gradle plugin 1.3.0 to support the old way to handle
## NDK builds. Maybe we can update/remove it once gradle fully supports NDK
android.useDeprecatedNdk=true
end_set_gradle_properties
}

export SC_BUILD_TYPE="$1"

BUILT_APK_ROOT="silentphone2/build/outputs/apk/"
Expand All @@ -38,13 +73,20 @@ else
echo "*** building release configuration"
fi

# Show environment for debug purposes
env

git submodule init
git submodule update --recursive
git submodule status

echo "sdk.dir=$ANDROID_SDK" > local.properties
echo "ndk.dir=$ANDROID_NDK" >> local.properties
cat <<END_LOCAL_PROPERTIES > local.properties
sdk.dir=$ANDROID_SDK
ndk.dir=$ANDROID_NDK
END_LOCAL_PROPERTIES

echo "local.properties:"
cat local.properties

# build static and shared libs and dependencies, copy resulting libs to
# correct place (silentphone2/jni/armeabi-v7a), then run top level ndk-build
Expand Down Expand Up @@ -91,25 +133,38 @@ ndk-build clean

# ndk jni builds
# ndk-build -d -B V=1 NDK_LOG=1
if ! ndk-build; then
if ! ndk-build NDK_DEBUG=0; then
echo "Build of native silentphone library failed"
exit 1
fi

popd

## See which build system we are using
## and set env vars accordingly
if [ -n "$AUTOMATED_BUILD" ]; then
if [ -n "$GITLAB_CI" ]; then
# BUILD_NUMBER_PREFIX is (should be) set by gitlab-ci.yml
# It is allowed to be empty.
BUILD_NUMBER="$CI_JOB_ID"
BUILD_ID=$(iso8601_timestamp)
elif [ -n "$JENKINS_HOME" ]; then
# The required build variables should already be set
assert_nonempty_var BUILD_NUMBER
assert_nonempty_var BUILD_ID
else
echo "AUTOMATED_BUILD set but I don't know which CI system this is."
exit 1
fi
else # Manual build
BUILD_NUMBER_PREFIX='manual-'
BUILD_NUMBER=$$ # This should be monotonically increasing, but not worth it
BUILD_ID=$(iso8601_timestamp)
fi

echo "build_environment=silentcircle.com" > gradle.properties
echo "build_version=$BUILD_NUMBER_PREFIX$BUILD_NUMBER" >> gradle.properties
echo "build_version_numeric=$BUILD_NUMBER" >> gradle.properties
echo "build_commit=$(git log -n 1 --pretty=format:'%h')" >> gradle.properties
echo "build_date=$BUILD_ID" >> gradle.properties
echo "build_debug=true" >> gradle.properties
echo "build_partners=Vertu" >> gradle.properties

## Next is required for gradle plugin 1.3.0 to support the old way to
## handle NDK builds. Maybe we can update/remove it once gradle fulls supports NDK
echo "android.useDeprecatedNdk=true" >> gradle.properties
set_gradle_properties "$BUILD_NUMBER" "$BUILD_ID" "$BUILD_NUMBER_PREFIX"
echo "gradle.properties:"
cat gradle.properties

# for more information on what gradlew is doing consider using --info
# ./gradlew --info clean $BUILD_GRADLE_TASK
Expand Down Expand Up @@ -140,5 +195,5 @@ SymlinkAPK() {

SymlinkAPK "bin" $BUILD_APK_NAME

# Jenkins build variable - has format of timestamp
echo $BUILD_ID > ../build-id.txt
# CI build variable - has format of timestamp
echo $BUILD_ID > ${WORKSPACE}/build-id.txt
Loading

0 comments on commit a69c2ed

Please sign in to comment.