Skip to content

Commit

Permalink
Remove desugar from view and compose module
Browse files Browse the repository at this point in the history
  • Loading branch information
kizitonwose committed May 26, 2024
1 parent ba6e8fd commit 2667299
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ package com.kizitonwose.calendar.buildsrc

import org.gradle.api.JavaVersion
import org.gradle.jvm.toolchain.JavaLanguageVersion
import kotlin.math.max

object Config {
val compatibleJavaVersion = JavaVersion.VERSION_17
val compatibleJavaLanguageVersion = JavaLanguageVersion.of(compatibleJavaVersion.majorVersion.toInt())
}

object Android {
const val minSdkLibraryCore = 4
const val minSdkLibraryView = 15
const val minSdkLibraryCompose = 21
const val minSdkSample = 21
val minSdkSample = max(minSdkLibraryView, minSdkLibraryCompose)
const val targetSdk = 33
const val compileSdk = 34

Expand Down
15 changes: 8 additions & 7 deletions compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ android {
minSdkVersion Android.minSdkLibraryCompose
targetSdkVersion Android.targetSdk
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility = Config.compatibleJavaVersion
targetCompatibility = Config.compatibleJavaVersion
java {
toolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
}
kotlinOptions {
jvmTarget = Config.compatibleJavaVersion
kotlin {
jvmToolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
}
buildFeatures {
compose true
Expand All @@ -33,7 +35,6 @@ android {
dependencies {
api project(':core')
implementation project(':data')
coreLibraryDesugaring Libs.Core.deSugar
implementation Kotlin.stdLib

implementation Libs.Compose.ui
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("NewApi")
package com.kizitonwose.calendar.data

import java.time.DayOfWeek
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("NewApi")
package com.kizitonwose.calendar.data

import com.kizitonwose.calendar.core.CalendarDay
Expand Down
1 change: 1 addition & 0 deletions data/src/main/java/com/kizitonwose/calendar/data/Utils.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("NewApi")
package com.kizitonwose.calendar.data

import java.time.LocalDate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("NewApi")
package com.kizitonwose.calendar.data

import com.kizitonwose.calendar.core.Week
Expand Down
15 changes: 10 additions & 5 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ android {
minifyEnabled false
}
}
java {
toolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
}
kotlin {
jvmToolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility = Config.compatibleJavaVersion
targetCompatibility = Config.compatibleJavaVersion
}
kotlinOptions {
jvmTarget = Config.compatibleJavaVersion
}
composeOptions {
kotlinCompilerExtensionVersion Android.composeCompiler
Expand Down
16 changes: 8 additions & 8 deletions view/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ android {
defaultConfig {
minSdkVersion Android.minSdkLibraryView
targetSdkVersion Android.targetSdk
multiDexEnabled true // Needed for desugar because minSdk < 21
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility = Config.compatibleJavaVersion
targetCompatibility = Config.compatibleJavaVersion
java {
toolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
}
kotlinOptions {
jvmTarget = Config.compatibleJavaVersion
kotlin {
jvmToolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
}
}

dependencies {
api project(':core')
implementation project(':data')
coreLibraryDesugaring Libs.Core.deSugar
implementation Kotlin.stdLib
implementation Libs.View.coreKtx

Expand Down

0 comments on commit 2667299

Please sign in to comment.