From 1d60f0002f28a0e95e6af36a2a6d5f1b8f01438e Mon Sep 17 00:00:00 2001 From: draganbjedov Date: Wed, 15 Jun 2022 21:22:49 +0200 Subject: [PATCH] Updated compose version and fixed build (#7) - Updated compose version to 1.2.0-beta03 - Updated gradle plugin to 1.6.21 needed to build properly - Updated Gradle - Updated dependencies versions to latest ones Co-authored-by: Dragan Bjedov --- ComposePrefs/build.gradle | 14 +++++++------- README.md | 12 ++++++++---- app/build.gradle | 14 +++++++------- .../com/jamal/composeprefssample/MainActivity.kt | 1 - build.gradle | 6 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 1 - 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/ComposePrefs/build.gradle b/ComposePrefs/build.gradle index 078b8dd..69a34e6 100644 --- a/ComposePrefs/build.gradle +++ b/ComposePrefs/build.gradle @@ -5,13 +5,13 @@ plugins { } android { - compileSdk 31 + compileSdk 32 defaultConfig { minSdk 21 - targetSdk 31 + targetSdk 32 versionCode 2 - versionName "1.0.4" + versionName "1.0.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -35,13 +35,13 @@ android { compose true } composeOptions { - kotlinCompilerExtensionVersion "1.2.0-alpha01" + kotlinCompilerExtensionVersion "1.2.0-beta03" } } dependencies { - implementation "androidx.compose.ui:ui:1.2.0-beta02" - implementation "androidx.compose.material:material:1.2.0-beta02" + implementation "androidx.compose.ui:ui:1.2.0-beta03" + implementation "androidx.compose.material:material:1.2.0-beta03" implementation "androidx.datastore:datastore-preferences:1.0.0" } @@ -54,7 +54,7 @@ afterEvaluate { groupId = 'com.github.jamalmulla' artifactId = 'ComposePrefs' - version = '1.0.4' + version = '1.0.5' } } } diff --git a/README.md b/README.md index cfa115f..8b4e8aa 100644 --- a/README.md +++ b/README.md @@ -209,17 +209,21 @@ individual parameters of each preference composable to achieve the functionality something is missing, please create an Issue so we can discuss possible solutions. # Download - -In your `settings.gradle` file add the following +Add `jitpack.io` repository to your root `build.gradle` at the end of repositories: ``` groovy -maven { url "https://jitpack.io" } +allprojects { + repositories { + ... + maven { url 'https://jitpack.io' } + } +} ``` and in your module `build.gradle` file add the dependencies ``` groovy -implementation "com.github.JamalMulla:ComposePrefs:" // Current is 1.0.4 +implementation "com.github.JamalMulla:ComposePrefs:" // Current is 1.0.5 implementation "androidx.datastore:datastore-preferences:1.0.0" ``` diff --git a/app/build.gradle b/app/build.gradle index 06d13a1..a6b7b05 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,12 +4,12 @@ plugins { } android { - compileSdk 31 + compileSdk 32 defaultConfig { applicationId "com.jamal.composeprefssample" minSdk 23 - targetSdk 31 + targetSdk 32 versionCode 1 versionName "1.0" @@ -38,7 +38,6 @@ android { } composeOptions { kotlinCompilerExtensionVersion compose_version - kotlinCompilerVersion '1.5.21' } packagingOptions { resources { @@ -49,15 +48,16 @@ android { dependencies { - implementation 'androidx.core:core-ktx:1.7.0' - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.google.android.material:material:1.6.0' + implementation 'androidx.core:core-ktx:1.8.0' + implementation 'androidx.appcompat:appcompat:1.4.2' + implementation 'com.google.android.material:material:1.6.1' implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1' implementation 'androidx.activity:activity-compose:1.4.0' - testImplementation 'junit:junit:4.+' + + testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" diff --git a/app/src/main/java/com/jamal/composeprefssample/MainActivity.kt b/app/src/main/java/com/jamal/composeprefssample/MainActivity.kt index 4257291..6ecba70 100644 --- a/app/src/main/java/com/jamal/composeprefssample/MainActivity.kt +++ b/app/src/main/java/com/jamal/composeprefssample/MainActivity.kt @@ -20,7 +20,6 @@ val Context.dataStore: DataStore by preferencesDataStore(name = "se @ExperimentalComposeUiApi @ExperimentalMaterialApi -@OptIn(ExperimentalComposeUiApi::class, ExperimentalMaterialApi::class) class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/build.gradle b/build.gradle index f3c3fff..feea364 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,15 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { - compose_version = '1.2.0-beta02' + compose_version = '1.2.0-beta03' } repositories { google() mavenCentral() } dependencies { - classpath "com.android.tools.build:gradle:7.0.4" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" + classpath 'com.android.tools.build:gradle:7.2.1' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 24fc8b3..219ac01 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Dec 26 19:18:50 GMT 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index 2615f11..0e587e1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,7 +3,6 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - jcenter() // Warning: this repository is going to shut down soon } } rootProject.name = "ComposePrefs Sample"