Skip to content

Commit

Permalink
Build tools updates (#106)
Browse files Browse the repository at this point in the history
* AGP 7.4.2

* kotlin 1.7.22

* gradle 8.1 and config cache

* Epoxy update for incremental kapt

* more ram for gradle

* unused maven

* use KSP where possible

* pffft jitpack
  • Loading branch information
joshfriend authored Oct 19, 2023
1 parent e603b4a commit 3be8891
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 180 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.7.20'
ext.kotlin_version = '1.7.22'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3"
}
Expand All @@ -23,19 +23,19 @@ plugins {
// Mozilla decided to live with the duplication: https://github.com/mozilla-mobile/focus-android/issues/1886
// Possible solution that requires changing to Gradle Kotlin DSL: https://github.com/gradle/gradle/issues/1697
id "io.gitlab.arturbosch.detekt" version "1.23.1"
id "com.google.devtools.ksp" version "1.7.22-1.0.8"
}

allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
allWarningsAsErrors = true
// jvmTarget = JavaVersion.VERSION_11
jvmTarget = JavaVersion.VERSION_1_8
}
}
}
Expand Down
48 changes: 20 additions & 28 deletions bunnies/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-android-extensions'
id "androidx.navigation.safeargs.kotlin"
id 'com.google.devtools.ksp'
}

androidExtensions {
experimental = true
Expand All @@ -13,8 +16,9 @@ kapt {
}

android {
compileSdkVersion 33
namespace = "com.fueledbycaffeine.bunnypedia"

compileSdkVersion 33
defaultConfig {
applicationId "com.fueledbycaffeine.bunnypedia"
minSdkVersion 23
Expand All @@ -33,10 +37,6 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

dexOptions {
preDexLibraries true
}

lintOptions {
textReport true
textOutput 'stdout'
Expand All @@ -54,7 +54,7 @@ android {

signingConfigs {
release {
def password = getPassword(defaultConfig.applicationId)
def password = getPassword()
storeFile file("$rootProject.projectDir/bunnypedia.jks")
storePassword password
keyAlias 'bunnypedia'
Expand All @@ -79,7 +79,6 @@ android {
repositories {
google()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }

// Still get fastscroll dep from here
//noinspection JcenterRepositoryObsolete
Expand Down Expand Up @@ -108,14 +107,14 @@ dependencies {
def roomVersion = "2.4.3"
implementation "androidx.room:room-runtime:$roomVersion"
implementation "androidx.room:room-rxjava2:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"
ksp "androidx.room:room-compiler:$roomVersion"
def pagingVersion = "2.1.2"
implementation "androidx.paging:paging-runtime-ktx:$pagingVersion"
implementation "androidx.paging:paging-rxjava2-ktx:$pagingVersion"

def epoxyVersion = "3.9.0"
def epoxyVersion = "5.1.1"
implementation "com.airbnb.android:epoxy:$epoxyVersion"
kapt "com.airbnb.android:epoxy-processor:$epoxyVersion"
ksp "com.airbnb.android:epoxy-processor:$epoxyVersion"

// Dependency injection
def daggerVersion = "2.44"
Expand All @@ -132,9 +131,9 @@ dependencies {
implementation "com.jakewharton.rxbinding3:rxbinding:$rxBindingVersion"
implementation "com.jakewharton.rxbinding3:rxbinding-appcompat:$rxBindingVersion"

def glideVersion = '4.13.2'
def glideVersion = '4.15.1'
implementation "com.github.bumptech.glide:glide:$glideVersion"
kapt "com.github.bumptech.glide:compiler:$glideVersion"
ksp "com.github.bumptech.glide:compiler:$glideVersion"
implementation "me.saket:better-link-movement-method:2"
implementation 'com.futuremind.recyclerfastscroll:fastscroll:0.2.5'

Expand All @@ -146,19 +145,12 @@ dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

def getPassword(String item) {
def getPassword() {
if (System.getenv('CI') != null) {
System.getenv('ANDROID_KEYSTORE_PASSWORD')
} else {
def stdout = new ByteArrayOutputStream()
def stderr = new ByteArrayOutputStream()
exec {
commandLine 'security', '-q', 'find-generic-password', '-s', item, '-w'
standardOutput = stdout
errorOutput = stderr
ignoreExitValue true
}
//noinspection GroovyAssignabilityCheck
stdout.toString().trim()
def properties = new Properties()
properties.load(project.rootProject.file("local.properties").newDataInputStream())
properties.getProperty('keystorePassword')
}
}
1 change: 0 additions & 1 deletion bunnies/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<manifest
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fueledbycaffeine.bunnypedia"
>

<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class CardDetailsEpoxyController(private val details: CardWithRules) : EpoxyCont
override fun buildModels() {
cardSection {
id("card")
card(details.card)
card(this@CardDetailsEpoxyController.details.card)
}
details.rules.forEach { rule ->
ruleSection {
id(rule.id)
rule(rule)
linkListener(links::onNext)
linkListener(this@CardDetailsEpoxyController.links::onNext)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.widget.ImageView
import androidx.annotation.StringRes
import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat
import com.bumptech.glide.Glide
import com.bumptech.glide.request.target.Target
import com.fueledbycaffeine.bunnypedia.R
import com.fueledbycaffeine.bunnypedia.database.model.Card
Expand All @@ -20,7 +21,6 @@ import com.fueledbycaffeine.bunnypedia.database.model.SpecialSeries
import com.fueledbycaffeine.bunnypedia.database.model.ZodiacAnimal
import com.fueledbycaffeine.bunnypedia.database.model.ZodiacSign
import com.fueledbycaffeine.bunnypedia.ui.EpoxyLayoutContainer
import com.fueledbycaffeine.bunnypedia.ui.GlideApp
import com.google.android.flexbox.FlexboxLayout
import kotlinx.android.synthetic.main.card_hero_details.view.*
import java.time.LocalDate
Expand All @@ -35,7 +35,7 @@ class CardSectionViewHolder : EpoxyLayoutContainer() {
fun display(card: Card) {
itemView.cardType.text = getString(card.type.description)

GlideApp.with(context)
Glide.with(context)
.load(card.imageURI)
.override(Target.SIZE_ORIGINAL)
.into(itemView.cardThumbnail)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.paging.PagedListAdapter
import androidx.recyclerview.widget.DiffUtil
import com.bumptech.glide.Glide
import com.fueledbycaffeine.bunnypedia.R
import com.fueledbycaffeine.bunnypedia.database.model.CardWithRules
import com.fueledbycaffeine.bunnypedia.ext.android.layoutInflater
import com.fueledbycaffeine.bunnypedia.ui.GlideApp
import com.futuremind.recyclerviewfastscroll.SectionTitleProvider

class CardAdapter(
Expand Down Expand Up @@ -44,7 +44,7 @@ class CardAdapter(
if (cardWithRules == null) {
holder.clear()
} else {
holder.bind(GlideApp.with(fragment), cardWithRules)
holder.bind(Glide.with(fragment), cardWithRules)
holder.itemView.setOnClickListener { onCardSelected(cardWithRules.card.id) }
}
}
Expand All @@ -66,6 +66,6 @@ class CardAdapter(

override fun getSectionTitle(position: Int): String {
val (card) = getItem(position) ?: return "???"
return card.id.toString()
return card.id
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options\="-Xmx1536M"

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand All @@ -18,6 +18,7 @@ org.gradle.jvmargs=-Xmx1536m

#org.gradle.caching=true
org.gradle.configuration-cache=true
kapt.use.worker.api=true

android.useAndroidX=true
android.enableJetifier=true
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 @@
#Mon Jun 22 21:24:26 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
Loading

0 comments on commit 3be8891

Please sign in to comment.