Refactor gradle configuration and update dependencies

- Enable java 11 language features
- Switch to groovy syntax
- Switch to new gradle plugins and dependency configuration
- Drop deprecated properties
- Switch from buildscript to project.ext closure for version property
- Update dependencies to latest stable versions
- Address build errors arising due to dependencies update

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2022-08-26 21:03:35 +05:30
parent fd693bf9d8
commit ecf16661dc
8 changed files with 92 additions and 94 deletions

View File

@@ -1,6 +1,7 @@
/*
* Aurora Store
* Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
* Copyright (C) 2022, The Calyx Institute
*
* Aurora Store is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,18 +18,33 @@
*
*/
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin"
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.kapt'
id 'androidx.navigation.safeargs.kotlin'
}
project.ext {
versions = [
okhttp3 : "4.10.0",
fetch2 : "3.1.6",
fuel : "2.3.0",
glide : "4.11.0",
lifecycle : '2.5.1',
navigation: '2.5.1',
epoxy : "4.3.1",
libsu : "3.0.2"
]
}
android {
compileSdkVersion 32
compileSdk 33
defaultConfig {
applicationId "com.aurora.store"
minSdkVersion 19
targetSdkVersion 32
minSdk 19
targetSdk 33
versionCode 41
versionName "4.1.1"
@@ -65,27 +81,12 @@ android {
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_11.toString()
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
buildscript {
ext {
versions = [
okhttp3 : "4.9.0",
fetch2 : "3.1.6",
fuel : "2.3.0",
glide : "4.11.0",
lifecycle : '2.4.1',
navigation: '2.4.1',
epoxy : "4.3.1",
libsu : "3.0.2"
]
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
@@ -94,81 +95,79 @@ kapt {
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//MultiDex for Kitkat support
implementation("androidx.multidex:multidex:2.0.1")
implementation "androidx.multidex:multidex:2.0.1"
//Protobuf
implementation("com.google.protobuf:protobuf-java:3.14.0")
implementation "com.google.protobuf:protobuf-java:3.14.0"
//Apache's Goodies
implementation("commons-io:commons-io:2.8.0")
implementation("org.apache.commons:commons-text:1.8")
implementation "commons-io:commons-io:2.8.0"
implementation "org.apache.commons:commons-text:1.8"
//Google's Goodies
implementation("com.google.android.material:material:1.5.0")
implementation("com.google.android:flexbox:2.0.1")
implementation("com.google.code.gson:gson:2.8.6")
implementation "com.google.android.material:material:1.6.1"
implementation "com.google.android.flexbox:flexbox:3.0.0"
implementation "com.google.code.gson:gson:2.9.0"
//AndroidX
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.viewpager2:viewpager2:1.0.0")
implementation("androidx.vectordrawable:vectordrawable:1.1.0")
implementation("androidx.preference:preference-ktx:1.2.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation "androidx.core:core-ktx:1.8.0"
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation "androidx.vectordrawable:vectordrawable:1.1.0"
implementation "androidx.preference:preference-ktx:1.2.0"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
//Arch LifeCycle
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation("androidx.lifecycle:lifecycle-runtime-ktx:${versions.lifecycle}")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}")
implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:${versions.lifecycle}")
implementation "androidx.lifecycle:lifecycle-runtime-ktx:${versions.lifecycle}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:${versions.lifecycle}"
//Arch Navigation
implementation("androidx.navigation:navigation-fragment-ktx:${versions.navigation}")
implementation("androidx.navigation:navigation-runtime-ktx:${versions.navigation}")
implementation("androidx.navigation:navigation-ui-ktx:${versions.navigation}")
implementation "androidx.navigation:navigation-fragment-ktx:${versions.navigation}"
implementation "androidx.navigation:navigation-runtime-ktx:${versions.navigation}"
implementation "androidx.navigation:navigation-ui-ktx:${versions.navigation}"
//UI Addons
implementation("com.github.florent37:expansionpanel:1.2.4")
implementation "com.github.florent37:expansionpanel:1.2.4"
//Easy Permission
implementation("com.github.quickpermissions:quickpermissions-kotlin:0.4.0")
implementation "com.github.quickpermissions:quickpermissions-kotlin:0.4.0"
//Glide
implementation("com.github.bumptech.glide:glide:${versions.glide}")
kapt("com.github.bumptech.glide:compiler:${versions.glide}")
implementation "com.github.bumptech.glide:glide:${versions.glide}"
kapt "com.github.bumptech.glide:compiler:${versions.glide}"
//Shimmer
implementation("com.facebook.shimmer:shimmer:0.5.0")
implementation "com.facebook.shimmer:shimmer:0.5.0"
//Epoxy
implementation("com.airbnb.android:epoxy:${versions.epoxy}")
kapt("com.airbnb.android:epoxy-processor:${versions.epoxy}")
implementation "com.airbnb.android:epoxy:${versions.epoxy}"
kapt "com.airbnb.android:epoxy-processor:${versions.epoxy}"
//Merlin
implementation("com.novoda:merlin:1.2.0")
implementation "com.novoda:merlin:1.2.0"
//HTTP Clients
implementation("com.github.kittinunf.fuel:fuel:${versions.fuel}")
implementation("com.squareup.okhttp3:okhttp:${versions.okhttp3}")
implementation "com.github.kittinunf.fuel:fuel:${versions.fuel}"
implementation "com.squareup.okhttp3:okhttp:${versions.okhttp3}"
//Fetch - Downloader
implementation "androidx.tonyodev.fetch2:xfetch2:${versions.fetch2}"
//Kovenant
implementation("nl.komponents.kovenant:kovenant:3.3.0")
implementation("nl.komponents.kovenant:kovenant-android:3.3.0")
implementation "nl.komponents.kovenant:kovenant:3.3.0"
implementation "nl.komponents.kovenant:kovenant-android:3.3.0"
//EventBus
implementation("org.greenrobot:eventbus:3.2.0")
implementation "org.greenrobot:eventbus:3.2.0"
//Lib-SU
implementation "com.github.topjohnwu.libsu:core:${versions.libsu}"
//Love <3
api("com.gitlab.AuroraOSS:gplayapi:0e224071f3")
api "com.gitlab.AuroraOSS:gplayapi:0e224071f3"
}
Properties props = new Properties()

View File

@@ -109,6 +109,7 @@ class CategoryBrowseActivity : BaseActivity(), GenericCarouselController.Callbac
is ViewState.Success<*> -> {
updateController(it.data as StreamBundle)
}
else -> {}
}
})

View File

@@ -169,7 +169,7 @@ class AccentFragment : BaseFragment() {
anim.duration = 450
anim.interpolator = CubicBezierInterpolator.EASE_IN_OUT_QUAD
anim.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator?) {
override fun onAnimationEnd(animation: Animator) {
B.themeSwitchImage.setImageDrawable(null)
B.themeSwitchImage.hide()
}

View File

@@ -154,7 +154,7 @@ class ThemeFragment : BaseFragment() {
anim.duration = 450
anim.interpolator = CubicBezierInterpolator.EASE_IN_OUT_QUAD
anim.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator?) {
override fun onAnimationEnd(animation: Animator) {
B.themeSwitchImage.setImageDrawable(null)
B.themeSwitchImage.hide()
}

View File

@@ -1,6 +1,7 @@
/*
* Aurora Store
* Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
* Copyright (C) 2022, The Calyx Institute
*
* Aurora Store is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,34 +18,10 @@
*
*/
buildscript {
repositories {
google()
jcenter()
}
ext {
kotlin_version = '1.4.30'
}
ext.kotlin = "1.5.30"
ext.navigation= "2.4.1"
ext.gradle = '7.1.1'
dependencies {
classpath ("com.android.tools.build:gradle:$gradle")
classpath ("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin")
classpath ("androidx.navigation:navigation-safe-args-gradle-plugin:$navigation")
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
id 'androidx.navigation.safeargs.kotlin' version '2.5.1' apply false
}
task clean(type: Delete) {

View File

@@ -46,9 +46,6 @@ kapt.incremental.apt=true
android.databinding.incremental=true
android.lifecycleProcessor.incremental=true
# Decrease gradle builds time
kapt.use.worker.api=true
# turn off AP discovery in compile path, and therefore turn on Compile Avoidance
kapt.include.compile.classpath=false

View File

@@ -22,4 +22,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip

View File

@@ -1,6 +1,7 @@
/*
* Aurora Store
* Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
* Copyright (C) 2022, The Calyx Institute
*
* Aurora Store is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,5 +18,28 @@
*
*/
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
jcenter() // Required for com.novoda:merlin:1.2.0
mavenCentral()
maven {
name 'JitPack'
url 'https://jitpack.io/'
}
maven {
name 'Google'
url 'https://maven.google.com/'
}
}
}
include ':app'
rootProject.name = "AuroraStore4"