Skip to content

Commit

Permalink
Bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisFn committed Oct 27, 2024
1 parent 772c90c commit e6d75eb
Show file tree
Hide file tree
Showing 30 changed files with 149 additions and 142 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
- name: Checkout repositoryy
uses: actions/checkout@v4

- name: Setup java 17
- name: Setup java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- name: Setup gradle
uses: ./.github/workflows/gradle-cache
Expand All @@ -47,11 +47,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup java 17
- name: Setup java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- name: Setup gradle
uses: ./.github/workflows/gradle-cache
Expand All @@ -78,11 +78,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup java 17
- name: Setup java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- name: Setup gradle
uses: ./.github/workflows/gradle-cache
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup java 17
- name: Setup java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- name: Setup gradle
uses: ./.github/workflows/gradle-cache
Expand Down Expand Up @@ -61,11 +61,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup java 17
- name: Setup java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- name: Setup gradle
uses: ./.github/workflows/gradle-cache
Expand Down Expand Up @@ -127,11 +127,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup java 17
- name: Setup java 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- name: Setup gradle
uses: ./.github/workflows/gradle-cache
Expand Down
1 change: 1 addition & 0 deletions build-logic/src/main/kotlin/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ object Plugins {
const val KSP = "com.google.devtools.ksp"
const val HILT = "dagger.hilt.android.plugin"
const val JACOCO = "org.gradle.jacoco"
const val COMPOSE_COMPILER = "org.jetbrains.kotlin.plugin.compose"

const val SOMOVIE_ANDROID_APPLICATION = "somovie.android.application"
const val SOMOVIE_ANDROID_LIBRARY = "somovie.android.library"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import plugin.util.configureAndroid
import plugin.util.configureKotlinOptions
import java.util.Properties

@Suppress("UnstableApiUsage")
class AndroidApplicationPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
Expand Down
11 changes: 6 additions & 5 deletions build-logic/src/main/kotlin/plugin/AndroidComposePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package plugin

import Plugins
import debugImplementation
import getLibsVersionCatalog
import implementation
Expand All @@ -13,18 +14,18 @@ import plugin.util.getCommonExtension
class AndroidComposePlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply(Plugins.JACOCO)
apply(Plugins.COMPOSE_COMPILER)
}

val libs = getLibsVersionCatalog()
val commonExtension = getCommonExtension()

commonExtension.apply {
buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion =
libs.findVersion("androidxComposeCompiler").get().toString()
}
}

dependencies {
Expand Down
1 change: 0 additions & 1 deletion build-logic/src/main/kotlin/plugin/AndroidFeaturePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class AndroidFeaturePlugin : Plugin<Project> {
implementation(project(":ui:common"))
implementation(project(":ui:component"))
implementation(project(":ui:theme"))
implementation(libs.findLibrary("accompanist.navigationAnimation").get())
implementation(libs.findLibrary("androidx.constraintlayout.compose").get())
implementation(libs.findLibrary("androidx.lifecycle.runtime").get())
implementation(libs.findLibrary("androidx.lifecycle.viewmodel").get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import com.android.build.api.variant.ApplicationAndroidComponentsExtension
import getLibsVersionCatalog
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.configurationcache.extensions.capitalized
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.getByType
import org.gradle.testing.jacoco.plugins.JacocoPluginExtension
import org.gradle.testing.jacoco.tasks.JacocoReport
import plugin.util.capitalized
import plugin.util.configureJacoco

class JacocoMergeAllReportsPlugin : Plugin<Project> {
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/plugin/JacocoPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package plugin
import Plugins
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.configurationcache.extensions.capitalized
import org.gradle.kotlin.dsl.register
import org.gradle.testing.jacoco.tasks.JacocoReport
import plugin.util.capitalized
import plugin.util.configureJacoco
import plugin.util.getAndroidComponentsExtension

Expand Down
6 changes: 3 additions & 3 deletions build-logic/src/main/kotlin/plugin/util/Android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies

internal fun Project.configureAndroid(
commonExtension: CommonExtension<*, *, *, *, *>,
commonExtension: CommonExtension<*, *, *, *, *, *>,
) {
commonExtension.apply {
compileSdk = AppConfig.COMPILE_SDK_VERSION
Expand All @@ -24,8 +24,8 @@ internal fun Project.configureAndroid(
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

buildTypes {
Expand Down
6 changes: 4 additions & 2 deletions build-logic/src/main/kotlin/plugin/util/Extension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ import com.android.build.gradle.LibraryExtension
import org.gradle.api.Project
import org.gradle.kotlin.dsl.findByType

internal fun Project.getCommonExtension(): CommonExtension<*, *, *, *, *> =
internal fun Project.getCommonExtension(): CommonExtension<*, *, *, *, *, *> =
(
extensions.findByType<LibraryExtension>()
?: extensions.findByType<ApplicationExtension>()
) as CommonExtension<*, *, *, *, *>
) as CommonExtension<*, *, *, *, *, *>

internal fun Project.getAndroidComponentsExtension(): AndroidComponentsExtension<*, *, *> =
(
extensions.findByType<LibraryAndroidComponentsExtension>()
?: extensions.findByType<ApplicationAndroidComponentsExtension>()
) as AndroidComponentsExtension<*, *, *>

internal fun String.capitalized() = this.replaceFirstChar { it.uppercase() }
7 changes: 3 additions & 4 deletions build-logic/src/main/kotlin/plugin/util/Jacoco.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package plugin.util

import org.gradle.api.Project
import org.gradle.configurationcache.extensions.capitalized
import org.gradle.testing.jacoco.tasks.JacocoReport

internal fun JacocoReport.configureJacoco(project: Project, variantName: String) {
Expand All @@ -14,12 +13,12 @@ internal fun JacocoReport.configureJacoco(project: Project, variantName: String)

val javaClasses = projects
.map { proj ->
project.fileTree("${proj.buildDir}/intermediates/javac/$variantName/classes/com")
project.fileTree("${proj.layout.buildDirectory.asFile}/intermediates/javac/$variantName/classes/com")
}
.onEach { it.exclude(coverageExclusions) }
val kotlinClasses = projects
.map { proj ->
project.fileTree("${proj.buildDir}/tmp/kotlin-classes/$variantName")
project.fileTree("${proj.layout.buildDirectory.asFile}/tmp/kotlin-classes/$variantName")
}
.onEach { it.exclude(coverageExclusions) }

Expand All @@ -36,7 +35,7 @@ internal fun JacocoReport.configureJacoco(project: Project, variantName: String)

val executions = projects
.map { proj ->
proj.fileTree(proj.buildDir).apply {
proj.fileTree(proj.layout.buildDirectory.asFile).apply {
include(
"/outputs/code_coverage/${variantName}AndroidTest/connected/**/coverage.ec",
"/outputs/unit_test_code_coverage/${variantName}UnitTest/test${variantName.capitalized()}UnitTest.exec",
Expand Down
44 changes: 25 additions & 19 deletions build-logic/src/main/kotlin/plugin/util/KotlinOptions.kt
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
package plugin.util

import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

internal fun Project.configureKotlinOptions() {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)

freeCompilerArgs.add(
"-opt-in=" +
"kotlin.Experimental," +
"kotlinx.coroutines.ExperimentalCoroutinesApi," +
"kotlinx.coroutines.FlowPreview," +
"androidx.paging.ExperimentalPagingApi," +
"androidx.compose.foundation.layout.ExperimentalLayoutApi," +
"androidx.compose.material.ExperimentalMaterialApi",
)

freeCompilerArgs =
freeCompilerArgs + (
"-opt-in=" +
"kotlin.Experimental," +
"kotlinx.coroutines.ExperimentalCoroutinesApi," +
"kotlinx.coroutines.FlowPreview," +
"androidx.paging.ExperimentalPagingApi"
)
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs = freeCompilerArgs + listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.buildDir.absolutePath + "/compose_compiler",
freeCompilerArgs.addAll(
listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.layout.buildDirectory.asFile.get().absolutePath + "/compose_compiler",
),
)
}
if (project.findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs = freeCompilerArgs + listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.buildDir.absolutePath + "/compose_compiler",
freeCompilerArgs.addAll(
listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.layout.buildDirectory.asFile.get().absolutePath + "/compose_compiler",
),
)
}
}
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.ksp) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.spotless)
alias(libs.plugins.detekt)
alias(libs.plugins.gradleversions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ package com.louisfn.somovie.feature.home.container

import androidx.annotation.StringRes
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.List
import androidx.compose.material.icons.automirrored.filled.List
import androidx.compose.material.icons.filled.Movie
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.filled.Swipe
import androidx.compose.ui.graphics.vector.ImageVector
import com.louisfn.somovie.feature.home.account.AccountNavigation
import com.louisfn.somovie.feature.home.container.HomeBottomSheetItem.*
import com.louisfn.somovie.feature.home.container.HomeBottomSheetItem.Account
import com.louisfn.somovie.feature.home.container.HomeBottomSheetItem.Discover
import com.louisfn.somovie.feature.home.container.HomeBottomSheetItem.Explore
import com.louisfn.somovie.feature.home.container.HomeBottomSheetItem.WatchList
import com.louisfn.somovie.feature.home.discover.DiscoverNavigation
import com.louisfn.somovie.feature.home.explore.ExploreNavigation
import com.louisfn.somovie.feature.home.watchlist.WatchlistDestination
Expand All @@ -21,7 +24,7 @@ sealed class HomeBottomSheetItem(
val icon: ImageVector,
) {
object Explore : HomeBottomSheetItem(ExploreNavigation, R.string.home_explore, Icons.Default.Movie)
object WatchList : HomeBottomSheetItem(WatchlistDestination, R.string.home_watchlist, Icons.Default.List)
object WatchList : HomeBottomSheetItem(WatchlistDestination, R.string.home_watchlist, Icons.AutoMirrored.Filled.List)
object Discover : HomeBottomSheetItem(DiscoverNavigation, R.string.home_discover, Icons.Default.Swipe)
object Account : HomeBottomSheetItem(AccountNavigation, R.string.home_account, Icons.Default.Settings)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.louisfn.somovie.feature.home.container

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.navigation.NavGraphBuilder
import com.google.accompanist.navigation.animation.composable
import androidx.navigation.compose.composable
import com.louisfn.somovie.domain.model.ExploreCategory
import com.louisfn.somovie.domain.model.Movie
import com.louisfn.somovie.ui.common.navigation.NavigationDestination
Expand All @@ -11,7 +10,6 @@ object HomeDestination : NavigationDestination {
override val route: String = "home"
}

@OptIn(ExperimentalAnimationApi::class)
fun NavGraphBuilder.homeGraph(
showDetails: (Movie) -> Unit,
showMore: (ExploreCategory) -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBars
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.FractionalThreshold
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.icons.Icons
Expand Down Expand Up @@ -126,7 +124,6 @@ private fun BoxScope.DiscoverContent(
}
}

@OptIn(ExperimentalMaterialApi::class)
@Composable
private fun BoxScope.DiscoverSwipeContainer(
items: ImmutableList<MovieItem>,
Expand All @@ -138,7 +135,7 @@ private fun BoxScope.DiscoverSwipeContainer(
SwipeContainer(
items = ImmutableList(items.take(MaxMovieItemToPreload)),
itemKey = MovieItem::id,
thresholdConfig = FractionalThreshold(SwipeFractionalThreshold),
fractionalThreshold = SwipeFractionalThreshold,
onDragging = { _, direction, ratio ->
draggingState = DraggingState(direction, ratio)
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:OptIn(ExperimentalMaterialApi::class)

package com.louisfn.somovie.feature.home.watchlist

import android.content.res.Resources
Expand Down Expand Up @@ -28,7 +26,6 @@ import androidx.compose.material.DismissDirection
import androidx.compose.material.DismissState
import androidx.compose.material.DismissValue
import androidx.compose.material.Divider
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Scaffold
Expand Down Expand Up @@ -208,7 +205,7 @@ private fun LogInContent(logInManager: LogInManager, modifier: Modifier = Modifi
.align(Alignment.TopCenter)
.padding(16.dp),
)
Button(modifier = Modifier.align(Alignment.Center))
Button(Modifier.align(Alignment.Center))
}
},
)
Expand Down
Loading

0 comments on commit e6d75eb

Please sign in to comment.