Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #81 from ayltai/feature/79-majorRefactor
Browse files Browse the repository at this point in the history
Feature/79 major refactor
  • Loading branch information
ayltai authored Oct 1, 2017
2 parents b02cc90 + c5a6d7f commit 028b7de
Show file tree
Hide file tree
Showing 476 changed files with 39,078 additions and 10,183 deletions.
201 changes: 201 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
version: 2

references:

cache_key: &cache_key
key: cache-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "build.gradle" }}-{{ checksum "mobile/build.gradle" }}-{{ checksum "wear/build.gradle" }}
restore_cache: &restore_cache
restore_cache:
<<: *cache_key
save_cache: &save_cache
save_cache:
<<: *cache_key
paths:
- ~/.gradle
- ~/.m2

workspace: &workspace
~/workspace
attach_workspace: &attach_workspace
attach_workspace:
at: *workspace
persist_to_workspace: &persist_to_workspace
persist_to_workspace:
root: *workspace
paths:
- mobile/build

android_config: &android_config
working_directory: *workspace
docker:
- image: circleci/android:api-26-alpha
environment:
TERM: dumb
_JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
gcloud_config: &gcloud_config
working_directory: *workspace
docker:
- image: google/cloud-sdk:latest
environment:
TERM: dumb

export_android_key: &export_android_key
run:
name: Export Android key store environment variable
command: echo 'export ANDROID_KEY_STORE="$ANDROID_KEY_STORE"' >> $BASH_ENV
decode_android_key: &decode_android_key
run:
name: Decode Android key store
command: echo $ANDROID_KEY_STORE | base64 -di > key-store.jks

export_gservices_key: &export_gservices_key
run:
name: Export Google Services key environment variable
command: echo 'export GOOGLE_SERVICES_KEY="$GOOGLE_SERVICES_KEY"' >> $BASH_ENV
decode_gservices_key: &decode_gservices_key
run:
name: Decode Google Services key
command: echo $GOOGLE_SERVICES_KEY | base64 -di > mobile/google-services.json

export_gcloud_key: &export_gcloud_key
run:
name: Export Google Cloud Service key environment variable
command: echo 'export GCLOUD_SERVICE_KEY="$GCLOUD_SERVICE_KEY"' >> $BASH_ENV
decode_gcloud_key: &decode_gcloud_key
run:
name: Decode Google Cloud credentials
command: echo $GCLOUD_SERVICE_KEY | base64 -di > ${HOME}/client-secret.json

export_fabric_key: &export_fabric_key
run:
name: Export Fabric key
command: echo 'export FABRIC_KEY="$FABRIC_KEY"' >> $BASH_ENV
decode_fabric_key: &decode_fabric_key
run:
name: Decode Fabric key
command: echo $FABRIC_KEY | base64 -di > mobile/fabric.properties && echo $FABRIC_KEY | base64 -di > wear/fabric.properties

jobs:

build_debug:
<<: *android_config
steps:
- checkout
- *restore_cache
- run:
name: Download dependencies
command: ./gradlew androidDependencies
- *save_cache
- *export_gservices_key
- *decode_gservices_key
- run:
name: Gradle build (debug)
command: ./gradlew -PciBuild=true :mobile:assembleDebug :mobile:assembleAndroidTest
- *persist_to_workspace
- store_artifacts:
path: mobile/build/outputs/apk/
destination: /apk/

build_release:
<<: *android_config
steps:
- checkout
- *restore_cache
- run:
name: Download dependencies
command: ./gradlew androidDependencies
- *save_cache
- *export_android_key
- *decode_android_key
- *export_gservices_key
- *decode_gservices_key
- *export_fabric_key
- *decode_fabric_key
- run:
name: Gradle build (release)
command: ./gradlew -PciBuild=true :mobile:assembleRelease
- *persist_to_workspace
- store_artifacts:
path: mobile/build/outputs/apk/
destination: /apk/
- store_artifacts:
path: mobile/build/outputs/mapping/
destination: /mapping/

test_unit:
<<: *android_config
steps:
- checkout
- *restore_cache
- run:
name: Download dependencies
command: ./gradlew androidDependencies
- *save_cache
- *export_gservices_key
- *decode_gservices_key
- run:
name: Run unit tests
command: ./gradlew -PciBuild=true :mobile:testDebugUnitTest :mobile:jacocoTestReport
- store_artifacts:
path: mobile/build/reports/
destination: /reports/
- store_test_results:
path: mobile/build/test-results/
destination: /test-results/

test_instrumented:
<<: *gcloud_config
steps:
- *attach_workspace
- *export_gcloud_key
- *decode_gcloud_key
- run:
name: Set Google Cloud target project
command: gcloud config set project newspaper-84169
- run:
name: Authenticate with Google Cloud
command: gcloud auth activate-service-account firebase-adminsdk-p9qvk@newspaper-84169.iam.gserviceaccount.com --key-file ${HOME}/client-secret.json
- run:
name: Run instrumented test on Firebase Test Lab
command: gcloud firebase test android run --type instrumentation --app mobile/build/outputs/apk/mobile-debug.apk --test mobile/build/outputs/apk/mobile-debug-androidTest.apk --device model=Nexus5X,version=26,locale=en_US,orientation=portrait --timeout 10m
- run:
name: Create directory to store test results
command: mkdir firebase
- run:
name: Download instrumented test results from Firebase Test Lab
command: gsutil -m cp -r -U "`gsutil ls gs://test-lab-3udbiqpdyp0d0-miwcp7d69v80m | tail -1`*" /root/workspace/firebase/
- store_artifacts:
path: firebase/
destination: /firebase/

deploy:
<<: *android_config
steps:
- checkout
- *attach_workspace
- *restore_cache
- *export_fabric_key
- *decode_fabric_key
- run:
name: Deploy to Fabric Beta
command: ./gradlew -PciBuild=true :mobile:crashlyticsUploadDistributionRelease

workflows:
version: 2
workflow:
jobs:
- build_debug
- build_release
- test_unit
- test_instrumented:
requires:
- build_debug
- deploy:
filters:
branches:
only:
- master
requires:
- build_release
- test_unit
- test_instrumented
3 changes: 3 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exclude_paths:
- '**/test/**'
- '**/androidTest/**'
27 changes: 4 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,16 @@ Temporary Items
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/androidDexCompiler.xml
.idea/findbugs-idea.xml
.idea/checkstyle-idea.xml
.idea/workspace.xml
.idea/bashsupport_project.xml
.idea/tasks.xml
.idea/qaplug_profiles.xml
.idea/markdown-navigator.xml
.idea/markdown-exported-files.xml
.idea/misc.xml
.idea/externalDependencies.xml
.idea/*.xml
.idea/*/*.xml

# Sensitive or high-churn files:
.idea/dataSources/
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

Expand Down Expand Up @@ -111,7 +92,6 @@ out/
# Gradle files
.gradle/
build/
*/build/

# Local configuration file (sdk path, etc)
local.properties
Expand Down Expand Up @@ -154,5 +134,6 @@ hs_err_pid*
### Google SDKs
google-services.json

### Android Key Store
key-store.jks

### Key stores
*.jks
3 changes: 2 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
Newspaper
=========

[![Release](https://img.shields.io/github/release/ayltai/Newspaper.svg?label=release&maxAge=1800)](https://287-77390316-gh.circle-artifacts.com/2/tmp/circle-artifacts.Udg8jcm/app-release.apk) [![Build Status](https://circleci.com/gh/ayltai/Newspaper.svg?style=shield)](https://circleci.com/gh/ayltai/Newspaper) [![Code Quality](https://api.codacy.com/project/badge/Grade/89d745ac9331474e9cf9f3203782a72f)](https://www.codacy.com/app/ayltai/Newspaper?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ayltai/Newspaper&amp;utm_campaign=Badge_Grade) [![Code Coverage](https://api.codacy.com/project/badge/Coverage/89d745ac9331474e9cf9f3203782a72f)](https://www.codacy.com/app/ayltai/Newspaper?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ayltai/Newspaper&amp;utm_campaign=Badge_Coverage) [![Code Coverage](https://codecov.io/gh/ayltai/Newspaper/branch/master/graph/badge.svg)](https://codecov.io/gh/ayltai/Newspaper) [![Dependency Status](https://www.versioneye.com/user/projects/586396dc7c01f00031549c16/badge.svg?style=shield)](https://www.versioneye.com/user/projects/586396dc7c01f00031549c16) [![Android API](https://img.shields.io/badge/API-16%2B-blue.svg?style=flat&label=API&maxAge=300)](https://www.android.com/history/) [![License](https://img.shields.io/badge/License-apache%202.0-blue.svg?label=license&maxAge=1800)](https://github.com/ayltai/Newspaper/blob/master/LICENSE)
[![Release](https://img.shields.io/github/release/ayltai/Newspaper.svg?label=release&maxAge=1800)](https://531-77390316-gh.circle-artifacts.com/0/apk/mobile-release.apk) [![Build Status](https://circleci.com/gh/ayltai/Newspaper.svg?style=shield)](https://circleci.com/gh/ayltai/Newspaper) [![Code Quality](https://api.codacy.com/project/badge/Grade/89d745ac9331474e9cf9f3203782a72f)](https://www.codacy.com/app/ayltai/Newspaper?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ayltai/Newspaper&amp;utm_campaign=Badge_Grade) [![Code Coverage](https://api.codacy.com/project/badge/Coverage/89d745ac9331474e9cf9f3203782a72f)](https://www.codacy.com/app/ayltai/Newspaper?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ayltai/Newspaper&amp;utm_campaign=Badge_Coverage) [![Code Coverage](https://codecov.io/gh/ayltai/Newspaper/branch/master/graph/badge.svg)](https://codecov.io/gh/ayltai/Newspaper) [![Dependency Status](https://www.versioneye.com/user/projects/586396dc7c01f00031549c16/badge.svg?style=shield)](https://www.versioneye.com/user/projects/586396dc7c01f00031549c16) [![Android API](https://img.shields.io/badge/API-16%2B-blue.svg?style=flat&label=API&maxAge=300)](https://www.android.com/history/) [![License](https://img.shields.io/badge/License-apache%202.0-blue.svg?label=license&maxAge=1800)](https://github.com/ayltai/Newspaper/blob/master/LICENSE)

An aggreated news app containing news from 10+ local news publishers in Hong Kong. Made with ❤

![Screenshot (Compact)](screenshots/screenshot_compact_framed.resized.png "Screenshot (Compact)") ![Screenshot (Dark)](screenshots/screenshot_dark_framed.resized.png "Screenshot (Dark)")
![Screenshot (Compact)](design/screenshot_cozy_framed.png "Screenshot (Cozy)") ![Screenshot (Dark)](design/screenshot_dark_framed.png "Screenshot (Dark)")

## Features
* Fast. Just fast.
* Support video news
* [Auto face centering](https://developers.google.com/vision/face-detection-concepts) for image previews. No more weird cropping
* Fancy showcases - [Ken Burns effect](https://en.wikipedia.org/wiki/Ken_Burns_effect) and [Panoramic effect](https://en.wikipedia.org/wiki/Panoramic_photography)
* Read news from 10+ news publishers
* Read news from 10 news publishers
* Bookmark any news
* No ads. We hate ads as much as you do
* Remember where you were reading
Expand Down Expand Up @@ -44,9 +42,6 @@ This app is made with the support of open source software:
* [BigImageViewer](https://github.com/Piasy/BigImageViewer)
* [RecyclerView Animators](https://github.com/wasabeef/recyclerview-animators)
* [KenBurnsView](https://github.com/flavioarfaria/KenBurnsView)
* [PanoramaImageView](https://github.com/gjiazhe/PanoramaImageView)
* [MaterialStyledDialogs](https://github.com/javiersantos/MaterialStyledDialogs)
* [Guillotine Animation](https://github.com/Yalantis/GuillotineMenu-Android)
* [SmallBang](https://github.com/hanks-zyh/SmallBang)
* [OkHttp](https://github.com/square/okhttp)
* [Retrolambda](https://github.com/orfjackal/retrolambda)
Expand All @@ -55,21 +50,19 @@ This app is made with the support of open source software:
* [RxAndroid](https://github.com/ReactiveX/RxAndroid)
* [RxBinding](https://github.com/JakeWharton/RxBinding)
* [Dagger 2](https://google.github.io/dagger)
* [DebugDrawer](https://github.com/palaima/DebugDrawer)
* [Espresso](https://google.github.io/android-testing-support-library)
* [JUnit 4](https://github.com/junit-team/junit4)
* [Mockito](https://github.com/mockito/mockito)
* [PowerMock](https://github.com/powermock/powermock)
* [Robolectric](http://robolectric.org)
* [Facebook Stetho](http://facebook.github.io/stetho)
* [LeakCanary](https://github.com/square/leakcanary)
* [Takt](https://github.com/wasabeef/Takt)

… and closed source software:

* [Google Mobile Vision](https://developers.google.com/vision)
* [Firebase Remote Config](https://firebase.google.com/docs/remote-config)
* [Firebase App Invites](https://firebase.google.com/docs/invites)
* [Firebase Analytics](https://firebase.google.com/docs/analytics)
* [Firebase Crash Reporting](https://firebase.google.com/docs/crash)
* [Fabric Crashlytics](https://fabric.io/kits/android/crashlytics)
* [Fabric Answers](https://fabric.io/kits/android/answers)

… and free cloud services:

* [CircleCI](https://circleci.com)
* [Firebase Test Lab](https://firebase.google.com/docs/test-lab)
Loading

0 comments on commit 028b7de

Please sign in to comment.