Skip to content

Commit

Permalink
Merge pull request #72 from greenhub-project/dev
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
hmatalonga authored Oct 25, 2017
2 parents 361c4b5 + 259b508 commit 27b0f59
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 372 deletions.
15 changes: 1 addition & 14 deletions .idea/misc.xml

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

15 changes: 3 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: android
jdk: oraclejdk8

android:
components:
Expand All @@ -9,11 +8,9 @@ android:
- extra-android-support
- platform-tools
- tools
- build-tools-25.0.3
- android-25
- build-tools-26.0.2
- android-26
- addon-google_apis-google-24
# if you need to run emulator(s) during your tests
# - sys-img-armeabi-v7a-android-25
licenses:
- 'android-sdk-preview-license-52d11cd2'
- 'android-sdk-license-.+'
Expand All @@ -31,10 +28,4 @@ before_install:
- chmod +x gradlew

script:
- ./gradlew clean assembleDebug

#before_script:
# - echo no | android create avd --force -n test -t android-25 --abi armeabi-v7a
# - emulator -avd test -no-audio -no-window &
# - android-wait-for-emulator
# - adb shell input keyevent 82 &
- ./gradlew clean check assembleDebug
40 changes: 20 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'io.fabric'

apply from: 'checkstyle.gradle'
// apply from: 'checkstyle.gradle'

// Check if can build a release config
def canBuildRelease = rootProject.file('keystore.properties').exists()
Expand Down Expand Up @@ -72,35 +72,35 @@ android {

dependencies {
// Include libraries checked into the libs directory.
compile fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Dependencies for android tests which reside in the "androidTest" src folder.
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile 'com.google.code.findbugs:jsr305:3.0.2'
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.2'
// Dependencies for unit tests which reside in the "tests" src folder.
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
// Android support libraries.
compile "com.android.support:appcompat-v7:${androidSupportLibVersion}"
compile "com.android.support:design:${androidSupportLibVersion}"
compile "com.android.support:support-v4:${androidSupportLibVersion}"
compile "com.android.support:support-v13:${androidSupportLibVersion}"
compile "com.android.support:cardview-v7:${androidSupportLibVersion}"
compile "com.android.support:recyclerview-v7:${androidSupportLibVersion}"
implementation "com.android.support:appcompat-v7:${androidSupportLibVersion}"
implementation "com.android.support:design:${androidSupportLibVersion}"
implementation "com.android.support:support-v4:${androidSupportLibVersion}"
implementation "com.android.support:support-v13:${androidSupportLibVersion}"
implementation "com.android.support:cardview-v7:${androidSupportLibVersion}"
implementation "com.android.support:recyclerview-v7:${androidSupportLibVersion}"
// JSON utility library.
compile 'com.google.code.gson:gson:2.7'
implementation 'com.google.code.gson:gson:2.8.0'
// Retrofit library for networking operations
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
// greenrobot for event communications
compile 'org.greenrobot:eventbus:3.0.0'
implementation 'org.greenrobot:eventbus:3.0.0'
// MPAndroidChart library for drawing charts
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1'
// Android Processes library
compile 'com.jaredrummler:android-processes:1.0.9'
implementation 'com.jaredrummler:android-processes:1.0.9'
// crashlytics
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
}
73 changes: 7 additions & 66 deletions app/checkstyle.gradle
Original file line number Diff line number Diff line change
@@ -1,83 +1,24 @@
/**
* Checkstyle tasks
* Usage:
* - place this file under root dir of your project
* - apply script from your gradle file:
* apply from : "{rootDir}/checkstyle.gradle"
*
* To configure checkstyle use configs at:
* "{rootDir}/checkstyle.xml" - for main projects
* "{rootDir}/checkstyle-test.xml" - for tests
* "{rootDir}/suppresions.xml" - for style suppressions
*
* Config files must be in the root directory in order to Codacy to find them
*
* Xml and HTML reports are stored:
* "{project.buildDir}/reports/checkstyle/"
* HTML styling is done by XSLT stylesheet:
* "{rootDir}/config/checkstyle/checkstyle-html.xsl"
*/

apply plugin: 'checkstyle'

task checkstyleMain (type: Checkstyle) {
ignoreFailures = false
showViolations = false
source 'src/main', 'src/release'
source 'src/main'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
reports {
xml.destination "$project.buildDir/reports/checkstyle/main.xml"
}
classpath = files()
configFile = file("${rootProject.rootDir}/checkstyle.xml")
}

task checkstyleTest (type: Checkstyle){
ignoreFailures = false
showViolations = false
source 'src/androidTest'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
reports {
xml.destination "$project.buildDir/reports/checkstyle/test.xml"
}
classpath = files()
configFile = file("${rootProject.rootDir}/checkstyle-test.xml")
}


task checkstyleReport {
doLast {
checkType = project.ext.get("checkType")
if (file("$buildDir/reports/checkstyle/${checkType}.xml").exists()) {
ant.xslt(in: "$project.buildDir/reports/checkstyle/${checkType}.xml",
style:"${rootProject.rootDir}/config/checkstyle/checkstyle-html.xsl",
out:"$project.buildDir/reports/checkstyle/checkstyle_${checkType}.html"
)
}
}
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
}

task checkstyle(dependsOn:['checkstyleMain']){
description 'Runs Checkstyle inspection against Android sourcesets.'
group = 'Code Quality'
}

gradle.taskGraph.afterTask {Task task, TaskState state ->
if(state.failure) {
if (task.name in ['checkstyleMain', 'checkstyleTest']) {
checkstyleReport {
def matcher = task.name =~ /^checkstyle(.*)$/
if (matcher.matches()) {
project.ext.set("checkType", matcher.group(1).toLowerCase())
}
}
checkstyleReport.execute()
}
tasks.withType(Checkstyle) {
reports {
xml.enabled false
html.enabled true
html.stylesheet resources.text.fromFile('config/xsl/checkstyle-html.xsl')
}
}
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'io.realm:realm-gradle-plugin:4.0.0-RC1'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'io.realm:realm-gradle-plugin:4.1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -21,6 +22,7 @@ allprojects {
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.fabric.io/public' }
google()
}
}
task clean(type: Delete) {
Expand Down
Loading

0 comments on commit 27b0f59

Please sign in to comment.