Skip to content

Commit

Permalink
Various migrations (#6)
Browse files Browse the repository at this point in the history
* AndroidX
* Gradle 6
* Min api 21 and target 30
* Nexus repository
  • Loading branch information
guchito9 authored Jan 20, 2022
1 parent 1ce7035 commit 4c45f14
Show file tree
Hide file tree
Showing 15 changed files with 173 additions and 135 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## VERSION 1.2.0
_20_01_2022_
* Migrates to AndroidX
* Migrates to Gradle 6
* Migrates to min api 21 and target 30
* Migrates to nexus repository

## VERSION 1.1.1
_XX_08_2020_
* No changes from 1.0.5
Expand Down
15 changes: 10 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
compileSdkVersion Versions.sdkVersion
buildToolsVersion Versions.buildToolsVersion

defaultConfig {
applicationId "com.mercadolibre.android.picassodiskcache"
minSdkVersion 19
targetSdkVersion 28
minSdkVersion Versions.minSdkVersion
targetSdkVersion Versions.sdkVersion
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
Expand All @@ -26,5 +29,7 @@ dependencies {
implementation Dependencies.kotlinStdlib
implementation Dependencies.appCompat
implementation Dependencies.constraintLayout
implementation Dependencies.picassoTestApp
}
implementation(Dependencies.picassoTestApp) {
force true
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mercadolibre.android.picassodiskcache.example

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import com.mercadolibre.android.picassodiskcache.PicassoDiskLoader
import com.mercadolibre.android.picassodiskcache.loadImage
import kotlinx.android.synthetic.main.activity_main.*
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAccent"
tools:context=".SampleActivity">

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/sampleImage"
android:layout_width="160dp"
android:layout_height="160dp"
Expand All @@ -18,7 +18,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@color/colorAccent" />

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/sampleImage2"
android:layout_width="160dp"
android:layout_height="160dp"
Expand All @@ -29,4 +29,4 @@
app:layout_constraintTop_toBottomOf="@+id/sampleImage"
tools:src="@color/colorAccent" />

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath Dependencies.gradle
classpath Dependencies.gradleAndroid
classpath Dependencies.gradleKotlin
classpath Dependencies.bintray
classpath Dependencies.maven
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts.kts files
}
}

ext {
dateNow = new Date().format("ddMMyyyyHHmmssS")
}

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

task cleanBuildDir(type: Delete) {
delete rootProject.buildDir
}
repositories {
mavenCentral()
}
12 changes: 5 additions & 7 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
object Dependencies {

// Gradle
const val gradle = "com.android.tools.build:gradle:${Versions.gradle}"
const val gradleAndroid = "com.android.tools.build:gradle:${Versions.gradleAndroid}"
const val gradleKotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.gradleKotlin}"

// Deploy
const val bintray = "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
const val maven = "com.github.dcendents:android-maven-gradle-plugin:2.1"
const val maven = "com.github.dcendents:android-maven-gradle-plugin:${Versions.mavenPublish}"

// Kotlin
const val kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Versions.gradleKotlin}"

// AppCompat
const val appCompat = "com.android.support:appcompat-v7:${Versions.appcompat}"
const val appCompat = "androidx.appcompat:appcompat:${Versions.appcompat}"

// ConstraintLayout
const val constraintLayout =
"com.android.support.constraint:constraint-layout:${Versions.constraintLayout}"
const val constraintLayout = "androidx.constraintlayout:constraintlayout:${Versions.constraintLayout}"

// Picasso
const val picasso = "com.squareup.picasso:picasso:${Versions.picasso}"
Expand All @@ -26,4 +24,4 @@ object Dependencies {
const val okHttp = "com.squareup.okhttp3:okhttp:${Versions.okHttp}"
const val okHttpUrlConnection = "com.squareup.okhttp3:okhttp-urlconnection:${Versions.okHttp}"
const val loggingInterceptor = "com.squareup.okhttp3:logging-interceptor:${Versions.okHttp}"
}
}
19 changes: 10 additions & 9 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
object Versions {

const val versionToDeploy = "1.1.1"
const val libraryVersion = "1.2.0"

const val compileSdkVersion = 28
const val minSdkVersion = 19
const val targetSdkVersion = 28
const val minSdkVersion = 21
const val sdkVersion = 30
const val buildToolsVersion = "30.0.2"

const val constraintLayout = "1.1.3"
const val appcompat = "28.0.0"
const val gradle = "3.5.1"
const val gradleKotlin = "1.3.50"
const val okHttp = "3.11.0"
const val mavenPublish = "2.1"
const val constraintLayout = "2.0.4"
const val appcompat = "1.2.0"
const val gradleAndroid = "4.2.1"
const val gradleKotlin = "1.3.71"
const val okHttp = "3.14.9"
const val picasso = "2.5.2"
const val picassoTestApp = "2.71828"
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ org.gradle.jvmargs=-Xmx1536m
# Android operating system, and which are packaged with your app's APK
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.useAndroidX=true
android.enableJetifier=true
Loading

0 comments on commit 4c45f14

Please sign in to comment.