Skip to content

Commit

Permalink
Merge pull request #2 from nealsanche/master
Browse files Browse the repository at this point in the history
Migrate to AndroidX
  • Loading branch information
IvanShafran authored Aug 8, 2021
2 parents c2850d6 + 996718f commit 17bdddd
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 31 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ android:
- tools
- platform-tools

# The BuildTools version used by your project
- build-tools-28.0.3

# The SDK version used to compile your project
- android-28

licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+

before_install:
- chmod +x gradlew
- yes | sdkmanager "platforms;android-29"
- yes | sdkmanager "build-tools;29.0.2"

script:
- ./gradlew clean jacocoTestReport
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "de.mannodermaus.gradle.plugins:android-junit5:$android_junit5_version"
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
Expand Down
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ org.gradle.jvmargs=-Xmx1536m
# org.gradle.parallel=true

spek_version=2.0.5
android_junit5_version=1.4.2.0
android_junit5_version=1.6.2.0
junit5_runner=0.2.2
jacoco_version=0.8.1
kotlin_version = 1.3.40
kotlin_version = 1.3.72
android.useAndroidX=true
android.enableJetifier=false
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 @@
#Sun Jun 09 01:28:29 MSK 2019
#Wed Aug 12 10:03:11 MDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Empty file modified gradlew
100644 → 100755
Empty file.
21 changes: 13 additions & 8 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "com.github.ivanshafran.sharedpreferencesmock.sample"
minSdkVersion 15
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'

testImplementation 'com.github.IvanShafran:shared-preferences-mock:1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation project(':sharedpreferencesmock')
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

public class CounterPreferences {

Expand Down
19 changes: 15 additions & 4 deletions sharedpreferencesmock/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ android {
compileSdkVersion 28

defaultConfig {
testInstrumentationRunnerArguments
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
testInstrumentationRunnerArgument "runnerBuilder", "de.mannodermaus.junit5.AndroidJUnit5Builder"

}
Expand Down Expand Up @@ -43,12 +44,21 @@ android {
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
exclude 'META-INF/LICENSE.md'
exclude 'META-INF/LICENSE-notice.md'
}
}

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

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'

// spek2
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Expand All @@ -58,6 +68,7 @@ dependencies {
testImplementation "org.spekframework.spek2:spek-dsl-jvm:$spek_version"
testImplementation "org.spekframework.spek2:spek-runner-junit5:$spek_version"

androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestRuntimeOnly "de.mannodermaus.junit5:android-instrumentation-test-runner:$junit5_runner"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation "de.mannodermaus.junit5:android-test-core:1.2.0"
androidTestRuntimeOnly "de.mannodermaus.junit5:android-test-runner:1.2.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.github.ivanshafran.sharedpreferencesmock.internal.ContextMock;
import com.github.ivanshafran.sharedpreferencesmock.internal.SPContextWrapperMock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import android.os.Handler;
import android.os.Looper;
import android.os.UserHandle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.Display;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Context;
import android.content.ContextWrapper;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.github.ivanshafran.sharedpreferencesmock.internal;

import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.ivanshafran.sharedpreferencesmock.internal;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import java.util.Map;
import java.util.Set;
Expand Down

0 comments on commit 17bdddd

Please sign in to comment.