Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testroid #1

Open
wants to merge 57 commits into
base: buildSrc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c1fc163
Build scripts refactoring (#121)
spacifici Jun 27, 2019
73baef2
AP-274 lock icon in the title bar (#129)
spacifici Jun 27, 2019
d45492f
AP-330 unified status bar color (#130)
spacifici Jun 27, 2019
dfa925d
AP-337 re-add option menu in overview (#132)
spacifici Jun 27, 2019
4b356b6
AP-349 Check and restore subscription if exists for each purchase req…
jayeshsolanki93 Jun 28, 2019
3a4d03a
Handle null VpnProfile crash (#133)
jayeshsolanki93 Jun 28, 2019
c231091
AP-331 removes incognito mode special message from Lumen (#137)
spacifici Jul 1, 2019
bb0316b
Do not change user preferences when disabling subscriptions (#136)
jayeshsolanki93 Jul 2, 2019
361355d
Fix Docker and Setup CD (#135)
Jul 2, 2019
fc553e5
AP-360 Implement design changes on subscription screen (#138)
jayeshsolanki93 Jul 3, 2019
d2a5ed7
Configure RevenueCat products for release (#142)
jayeshsolanki93 Jul 3, 2019
54e9eae
Fix Universal Build and Jenkins Secret File Error (#141)
Jul 3, 2019
59c2de2
AP-264 update url bar icons and colors (#134)
ravjit-cliqz Jul 3, 2019
e38eb2c
Fix Build Number not being passed to the Container (#144)
Jul 4, 2019
f57ff8e
AP-366 Refactoring Start Tab to resolve rendering inconsistencies (#143)
spacifici Jul 4, 2019
e118c60
AP-357 Implement design changes on dashboard (#140)
jayeshsolanki93 Jul 4, 2019
b8f78e0
AP-328 removes the CoordinatorLayout (#145)
spacifici Jul 4, 2019
e03b6ec
AP-364 Add Restore Subscription option (#146)
jayeshsolanki93 Jul 5, 2019
5c4e4e7
AP-395 make use of the right url bar color in forget tab (#150)
spacifici Jul 8, 2019
d756e9a
AP-389 adds Tabs menu entry for Lumen (#151)
spacifici Jul 8, 2019
30b7eb0
AP-392 clicking on menu Favorites direct the user to the StartTab (#152)
spacifici Jul 8, 2019
cb7b82a
AP-344 Lumen german strings (#154)
spacifici Jul 8, 2019
6ccf1a8
AP-367 vpn connects and disconnects - added notification (#149)
ravjit-cliqz Jul 9, 2019
da95f04
Show device id in settings menu and fixed backend url for each flavou…
ravjit-cliqz Jul 9, 2019
292a239
Updated cliqz configuration file reference
spacifici Jul 9, 2019
b478ccd
AP-305 AP-339 Dashboard and Vpn panel buttons ux fixes (#139)
ravjit-cliqz Jul 9, 2019
147283b
AP-423 added notification action AP-415 crash fix (#158)
ravjit-cliqz Jul 11, 2019
d32a93d
AP-376 Fix dashboard icon check symbol blinking (#153)
ravjit-cliqz Jul 11, 2019
424455a
AP-355 tab overview re-design (#157)
spacifici Jul 11, 2019
e49ba27
AP-373 vpn crash after subscription (#159)
ravjit-cliqz Jul 15, 2019
57dbc2b
AP-355-2 font colors, typefaces in deck view (#160)
spacifici Jul 15, 2019
6188992
AP-433 solves an animation bug that uncorreclty show the search view …
spacifici Jul 15, 2019
f9eddcf
AP-359 Start tab design fixes (#148)
spacifici Jul 15, 2019
6b51a3a
AP-375 Dashboard icon is grey after subscription (#156)
ravjit-cliqz Jul 15, 2019
0cbf27b
AP-381 after subscription: VPN string does not change (#162)
ravjit-cliqz Jul 15, 2019
d2d3b74
AP-385 adds a spinner when performing purchases (#163)
spacifici Jul 15, 2019
99633ec
AP-411 (and AP-387) puts back lock icon and reader mode icon in the u…
spacifici Jul 16, 2019
4ebaa26
Fixed: config file in navigation-extension has changed (#169)
philipp-classen Jul 16, 2019
86fcd16
AP-397 removes "Send Tab to Desktop" from the menu (#164)
spacifici Jul 16, 2019
2520b4a
AP-399 rename Forget Tab to Private Tab in Lumen (#167)
spacifici Jul 16, 2019
ebdad84
AP-374 makes downgrade not possible (#170)
spacifici Jul 16, 2019
8a99479
AP-353 AP-414 Vpn countries localisation and ordering (#168)
ravjit-cliqz Jul 17, 2019
15a5ef3
AB-413 adds german translations for the VPN panel (#171)
spacifici Jul 17, 2019
1c408c8
Better products filtering (#173)
spacifici Jul 17, 2019
3fd22ff
AP-345 AP-346 AP-347 fix double api calls (#174)
ravjit-cliqz Jul 17, 2019
ef31fd9
Initial buildSrc support
spacifici Jun 14, 2019
1b88c0e
buildSrc: remove versioning and flavor related BuildConfig fields
spacifici Jun 19, 2019
ee7f14f
Removing scripts/CliqzConfig.gradle
spacifici Jun 24, 2019
137b0ce
Cleaning up settings.gradle
spacifici Jun 24, 2019
721781e
Setup Sentry for crash reporting
jayeshsolanki93 Jun 19, 2019
45b788e
Incremental builds
spacifici Jun 25, 2019
886dab1
Kotlin support, moving all the keys/tokens to cliqz-config.json
spacifici Jun 25, 2019
5719532
cliqz-config.json is optional, warning if missing
spacifici Jun 25, 2019
7943efa
Testdroid task skeleton
spacifici Jul 8, 2019
42ebb9f
Run Tests on bitbar.cloud and collect artifacts
JosephBK Jul 11, 2019
e06c4ba
Implement flow on test faliure
JosephBK Jul 16, 2019
91db4e7
Changes after Review
JosephBK Jul 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ app/src/main/assets/jsengine.bundle.js
node_modules/
yarn.lock
app/google-services.json
app/cliqz-config.json
37 changes: 21 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04
MAINTAINER Stefano Pacifici <[email protected]>
ENV DEBIAN_FRONTEND noninteractive

Expand Down Expand Up @@ -61,7 +61,7 @@ ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
ENV ANDROID_HOME /home/jenkins/android_home
ENV GRADLE_USER_HOME /home/jenkins/gradle_home
ENV NVM_DIR /home/jenkins/nvm
ENV NODE_VERSION 8.9.3
ENV NODE_VERSION 9.11.2

USER jenkins

Expand All @@ -74,33 +74,38 @@ RUN mkdir -p $ANDROID_HOME; \
rm -r sdktools.zip; \
(while (true); do echo y; sleep 2; done) | \
tools/bin/sdkmanager \
"build-tools;26.0.2" \
"platforms;android-23" \
"platforms;android-27" \
"build-tools;28.0.3" \
"platforms;android-28" \
"platform-tools" \
"tools" \
"platforms;android-25" \
"extras;google;m2repository" \
"extras;android;m2repository" \
"extras;google;google_play_services";

ENV LD_LIBRARY_PATH "/home/jenkins/android_home/emulator/lib64/qt/lib"

# Install Node.JS
SHELL ["/bin/bash", "-l", "-c"]
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash && \
. $NVM_DIR/nvm.sh

ENV PATH "$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH"

#Installation of 'yarn'; 'appium' & 'wd' for Integration Tests
RUN npm install --global \
yarn \
appium \
wd
#Installation of Updated 'npm'
RUN npm install --global npm

#Install Ruby and Fastlane
RUN for key in 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB; do \
for server in "hkp://keys.gnupg.net" \
"hkp://p80.pool.sks-keyservers.net:80" \
"pgp.mit.edu" \
"hkp://keyserver.ubuntu.com:80"; do \
gpg2 --keyserver "${server}" --recv-keys "${key}" || echo "Trying new server..."; \
done; \
done
RUN curl -sSL https://get.rvm.io | bash -s stable --ruby=2.4.3 --autolibs=read-fail && \
source /home/jenkins/.rvm/scripts/rvm \
rvm reload && \
gem install fastlane --version 2.126.0

RUN gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
curl -sSL https://get.rvm.io | bash -s stable --ruby=2.4.1 --autolibs=read-fail
RUN gem install fastlane
#Install AWS CLI
RUN pip install awscli --upgrade --user
112 changes: 61 additions & 51 deletions Jenkinsfile.upload
Original file line number Diff line number Diff line change
@@ -1,67 +1,77 @@
#!/bin/env groovy

@Library(['[email protected]']) _
properties([
parameters([
choice(choices: ['lumen', 'cliqz'], defaultValue: 'lumen', description: 'Which Product ?', name: 'product')
])
])
node('master'){
def imageName = 'android-browser'
def branchName = "${BRANCH_NAME}"

stage('Checkout'){
checkout scm
}

stage('Build docker image') {
docker.build(imageName, '--build-arg UID=`id -u` --build-arg GID=`id -g` .')
}

docker.image(imageName).inside() {
stage('Extension') {
sh '''
set -x
set -e
yarn
npm run bundle
'''
}

withEnv(["GRADLE_USER_HOME=${pwd()}/gradle_home","BN=${branchName}"]) {
withCredentials([
file(credentialsId: '263e59fb-e9de-4e51-962c-0237c6ee167b', variable: 'CERT_PATH'),
string(credentialsId: '60354bba-8ed0-4df9-8f8e-5be7454c1680', variable: 'CERT_PASS'),
file(credentialsId: '2939d2e1-dd9a-4097-adc2-430e3d67157a', variable: 'PLAY_STORE_CERT')]) {
sh 'echo $BN'
if ("${BN}".contains("-re")) {
stage('Compile') {
sh './gradlew clean assembleStandardFatRelease'
}
}else {
try {
stage('Extension') {
sh '''#!/bin/bash -l
set -x
set -e
npm ci
npm run bundle
'''
}
withEnv([
"GRADLE_USER_HOME=${pwd()}/gradle_home",
"BUILD_NUMBER=${BUILD_NUMBER}"
]) {
withCredentials([
file(credentialsId: '263e59fb-e9de-4e51-962c-0237c6ee167b', variable: 'CERT_PATH'),
string(credentialsId: '60354bba-8ed0-4df9-8f8e-5be7454c1680', variable: 'CERT_PASS'),
file(credentialsId: '2939d2e1-dd9a-4097-adc2-430e3d67157a', variable: 'PLAY_STORE_CERT'),
file(credentialsId: 'cliqz-config.json', variable: 'CLIQZ_CONFIG_JSON'),
file(credentialsId: '6006a534-9f2e-4ba8-93f9-f0f27c0713df', variable: 'GOOGLE_SERVICES')]) {
stage('Compile and Upload') {
sh '''#!/bin/bash -l
set -x
set -e
fastlane android alpha
'''
sh '''#!/bin/bash -l
set -x
set -e
cp "$CLIQZ_CONFIG_JSON" app/cliqz-config.json
cp "$GOOGLE_SERVICES" app/google-services.json
'''
if(params.product == "cliqz") {
sh '''#!/bin/bash -l
set -x
set -e
export APP_PACKAGE="com.cliqz.browser"
fastlane android internal_cliqz
'''
}
if(params.product == "lumen") {
sh '''#!/bin/bash -l
set -x
set -e
export APP_PACKAGE="com.cliqz.lumen"
fastlane android internal_lumen
'''
}
}
}
}
}
}

}
if ("${branchName}".contains("-re")) {
def id = "Cliqz_Browser_android"+"${branchName}".substring("${branchName}".indexOf("v"), "${branchName}".indexOf("-"))
stage('Upload') {
withCredentials([
[
$class : 'UsernamePasswordMultiBinding',
credentialsId : 'f1732e5f-3e84-47ad-9286-a5fa6657ec43',
passwordVariable: 'AWS_SECRET_ACCESS_KEY',
usernameVariable: 'AWS_ACCESS_KEY_ID',
]
]) {
def s3Path = 's3://repository.cliqz.com/dist/android/release/apk'
def apkPath = "app/build/outputs/apk/standardFat/release/app-standard-fat-release.apk"

sh "aws s3 cp --acl public-read --acl bucket-owner-full-control ${apkPath} ${s3Path}/${id}.apk"
sh "aws s3 cp --acl public-read --acl bucket-owner-full-control ${s3Path}/${id}.apk ${s3Path}/latest.apk"
} finally {
stage('Upload Artifacts and Clean Up') {
archiveArtifacts allowEmptyArchive: true, artifacts: 'app/build/**/*.apk'
sh'''#!/bin/bash -l
set -x
set -e
rm -f app/cliqz-config.json
rm -f app/google-services.json
rm -rf app/build
rm -rf jsengine/*
rm -rf gradle_home/
'''
}
}
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ To also develop code from `browser-core`, follow these steps:
```
3. Now, build the extension, and direct the build output to the android browser's node_modules directory. Use the `fern serve` command means that the project will be rebuild if you make code changes:
```shell
CLIQZ_OUTPUT_PATH=/path/to/android-browser/node_modules/browser-core/build/ ./fern.js serve configs/react-native.json
CLIQZ_OUTPUT_PATH=/path/to/android-browser/node_modules/browser-core/build/ ./fern.js serve configs/cliqz-android.js
```

Now the dev server will see and load the updated files outputed from the fern build when you reload the code in the app.

### Degugging
### Debugging

To work with react live reloading server, the Developer Support option has to
be set on ReactInstanceManager in `/app/src/main/java/com/cliqz/jsengine/Engine.java`,
Expand Down
28 changes: 0 additions & 28 deletions android_utils/src/main/java/com/cliqz/utils/ResourcesUtils.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.core.content.ContextCompat;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.ImageSpan;
import android.text.style.URLSpan;

import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.appcompat.content.res.AppCompatResources;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
Expand All @@ -25,7 +26,7 @@
public final class SpannableUtils {

private static final Pattern MARKDOWN_PATTERN =
Pattern.compile("((!?)\\[(.*?)\\]\\((.*?)\\))|(<br\\s*>)");
Pattern.compile("((!?)\\[(.*?)]\\((.*?)\\))|(<br\\s*>)");

private SpannableUtils() {
} // No instances
Expand Down Expand Up @@ -67,7 +68,8 @@ public static Spannable markdownStringToSpannable(@NonNull Context context,
if (drawableId == 0) {
drawable = null;
} else {
drawable = ContextCompat.getDrawable(context, drawableId);
drawable = AppCompatResources.getDrawable(context, drawableId);
assert drawable != null;
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
}
region = new SpannableRegion(matcher.start(), matcher.end(),
Expand Down Expand Up @@ -110,7 +112,7 @@ public static Spannable markdownStringToSpannable(@NonNull Context context,
prev = region.regionEnd;
}
if (prev < in.length()) {
builder.append(in.substring(prev, in.length()));
builder.append(in.substring(prev));
}
return builder;
}
Expand Down
Loading