Skip to content

Commit

Permalink
Merge pull request #117 from SchibstedSpain/upgradeApi26
Browse files Browse the repository at this point in the history
Upgraded to API 26. Play Services upgraded to version 11.4.2.
  • Loading branch information
ferranpons authored Nov 7, 2017
2 parents 97339ae + c398a3c commit d3fccd1
Show file tree
Hide file tree
Showing 28 changed files with 285 additions and 139 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ android:
- tools
- tools
- platform-tools
- build-tools-25.0.2
- android-25
- build-tools-26.0.2
- android-26
- extra
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-25
- addon-google_apis-google-26
- sys-img-armeabi-v7a-google_apis-21

# Emulator Management: Create, Start and Wait
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ Location picker component for Android. It returns a latitude, longitude and an a
### Prerequisites

minSdkVersion >= 15
Google Play Services = 10.2.1
Support Library = 25.3.1
Google Play Services = 11.4.2
Support Library = 26.1.0

### Download

Expand All @@ -76,7 +76,7 @@ Include the dependency in your app `build.gradle`:

```groovy
dependencies {
compile 'com.schibstedspain.android:leku:3.4.5'
compile 'com.schibstedspain.android:leku:3.5.0'
}
```

Expand Down
12 changes: 8 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
apply from: '../quality.gradle'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
applicationId "com.schibsted.mappicker"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
Expand All @@ -19,10 +19,14 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:appcompat-v7:26.1.0'
compile project(':leku')
}
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -27,4 +27,4 @@
android:padding="24dp"
/>
</LinearLayout>
</FrameLayout>
</merge>
15 changes: 10 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0'

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
classpath 'com.novoda:bintray-release:0.3.4'
classpath 'me.tatarka:gradle-retrolambda:3.5.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.14"
classpath 'com.novoda:bintray-release:0.5.0'
}
}

Expand All @@ -20,5 +24,6 @@ allprojects {
maven {
url "http://dl.bintray.com/schibstedspain/maven"
}
google()
}
}
8 changes: 6 additions & 2 deletions config/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?xml version="1.0"?><!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress checks="[a-zA-Z0-9]*" files="R\.java"/>
<suppress checks="." files="BuildConfig.java"/>
<suppress checks="." files=".*\.properties"/>
<!-- allow snake case in tests -->
<suppress files="[\\/]src[\\/]test[\\/].*" id="MethodNameRegular" />
<suppress files="[\\/]src[\\/]androidTest[\\/].*" id="MethodNameRegular" />
<suppress files="[\\/]src[\\/]main[\\/].*" id="MethodNameTest" />
</suppressions>
33 changes: 25 additions & 8 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">


<!-- Based on https://github.com/square/java-code-styles -->
Expand All @@ -23,6 +23,7 @@
<module name="EmptyBlock"/>
<module name="EmptyCatchBlock">
<property name="commentFormat" value="Intentionally blank"/>
<property name="exceptionVariableName" value="ignore|expected"/>
</module>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
Expand All @@ -44,16 +45,16 @@
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>

<module name="IllegalCatch">
<property name="illegalClassNames" value="Exception"/>
</module>

<module name="ParameterAssignment"/>
<module name="FallThrough"/>
<module name="OneStatementPerLine"/>
<module name="OverloadMethodsDeclarationOrder"/>

</module>

<!-- Old values -->
Expand Down Expand Up @@ -87,7 +88,13 @@
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->

<module name="MethodName"/>
<module name="MethodName">
<property name="id" value="MethodNameRegular"/>
</module>
<module name="MethodName">
<property name="id" value="MethodNameTest"/>
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="TypeName"/>
Expand Down Expand Up @@ -118,7 +125,17 @@
<module name="GenericWhitespace"/>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="INC"/>
<property name="tokens" value="DEC"/>
<property name="tokens" value="UNARY_MINUS"/>
<property name="tokens" value="UNARY_PLUS"/>
<property name="tokens" value="BNOT"/>
<property name="tokens" value="LNOT"/>
<property name="tokens" value="DOT"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="tokens" value="INDEX_OP"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
Expand Down Expand Up @@ -149,4 +166,4 @@
</module>
<module name="UpperEll"/>
</module>
</module>
</module>
3 changes: 0 additions & 3 deletions config/findbugs/findbugs-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,6 @@
<Match>
<Bug pattern="RV_RETURN_VALUE_IGNORED"/>
</Match>
<Match>
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
</Match>
<Match>
<Bug pattern="RV_EXCEPTION_NOT_THROWN"/>
</Match>
Expand Down
3 changes: 3 additions & 0 deletions config/findbugs/findbugs-excludes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<FindBugsFilter>
<!-- Fallback excludes file. This file will be used when a project lacks a findbugs-excludes.xml file -->
<Match>
<Source name="~.*\.kt"/>
</Match>
<Match>
<Source name="~.*\.groovy" />
<Or>
Expand Down
3 changes: 3 additions & 0 deletions config/lint/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
<ignore regexp="Try-with-resources requires API level 19"/>
</issue>
<issue id="GradleDependency" severity="ignore"/>
<issue id="UnusedResources">
<ignore regexp="ga_trackingId|google_crash_reporting_api_key"/>
</issue>
</lint>
17 changes: 9 additions & 8 deletions config/pmd/pmd-ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="FINN Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>FINN ruleset - tweaked for PMD 5.0.2 and for running on tests, too.</description>
<rule ref="rulesets/java/unnecessary.xml/UnusedNullCheckInEquals">
<priority>3</priority>
Expand Down Expand Up @@ -97,12 +97,14 @@
<rule ref="rulesets/java/unnecessary.xml/UselessOverridingMethod">
<priority>3</priority>
</rule>
<rule ref="rulesets/java/unusedcode.xml/UnusedModifier">
<rule ref="rulesets/java/unnecessary.xml/UnnecessaryModifier">
<priority>5</priority>
</rule>
<rule ref="rulesets/java/design.xml/PreserveStackTrace">
<priority>3</priority>
</rule>
<!-- Using RxJava we do use exceptions as Error and we don't need to do this
<rule ref="rulesets/java/design.xml/PreserveStackTrace">
<priority>3</priority>
</rule>
-->
<rule ref="rulesets/java/optimizations.xml/UseArraysAsList">
<priority>3</priority>
</rule>
Expand Down Expand Up @@ -310,4 +312,3 @@
</example>
</rule>
</ruleset>

4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 17 11:33:48 CET 2017
#Mon Nov 06 14:07:04 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
37 changes: 17 additions & 20 deletions leku/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
apply plugin: 'com.android.library'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.novoda.bintray-release'
apply from: '../quality.gradle'

group = 'com.schibstedspain.android'
version = '3.4.5'
version = '3.5.0'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'lib-proguard-rules.txt'
vectorDrawables.useSupportLibrary = true
}

flavorDimensions 'tier'

buildTypes {
release {
minifyEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -35,18 +36,14 @@ android {
}
}

retrolambda {
javaVersion JavaVersion.VERSION_1_7
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

def supportVersion = '25.3.1'
def supportVersion = '26.1.0'
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:design:$supportVersion"

def playServicesVersion = '10.2.6'
def playServicesVersion = '11.4.2'
compile "com.google.android.gms:play-services-maps:$playServicesVersion"
compile "com.google.android.gms:play-services-location:$playServicesVersion"

Expand All @@ -55,21 +52,21 @@ dependencies {
}

compile "io.reactivex:rxandroid:1.2.1"
compile 'io.reactivex:rxjava:1.2.4'
compile 'io.reactivex:rxjava:1.3.2'

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
androidTestCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test:rules:1.0.1'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:3.0.1'
androidTestCompile 'org.mockito:mockito-core:2.11.0'
}

publish {
userOrg = 'schibstedspain'
groupId = 'com.schibstedspain.android'
artifactId = 'leku'
publishVersion = '3.4.5'
publishVersion = '3.5.0'
desc = 'Location picker component for Android. It returns a latitude,longitude and an address based on the location picked in the LocationPickerActivity provided.'
website = 'https://github.com/SchibstedSpain/leku'
}
4 changes: 2 additions & 2 deletions leku/src/androidTest/java/util/PermissionGranter.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ private boolean hasNeededPermission(Activity activity, String permissionNeeded)
return permissionStatus == PackageManager.PERMISSION_GRANTED;
}

public void waitInMillis(long millis) {
private void waitInMillis(long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
throw new RuntimeException("Cannot execute Thread.sleep()");
Log.d(PermissionGranter.class.getName(), "Cannot execute Thread.sleep()");
}
}

Expand Down
1 change: 1 addition & 0 deletions leku/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<application
android:allowBackup="true"
android:supportsRtl="true"
>
</application>

Expand Down
Loading

0 comments on commit d3fccd1

Please sign in to comment.