Skip to content

Commit

Permalink
3.x Rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
isuPatches authored Aug 19, 2018
1 parent 9fc2ec1 commit 1f926f0
Show file tree
Hide file tree
Showing 410 changed files with 20,303 additions and 26,158 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @isuPatches
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jdk:

env:
global:
- TARGET_SDK=26
- BUILD_TOOLS_VERSION=26.0.0
- TARGET_SDK=27
- BUILD_TOOLS_VERSION=27.0.3
matrix:
- EMULATOR_SDK=android-19 ABI=armeabi-v7a
- EMULATOR_SDK=android-22 ABI=armeabi-v7a
Expand All @@ -32,7 +32,7 @@ before_script:
- adb shell input keyevent 82 &

script:
- travis_wait 60 ./gradlew jacocoDebugTestReport
- travis_wait 60 ./gradlew makeGoodChoices

after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 2 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ WiseFy upon each new major release will start a brand new change log.
[1.x Changes](/changes/1.x.md)

[2.x Changes](/changes/2.x.md)

[3.x Changes](/changes/3.x.md)
64 changes: 56 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,35 @@ Wifi configuration and util library built for Android.

> <br/>*Developed by Patches 04/24/2016 - present* <br/>
>
> <br/>Supports Android SDK levels 16-26<br/><br/>
> <br/>Supports Android SDK levels 16-27<br/><br/>
[![Build Status](https://travis-ci.org/isuPatches/WiseFy.svg?branch=master)](https://travis-ci.org/isuPatches/WiseFy) [ ![Download](https://api.bintray.com/packages/isupatches/Maven/wisefy/images/download.svg) ](https://bintray.com/isupatches/Maven/wisefy/_latestVersion) <a href="http://www.methodscount.com/?lib=com.isupatches%3Awisefy%3A2.%2B"><img src="https://img.shields.io/badge/Methods and size-298 | 51 KB-e91e63.svg"/></a> [![codecov](https://codecov.io/gh/isuPatches/WiseFy/branch/2.x/graph/badge.svg)](https://codecov.io/gh/isuPatches/WiseFy)
[![Build Status](https://travis-ci.org/isuPatches/WiseFy.svg?branch=master)](https://travis-ci.org/isuPatches/WiseFy) [ ![Download](https://api.bintray.com/packages/isupatches/Maven/wisefy/images/download.svg) ](https://bintray.com/isupatches/Maven/wisefy/_latestVersion) [![codecov](https://codecov.io/gh/isuPatches/WiseFy/branch/3.x/graph/badge.svg)](https://codecov.io/gh/isuPatches/WiseFy)

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-WiseFy-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6011) [![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23230-blue.svg)](http://androidweekly.net/issues/issue-230)

## What's New in 2.x
## What's New in 3.x

- Rewritten in Kotlin
- Static analysis tools added
- Ability to get the IP of a device
- Additional details in callbacks for adding a network:
- The new id of the network
- The WifiConfiguration of the network that was added
- isNetworkInConfigurationList renamed isNetworkSaved
- brains renamed Brains
- Nullability issues will be more visible
- Definitions for NetworkTypes and WiseFyCodes
- Immutability throughout the library
- Improved architecture
- Updated dependencies
- Updated to Gradle 4.x and AGP 3.x
- Target now is set to API 27
- Less duplicate code
- Improved testing
- Updated documentation with new Kotlin examples
- Other improvements and adjustments!

## What's New in 2.0.x

- Asynchronous API
- Certain methods have callbacks and are run on a WiseFy specific background thread
Expand Down Expand Up @@ -62,7 +84,7 @@ For Maven:
<dependency>
<groupId>com.isupatches</groupId>
<artifactId>wisefy</artifactId>
<version><LATEST_VERSION></version>
<version>LATEST_VERSION</version>
<type>pom</type>
</dependency>
```
Expand All @@ -73,16 +95,34 @@ You may also download the @aar from the <a href="https://github.com/isuPatches/W

WiseFy is constructed with the builder pattern that allows you access to the synchronous and asynchronous APIs.

*NOTE* The context passed in must be non-null.

To grab a default instance:

_With Kotlin_

```kotlin
val wisefy = WiseFy.Brains(activity!!).getSmarts()
```

_With Java_

```java
WiseFy mWiseFy = new WiseFy.brains(getActivity()).getSmarts();
WiseFy wisefy = new WiseFy.Brains(getActivity()).getSmarts();
```

To grab an instance with logging enabled:

_With Kotlin_

```kotlin
val wisefy = WiseFy.Brains(activity!!).logging(true).getSmarts()
```

_With Java_

```java
WiseFy mWiseFy = new WiseFy.brains(getActivity()).logging(true).getSmarts();
WiseFy wisefy = new WiseFy.Brains(getActivity()).logging(true).getSmarts();
```

## Cleanup
Expand All @@ -91,8 +131,16 @@ Since the Async API of WiseFy is run on a background thread, it is necessary to

To stop the WiseFy thread and nullify it along with it's handler please call:

_With Kotlin_

```kotlin
wisefy.dump();
```

_With Java_

```java
mWiseFy.dump();
wisefy.dump();
```

## Permissions
Expand All @@ -119,7 +167,7 @@ Please check [the permssions example](/documentation/permissions_example.md) for
Please check [the documentation markdown directory](/documentation) for usage examples and details about both the synchronous and asynchronous API.

## License ##
Copyright 2017 Patches Klinefelter
Copyright 2018 Patches Klinefelter

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
Expand Down
79 changes: 68 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,62 @@
buildscript {
project.ext {
agp_version = '3.1.0'
bintray_version = '1.8.4'
cpd_version = '1.1'
dokka_version = '0.9.17'
dexcount_version = '0.8.3'
jacoco_version = '0.8.1'
kotlin_version = "1.2.60"
maven_version = '2.0'
}

repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
google()
maven { url "https://plugins.gradle.org/m2/" }
}

dependencies {
classpath "com.android.tools.build:gradle:2.3.3"
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.1"
classpath "com.github.dcendents:android-maven-gradle-plugin:1.5"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
classpath "org.jacoco:org.jacoco.core:0.7.9"
classpath "org.jacoco:org.jacoco.agent:0.7.9"
classpath "org.jacoco:org.jacoco.report:0.7.9"
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"
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"
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "org.jacoco:org.jacoco.agent:$jacoco_version"
classpath "org.jacoco:org.jacoco.report:$jacoco_version"
}
}

plugins {
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC8"
id "org.jlleitschuh.gradle.ktlint" version "5.0.0"
}

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

apply from: rootProject.file("$rootProject.projectDir/gradle/code-coverage.gradle")

subprojects {
apply plugin: 'org.jetbrains.dokka-android'
apply plugin: "org.jlleitschuh.gradle.ktlint"

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

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

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

allprojects {
repositories {
jcenter()
google()
}
}

Expand Down Expand Up @@ -49,8 +87,8 @@ ext {
// allows for -Dpre-dex=false to be set
preDexEnabled = "true" == System.getProperty("pre-dex", "true")

// Bintray and POM Details
GROUP = "com.isupatches"
VERSION_NAME = "2.0.1"

BINTRAY_REPO = "Maven"
BINTRAY_NAME = "wisefy"
Expand All @@ -74,4 +112,23 @@ ext {
POM_DEVELOPER_ID = "isuPatches"
POM_DEVELOPER_NAME = "Patches Klinefelter"
POM_DEVELOPER_EMAIL = "isuPatches@yahoo.com"

// Common build version details
BUILD_TOOLS_VERSION = '27.0.3'
MAX_SDK_VERSION = 27
MIN_SDK_VERSION = 16
VERSION_CODE = 13
VERSION_NAME = "3.0.0"
}

task makeGoodChoices {
group = "verification"

dependsOn 'staticAnalysisSanityCheck', 'jacocoAllCombinedTests'
doLast {
println "\n#############################################" +
"\n# All checks passed! You are doing so good! #" +
"\n# You may now push the awesome to origin :) #" +
"\n#############################################"
}
}
File renamed without changes.
31 changes: 31 additions & 0 deletions config/checkstyle/import-control.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<!DOCTYPE import-control PUBLIC
"-//Puppy Crawl//DTD Import Control 1.2//EN"
"http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
<import-control pkg="com.isupatches.wisefy">

<allow pkg="com.isupatches.wisefy"/>

<!-- Android -->
<allow pkg="android.annotation"/>
<allow pkg="android.content"/>
<allow pkg="android.net"/>
<allow pkg="android.os"/>
<allow pkg="android.support"/>
<allow pkg="android.util"/>

<!-- Google -->
<allow pkg="com.google.android.gms"/>

<!-- Java -->
<allow pkg="java.lang.annotation"/>
<allow pkg="java.math"/>
<allow pkg="java.net"/>
<allow pkg="java.util"/>

<!-- Junit -->
<allow pkg="org.junit"/>

<!-- Mockito -->
<allow pkg="org.mockito"/>
</import-control>
Loading

0 comments on commit 1f926f0

Please sign in to comment.