Skip to content

Commit

Permalink
Migrate libraries to ksp
Browse files Browse the repository at this point in the history
  • Loading branch information
ForceTower committed Jul 20, 2024
1 parent cf20796 commit 7666197
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 68 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ captures/
*.iml
.idea

# Kotlin
.kotlin

# Keystore files
*.jks

Expand Down
23 changes: 10 additions & 13 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ plugins {
alias(libs.plugins.kotlinter.gradle)
alias(libs.plugins.play.publisher)
alias(libs.plugins.firebase.crashlytics.gradle)
alias(libs.plugins.google.ksp)
alias(libs.plugins.androidx.room)
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.google.services)
}
Expand Down Expand Up @@ -61,15 +63,6 @@ android {
buildConfigField("String", "SIECOMP_DAY5_END", "\"2019-10-22T17:30:00-03:00\"")
buildConfigField("String", "UEFS_DEFAULT_PROXY", "\"10.65.16.2:3128\"")

javaCompileOptions {
annotationProcessorOptions {
arguments += mapOf(
"room.schemaLocation" to "$projectDir/schemas",
"room.incremental" to "true"
)
}
}

ndk {
abiFilters += listOf("arm64-v8a", "armeabi", "armeabi-v7a", "mips", "mips64", "x86", "x86_64")
}
Expand Down Expand Up @@ -178,6 +171,10 @@ play {
defaultToAppBundles.set(true)
}

room {
schemaDirectory("$projectDir/schemas")
}

kotlinter {

}
Expand Down Expand Up @@ -213,11 +210,11 @@ dependencies {
api(libs.androidx.lifecycle.service)
api(libs.androidx.datastore.preferences)
implementation(libs.androidx.paging.runtime.ktx)
kapt(libs.androidx.room.compiler)
ksp(libs.androidx.room.compiler)
implementation(libs.hilt.android)
implementation(libs.androidx.hilt.work)
kapt(libs.androidx.hilt.compiler)
kapt(libs.hilt.compiler)
ksp(libs.androidx.hilt.compiler)
ksp(libs.hilt.compiler)
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics.ktx)
implementation(libs.firebase.messaging.ktx)
Expand All @@ -240,7 +237,7 @@ dependencies {
implementation(libs.app.update.ktx)
implementation(libs.feature.delivery.ktx)
implementation(libs.glide)
kapt(libs.glide.compiler)
ksp(libs.glide.compiler)
implementation(libs.lottie)
implementation(libs.aboutlibraries)
implementation(libs.aboutlibraries.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import android.text.style.AlignmentSpan
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.forcetower.uefs.BuildConfig
import com.forcetower.uefs.GlideApp
import com.forcetower.uefs.R
import com.forcetower.uefs.core.util.HtmlUtils
import com.forcetower.uefs.databinding.FragmentAboutMeBinding
Expand Down Expand Up @@ -71,7 +71,7 @@ class AboutMeFragment : UFragment() {
val sequence = TextUtils.concat(about1, "\n", about2, "\n\n", aboutSupport, "\n\n", about3, "\n", about4)
HtmlUtils.setTextWithNiceLinks(binding.textAboutContinuation, sequence)

GlideApp.with(this)
Glide.with(this)
.load("https://avatars.githubusercontent.com/ForceTower")
.fallback(R.mipmap.ic_unes_large_image_512)
.placeholder(R.mipmap.ic_unes_large_image_512)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ package com.forcetower.uefs.feature.demand
import android.widget.ImageView
import androidx.core.content.ContextCompat
import androidx.databinding.BindingAdapter
import com.bumptech.glide.Glide
import com.forcetower.sagres.database.model.SagresDemandOffer
import com.forcetower.uefs.GlideApp
import com.forcetower.uefs.R
import com.google.android.material.card.MaterialCardView

Expand All @@ -42,7 +42,7 @@ fun disciplineIcon(iv: ImageView, offer: SagresDemandOffer?) {
else -> R.drawable.ic_bug_report_black_24dp
}

GlideApp.with(iv.context).load(drawable).fitCenter().into(iv)
Glide.with(iv.context).load(drawable).fitCenter().into(iv)
}

@BindingAdapter(value = ["animatedStrokeColor"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ import androidx.core.content.ContextCompat
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
import androidx.navigation.ui.NavigationUI
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.canhub.cropper.CropImageContract
import com.canhub.cropper.CropImageContractOptions
import com.canhub.cropper.CropImageOptions
import com.canhub.cropper.CropImageView
import com.forcetower.core.utils.ColorUtils
import com.forcetower.uefs.BuildConfig
import com.forcetower.uefs.GlideApp
import com.forcetower.uefs.R
import com.forcetower.uefs.core.model.unes.Account
import com.forcetower.uefs.core.model.unes.Course
Expand Down Expand Up @@ -188,7 +188,7 @@ class HomeBottomFragment : UFragment() {

private fun onImagePicked(uri: Uri) {
viewModel.setSelectedImage(uri)
GlideApp.with(requireContext())
Glide.with(requireContext())
.load(uri)
.fallback(R.mipmap.ic_unes_large_image_512)
.placeholder(R.mipmap.ic_unes_large_image_512)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.databinding.BindingAdapter
import androidx.preference.PreferenceManager
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.forcetower.uefs.GlideApp
import com.forcetower.uefs.R
import com.forcetower.uefs.core.model.unes.Semester
import java.text.SimpleDateFormat
Expand All @@ -42,7 +42,7 @@ import kotlin.math.min
fun profileImage(iv: ImageView, url: String?) {
if (url == null) return

GlideApp.with(iv.context)
Glide.with(iv.context)
.load(url)
.fallback(R.mipmap.ic_unes_large_image_512)
.placeholder(R.mipmap.ic_unes_large_image_512)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.content.ContextCompat
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.canhub.cropper.CropImageContract
import com.canhub.cropper.CropImageContractOptions
import com.canhub.cropper.CropImageOptions
import com.canhub.cropper.CropImageView
import com.forcetower.core.utils.ColorUtils
import com.forcetower.uefs.GlideApp
import com.forcetower.uefs.R
import com.forcetower.uefs.core.model.unes.Course
import com.forcetower.uefs.core.storage.repository.SyncFrequencyRepository
Expand Down Expand Up @@ -142,7 +142,7 @@ class IntroductionFragment : UFragment() {

private fun onImagePicked(uri: Uri) {
viewModel.setSelectedImage(uri)
GlideApp.with(requireContext())
Glide.with(requireContext())
.load(uri)
.fallback(R.mipmap.ic_unes_large_image_512)
.placeholder(R.mipmap.ic_unes_large_image_512)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
import androidx.preference.PreferenceManager
import com.forcetower.uefs.GlideApp
import com.bumptech.glide.Glide
import com.forcetower.uefs.R
import com.forcetower.uefs.core.constants.Constants
import com.forcetower.uefs.core.model.bigtray.BigTrayData
Expand Down Expand Up @@ -416,7 +416,7 @@ object NotificationCreator {

private fun createBigImage(context: Context, image: String): NotificationCompat.Style? {
return try {
val bitmap = GlideApp.with(context).asBitmap().load(image).submit().get()
val bitmap = Glide.with(context).asBitmap().load(image).submit().get()
NotificationCompat.BigPictureStyle().bigPicture(bitmap)
} catch (t: Throwable) {
Timber.d("Error happened at image load: ${t.message}")
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.dynamic.feature) apply false
alias(libs.plugins.androidx.room) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.kotlin.parcelize) apply false
Expand All @@ -34,6 +35,7 @@ plugins {
alias(libs.plugins.firebase.crashlytics.gradle) apply false
alias(libs.plugins.hilt.android.gradle) apply false
alias(libs.plugins.aboutlibraries) apply false
alias(libs.plugins.google.ksp) apply false
}

buildscript {
Expand Down
5 changes: 3 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlinter.gradle)
alias(libs.plugins.google.ksp)
}

android {
Expand Down Expand Up @@ -77,13 +78,13 @@ dependencies {
api(libs.androidx.room.paging)
api(libs.androidx.room.ktx)
api(libs.glide)
kapt(libs.glide.compiler)
ksp(libs.glide.compiler)
api(libs.android.image.cropper)
api(libs.okhttp)
api(libs.logging.interceptor)
api(libs.retrofit)
api(libs.converter.gson)
api(libs.persistentcookiejar)
api(libs.dagger)
kapt(libs.dagger.compiler)
ksp(libs.dagger.compiler)
}
23 changes: 10 additions & 13 deletions dynamic-features/aeri/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,15 @@ plugins {
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlinter.gradle)
alias(libs.plugins.hilt.android.gradle)
alias(libs.plugins.androidx.room)
alias(libs.plugins.google.ksp)
}

android {
compileSdk = 34

defaultConfig {
minSdk = 21

javaCompileOptions {
annotationProcessorOptions {
arguments += mapOf(
"room.schemaLocation" to "$projectDir/schemas",
"room.incremental" to "true"
)
}
}
}

kapt {
Expand All @@ -61,6 +54,10 @@ android {
namespace = "com.forcetower.uefs.aeri"
}

room {
schemaDirectory("$projectDir/schemas")
}

dependencies {
implementation(project(":app"))
implementation(project(":core"))
Expand All @@ -77,13 +74,13 @@ dependencies {
implementation(libs.flexbox)
implementation(libs.androidx.fragment.ktx)
implementation(libs.listenablefuture)
kapt(libs.androidx.room.compiler)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.paging.runtime.ktx)
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
kapt(libs.androidx.hilt.compiler)
ksp(libs.hilt.compiler)
ksp(libs.androidx.hilt.compiler)
implementation(libs.timber)
implementation(libs.glide)
kapt(libs.glide.compiler)
ksp(libs.glide.compiler)
implementation(libs.feature.delivery.ktx)
}
20 changes: 8 additions & 12 deletions dynamic-features/conference/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,15 @@ plugins {
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlinter.gradle)
alias(libs.plugins.hilt.android.gradle)
alias(libs.plugins.androidx.room)
alias(libs.plugins.google.ksp)
}

android {
compileSdk = 34

defaultConfig {
minSdk = 21

javaCompileOptions {
annotationProcessorOptions {
arguments += mapOf(
"room.schemaLocation" to "$projectDir/schemas",
"room.incremental" to "true"
)
}
}
}

kapt {
Expand All @@ -66,7 +59,10 @@ android {
disable += setOf("Instantiatable")
}
namespace = "dev.forcetower.conference"
}

room {
schemaDirectory("$projectDir/schemas")
}

dependencies {
Expand All @@ -83,10 +79,10 @@ dependencies {
implementation(libs.androidx.fragment.ktx)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
kapt(libs.androidx.room.compiler)
ksp(libs.androidx.room.compiler)
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
kapt(libs.androidx.hilt.compiler)
ksp(libs.hilt.compiler)
ksp(libs.androidx.hilt.compiler)
implementation(libs.timber)

}
9 changes: 5 additions & 4 deletions dynamic-features/dashboard/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ plugins {
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlinter.gradle)
alias(libs.plugins.hilt.android.gradle)
alias(libs.plugins.google.ksp)
}

android {
Expand Down Expand Up @@ -63,14 +64,14 @@ dependencies {
implementation(libs.material)
implementation(libs.androidx.fragment.ktx)
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
kapt(libs.androidx.hilt.compiler)
ksp(libs.hilt.compiler)
ksp(libs.androidx.hilt.compiler)
implementation(libs.timber)
implementation(libs.androidx.room.runtime)
kapt(libs.androidx.room.compiler)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.lifecycle.common.java8)
implementation(libs.glide)
kapt(libs.glide.compiler)
ksp(libs.glide.compiler)
implementation(libs.feature.delivery.ktx)
implementation(libs.app.update.ktx)
}
5 changes: 3 additions & 2 deletions dynamic-features/disciplines/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ plugins {
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlinter.gradle)
alias(libs.plugins.hilt.android.gradle)
alias(libs.plugins.google.ksp)
}

android {
Expand Down Expand Up @@ -69,8 +70,8 @@ dependencies {
implementation(libs.androidx.constraintlayout)
implementation(libs.material)
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
kapt(libs.androidx.hilt.compiler)
ksp(libs.hilt.compiler)
ksp(libs.androidx.hilt.compiler)
implementation(libs.timber)
implementation(libs.feature.delivery.ktx)
testImplementation(libs.junit)
Expand Down
Loading

0 comments on commit 7666197

Please sign in to comment.