Skip to content

Commit

Permalink
issue119, issue120, issue122, issue124, and issue125 - Initial 4.x work
Browse files Browse the repository at this point in the history
  • Loading branch information
isuPatches authored Apr 22, 2019
1 parent de9f9c4 commit dcbad2c
Show file tree
Hide file tree
Showing 40 changed files with 215 additions and 798 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/local.properties
/.idea
/build
.DS_Store
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jdk:

env:
global:
- TARGET_SDK=27
- BUILD_TOOLS_VERSION=27.0.3
- TARGET_SDK=28
- BUILD_TOOLS_VERSION=28.0.3
matrix:
- EMULATOR_SDK=android-19 ABI=armeabi-v7a
- EMULATOR_SDK=android-22 ABI=armeabi-v7a
Expand Down
58 changes: 34 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
buildscript {
project.ext {
agp_version = '3.1.4'
agp_version = '3.4.0'
bintray_version = '1.8.4'
cpd_version = '1.1'
dokka_version = '0.9.17'
dexcount_version = '0.8.3'
jacoco_version = '0.8.2'
kotlin_version = "1.2.70"
maven_version = '2.0'
cpd_version = '1.3'
dokka_version = '0.9.18'
dexcount_version = '0.8.5'
jacoco_version = '0.8.3'
kotlin_version = "1.3.30"
maven_version = '2.1'
}

repositories {
Expand All @@ -18,24 +18,32 @@ buildscript {

dependencies {
classpath "com.android.tools.build:gradle:$agp_version"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// Static Analysis
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version"
classpath "com.github.dcendents:android-maven-gradle-plugin:$maven_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
classpath "de.aaschmid:gradle-cpd-plugin:$cpd_version"


// Code Coverage
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "org.jacoco:org.jacoco.agent:$jacoco_version"
classpath "org.jacoco:org.jacoco.report:$jacoco_version"

// Publishing
classpath "com.github.dcendents:android-maven-gradle-plugin:$maven_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka_version"
}
}

plugins {
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC8"
id "org.jlleitschuh.gradle.ktlint" version "5.1.0"
id "io.gitlab.arturbosch.detekt" version "1.0.0-RC14"
id "org.jlleitschuh.gradle.ktlint" version "7.3.0"
}

apply from: rootProject.file("$rootProject.projectDir/gradle/detekt.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/versions.gradle")

apply from: rootProject.file("$rootProject.projectDir/gradle/ktlint.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/static-analysis.gradle")

Expand All @@ -45,12 +53,16 @@ subprojects {
apply plugin: 'org.jetbrains.dokka-android'
apply plugin: "org.jlleitschuh.gradle.ktlint"

apply from: rootProject.file("$rootProject.projectDir/gradle/dokka.gradle")

// Static Analysis
apply from: rootProject.file("$rootProject.projectDir/gradle/detekt.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/cpd.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/pmd.gradle")

// Code Coverage
apply from: rootProject.file("$rootProject.projectDir/gradle/jacoco.gradle")

// Publishing
apply from: rootProject.file("$rootProject.projectDir/gradle/dokka.gradle")
}

allprojects {
Expand All @@ -61,6 +73,8 @@ allprojects {
}

task clean(type: Delete) {
outputs.upToDateWhen { false }

delete rootProject.buildDir
}

Expand Down Expand Up @@ -114,22 +128,18 @@ ext {
POM_DEVELOPER_EMAIL = "isuPatches@yahoo.com"

// Common build version details
BUILD_TOOLS_VERSION = '27.0.3'
MAX_SDK_VERSION = 27
BUILD_TOOLS_VERSION = '28.0.3'
MAX_SDK_VERSION = 28
MIN_SDK_VERSION = 16
VERSION_CODE = 14
VERSION_NAME = "3.0.1"

espresso_version = '3.0.2'
junit_version = '4.12'
mockito_version = '2.21.0'
support_libs_version = '27.1.1'
test_runner_version = '1.0.2'
VERSION_NAME = "4.0.0"
}

task makeGoodChoices {
group = "verification"

outputs.upToDateWhen { false }

dependsOn 'staticAnalysisSanityCheck', 'jacocoAllCombinedTests'
doLast {
println "\n#############################################" +
Expand Down
1 change: 0 additions & 1 deletion config/checkstyle/import-control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<allow pkg="android.content"/>
<allow pkg="android.net"/>
<allow pkg="android.os"/>
<allow pkg="android.support"/>
<allow pkg="android.util"/>

<!-- Google -->
Expand Down
20 changes: 11 additions & 9 deletions documentation/permissions_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import android.Manifest.permission.ACCESS_COARSE_LOCATION
import android.content.pm.PackageManager
import android.net.wifi.ScanResult
import android.os.Bundle
import android.support.v4.content.ContextCompat
import android.support.v7.app.AppCompatActivity
import android.util.Log
import androidx.core.content.ContextCompat
import androidx.appcompat.app.AppCompatActivity

import com.isupatches.wisefy.WiseFy
import com.isupatches.wisefy.callbacks.GetNearbyAccessPointsCallbacks
Expand Down Expand Up @@ -113,16 +113,18 @@ _With Java_
```java
package wisefy_sample.isupatches.com.wisefysample.ui;


import android.content.pm.PackageManager;
import android.net.wifi.ScanResult;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.isupatches.wisefy.WiseFy;
import com.isupatches.wisefy.callbacks.GetNearbyAccessPointsCallbacks;

import java.util.List;

import wisefy_sample.isupatches.com.wisefysample.R;
import wisefy_sample.isupatches.com.wisefysample.constants.Permissions;
import wisefy_sample.isupatches.com.wisefysample.util.PermissionUtil;
Expand Down Expand Up @@ -217,9 +219,9 @@ _With Kotlin_
package com.isupatches.wisefysample.util

import android.app.Activity
import android.support.v4.app.ActivityCompat
import android.content.pm.PackageManager
import android.support.v4.content.ContextCompat
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat

class PermissionUtil private constructor() {

Expand Down Expand Up @@ -250,8 +252,8 @@ package wisefy_sample.isupatches.com.wisefysample.util;

import android.app.Activity;
import android.content.pm.PackageManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

public class PermissionUtil {

Expand Down
28 changes: 7 additions & 21 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# The Gradle daemon aims to improve the startup and execution time of Gradle.
# When set to true the Gradle daemon is to run the build.
org.gradle.daemon=true
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -noverify -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
# Enables new incubating mode that makes Gradle selective when configuring projects.
# Only relevant projects are configured which results in faster builds for large multi-projects.
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand
org.gradle.configureondemand=false
org.gradle.jvmargs=-Xmx1g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# Android X: https://developer.android.com/topic/libraries/support-library/androidx-rn
android.enableJetifier=true
android.useAndroidX=true

org.gradle.caching=false
29 changes: 0 additions & 29 deletions gradle/checkstyle.gradle

This file was deleted.

12 changes: 6 additions & 6 deletions gradle/code-coverage.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
task jacocoAllCombinedTests {
group = "verification"

outputs.upToDateWhen { false }
dependsOn ':wisefy:jacocoDebugCombinedTest'
}

task jacocoAllCombinedTestReports {
group = "verification"

outputs.upToDateWhen { false }
dependsOn ':wisefy:jacocoDebugCombinedTestReport'
}

task jacocoAllUnitTests {
group = "verification"

outputs.upToDateWhen { false }
dependsOn ':wisefy:jacocoDebugUnitTest'
}

task jacocoAllUnitTestReports {
group = "verification"

outputs.upToDateWhen { false }
dependsOn ':wisefy:jacocoDebugUnitTestReport'
}

task jacocoAllAndroidTests {
group = "verification"

outputs.upToDateWhen { false }
dependsOn ':wisefy:jacocoDebugAndroidTest'
}

task jacocoAllAndroidTestReports {
group = "verification"

outputs.upToDateWhen { false }
dependsOn ':wisefy:jacocoDebugAndroidTestReport'
}
5 changes: 4 additions & 1 deletion gradle/cpd.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ apply plugin: 'cpd'

cpd {
language = 'java'
toolVersion = '6.8.0'
}

cpdCheck {
group = "verification"

ignoreFailures false

def classes = fileTree('src/main/java')
def classes = fileTree("$projectDir/src/main/java")
classes += fileTree('src/androidTest/java')
classes += fileTree('src/commonTest/java')
classes += fileTree('src/test/java')
Expand Down
8 changes: 6 additions & 2 deletions gradle/custom-tasks.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
task makeGoodChoices {
group = "verification"

dependsOn 'androidFindbugs', 'pmd', 'lintDebug', 'cpdCheck', 'checkstyle', 'jacocoDebugTestReport'
outputs.upToDateWhen { false }

dependsOn 'pmd', 'lintDebug', 'cpdCheck', 'checkstyle', 'jacocoDebugTestReport'
doLast {
println "\n#############################################" +
"\n# All checks passed! You are doing so good! #" +
Expand All @@ -13,7 +15,9 @@ task makeGoodChoices {
task staticAnalysisSanityCheck {
group = "verification"

dependsOn 'androidFindbugs', 'pmd', 'lintDebug', 'cpdCheck', 'checkstyle'
outputs.upToDateWhen { false }

dependsOn 'pmd', 'lintDebug', 'cpdCheck', 'checkstyle'
doLast {
println "\n##################################################" +
"\n# Static analysis passed! You are doing so good! #" +
Expand Down
16 changes: 4 additions & 12 deletions gradle/detekt.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
detekt {
version = "1.0.0.RC8"

profile("main") {
input = "$projectDir/wisefy/src/"
output = "$projectDir/wisefy/build/reports/detekt"
config = "$projectDir/config/detekt-config.yml"
}
apply plugin: "io.gitlab.arturbosch.detekt"

profile("wisefy") {
input = "$projectDir/wisefy/src/"
output = "$projectDir/wisefy/build/reports/detekt"
}
detekt {
version = "$detekt_version"
config = files("$project.rootDir/config/detekt-config.yml")
}
26 changes: 0 additions & 26 deletions gradle/findbugs.gradle

This file was deleted.

Loading

0 comments on commit dcbad2c

Please sign in to comment.