Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump sdk, java, AGP, gradle and libs versions #203

Merged
merged 3 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
steps:
- uses: actions/[email protected]

- name: set up JDK 11
- name: set up JDK 17
uses: actions/[email protected]
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: Setup Gradle
Expand Down
13 changes: 6 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ android {
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
buildFeatures {
compose = true
}
Expand All @@ -101,6 +94,12 @@ android {
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation(project(":core:analytics"))
implementation(project(":domain:app:data"))
Expand Down
2 changes: 2 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
-keep public class br.alexandregpereira.hunter.data.** {
public protected *;
}

-dontwarn org.slf4j.impl.StaticLoggerBinder
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
extra.apply {
set("compileSdk", 33)
set("compileSdk", 34)
set("minSdk", 24)
set("targetSdk", 33)
set("targetSdk", 34)
}
repositories {
google()
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

plugins {
kotlin("jvm") version "1.8.20"
kotlin("jvm") version "1.9.10"
}

repositories {
Expand All @@ -26,6 +26,6 @@ repositories {

dependencies {
implementation(kotlin("gradle-plugin"))
implementation("com.android.tools.build:gradle:7.4.2")
implementation("com.android.tools.build:gradle:8.1.1")
implementation(kotlin("compiler-embeddable"))
}
11 changes: 11 additions & 0 deletions buildSrc/src/main/kotlin/TargetConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@

import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework

private val Project.kotlin: KotlinMultiplatformExtension
get() = extensions.getByType(KotlinMultiplatformExtension::class.java)

private val Project.java: JavaPluginExtension
get() = extensions.getByType(JavaPluginExtension::class.java)

fun Project.isMac(): Boolean = Os.isFamily(Os.FAMILY_MAC) && !hasProperty("disableIos")

fun Project.configureJvmTargets(
Expand Down Expand Up @@ -86,4 +91,10 @@ fun Project.configureTargets(
}
}
}

java.apply {
toolchain.apply {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
}
12 changes: 6 additions & 6 deletions feature/folder-detail/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ android {
minSdkVersion project.findProperty('minSdk')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand All @@ -30,6 +24,12 @@ android {
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation project(':feature:folder-detail:state-holder')
implementation project(':ui:core')
Expand Down
12 changes: 6 additions & 6 deletions feature/folder-insert/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ android {
minSdkVersion project.findProperty('minSdk')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand All @@ -30,6 +24,12 @@ android {
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation project(':feature:folder-insert:state-holder')
implementation project(':ui:core')
Expand Down
12 changes: 6 additions & 6 deletions feature/folder-list/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ android {
minSdkVersion project.findProperty('minSdk')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand All @@ -30,6 +24,12 @@ android {
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation project(':feature:folder-list:state-holder')
implementation project(':ui:core')
Expand Down
12 changes: 6 additions & 6 deletions feature/folder-preview/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ android {
minSdkVersion project.findProperty('minSdk')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand All @@ -30,6 +24,12 @@ android {
namespace 'br.alexandregpereira.hunter.folder.preview'
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation project(':feature:folder-preview:state-holder')
implementation project(':ui:core')
Expand Down
6 changes: 3 additions & 3 deletions feature/monster-compendium/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
jvmTarget = JavaVersion.VERSION_17
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand Down
12 changes: 6 additions & 6 deletions feature/monster-content-manager/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ android {
minSdkVersion project.findProperty('minSdk')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand All @@ -30,6 +24,12 @@ android {
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation project(':feature:monster-content-manager:state-holder')
implementation project(':ui:core')
Expand Down
12 changes: 6 additions & 6 deletions feature/monster-detail/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ android {
minSdkVersion project.findProperty('minSdk')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand All @@ -30,6 +24,12 @@ android {
namespace 'br.alexandregpereira.hunter.detail'
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation project(':domain:monster:core')
implementation project(':domain:monster-lore:core')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ fun MonsterDetailScreen(
initialMonsterIndex: Int,
contentPadding: PaddingValues = PaddingValues(0.dp),
pagerState: PagerState = rememberPagerState(
initialPage = initialMonsterIndex
initialPage = initialMonsterIndex,
pageCount = { monsters.size }
),
scrollState: LazyListState = rememberLazyListState(),
onMonsterChanged: (monster: MonsterState) -> Unit = {},
Expand Down Expand Up @@ -489,7 +490,9 @@ private fun MonsterTopBarPreview() = Window {
reactions = listOf()
)
),
pagerState = rememberPagerState(),
pagerState = rememberPagerState(
pageCount = { 1 }
),
firstVisibleItemIndex = { 0 },
onOptionsClicked = {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ fun MonsterImages(
shape: Shape,
contentPadding: PaddingValues = PaddingValues(0.dp)
) = HorizontalPager(
pageCount = images.size,
state = pagerState
) { pagePosition ->
val image = images[pagePosition]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ import androidx.compose.foundation.pager.rememberPagerState
fun MonsterTitleCompose(
monsterTitleStates: List<MonsterTitleState>,
modifier: Modifier = Modifier,
pagerState: PagerState = rememberPagerState(),
pagerState: PagerState = rememberPagerState(
pageCount = { monsterTitleStates.size }
),
contentPadding: PaddingValues = PaddingValues(16.dp),
titleFontSize: MonsterTitleFontSize = MonsterTitleFontSize.LARGE,
onOptionsClicked: () -> Unit = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ internal const val SPELLCASTING_ITEM_KEY = "spellcasting"
@Preview
@Composable
private fun SpellBlockPreview() = Window {
val pagerState = rememberPagerState()
val spellcastings = listOf(
SpellcastingState(
type = SpellcastingTypeState.SPELLCASTER,
Expand Down Expand Up @@ -203,6 +202,10 @@ private fun SpellBlockPreview() = Window {
)
)

val pagerState = rememberPagerState(
pageCount = { spellcastings.size }
)

LazyColumn {
spellBlock(
monsters = listOf(
Expand Down
12 changes: 6 additions & 6 deletions feature/monster-lore-detail/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ android {
minSdkVersion project.findProperty('minSdk')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand All @@ -30,6 +24,12 @@ android {
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation project(':feature:monster-lore-detail:state-holder')
implementation project(':ui:core')
Expand Down
12 changes: 6 additions & 6 deletions feature/search/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ android {
minSdkVersion project.findProperty('minSdk')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}

Expand All @@ -30,6 +24,12 @@ android {
namespace 'br.alexandregpereira.hunter.search'
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

dependencies {
implementation project(':core:analytics')
implementation project(':domain:monster:core')
Expand Down
Loading
Loading