Skip to content

Commit

Permalink
Remove coreLibraryDesugaring dependency in the core and data modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
kizitonwose committed May 26, 2024
1 parent 14991af commit 8de97d6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
package com.kizitonwose.calendar.buildsrc

import org.gradle.api.JavaVersion
import org.gradle.jvm.toolchain.JavaLanguageVersion

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

object Android {
Expand Down
27 changes: 9 additions & 18 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
import com.kizitonwose.calendar.buildsrc.Android
import com.kizitonwose.calendar.buildsrc.Config
import com.kizitonwose.calendar.buildsrc.Libs

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin'
apply plugin: 'com.vanniktech.maven.publish'

android {
compileSdk Android.compileSdk
namespace 'com.kizitonwose.calendar.core'
defaultConfig {
minSdkVersion Android.minSdkLibraryCore
targetSdkVersion Android.targetSdk
multiDexEnabled true // Needed for desugar because minSdk < 21
java {
toolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility = Config.compatibleJavaVersion
targetCompatibility = Config.compatibleJavaVersion
}
kotlinOptions {
jvmTarget = Config.compatibleJavaVersion
}

kotlin {
jvmToolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
}

dependencies {
coreLibraryDesugaring Libs.Core.deSugar
implementation Libs.Compose.runtime // Only needed for @Immutable annotation.
}
27 changes: 9 additions & 18 deletions data/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
import com.kizitonwose.calendar.buildsrc.Android
import com.kizitonwose.calendar.buildsrc.Config
import com.kizitonwose.calendar.buildsrc.Kotlin
import com.kizitonwose.calendar.buildsrc.Libs

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin'
apply plugin: 'com.vanniktech.maven.publish'

android {
compileSdk Android.compileSdk
namespace 'com.kizitonwose.calendar.data'
defaultConfig {
minSdkVersion Android.minSdkLibraryCore
targetSdkVersion Android.targetSdk
multiDexEnabled true // Needed for desugar because minSdk < 21
java {
toolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility = Config.compatibleJavaVersion
targetCompatibility = Config.compatibleJavaVersion
}
kotlinOptions {
jvmTarget = Config.compatibleJavaVersion
}

kotlin {
jvmToolchain {
languageVersion = Config.compatibleJavaLanguageVersion
}
}

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

testImplementation Libs.Core.Test.junit
Expand Down

0 comments on commit 8de97d6

Please sign in to comment.