diff --git a/.editorconfig b/.editorconfig index ab8d30e..191aa52 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,11 +1,14 @@ root = true [*.{kt,kts}] -disabled_rules = filename -max_line_length = off -insert_final_newline = true -ij_kotlin_name_count_to_use_star_import = 999 -ij_kotlin_name_count_to_use_star_import_for_members = 999 ij_java_class_count_to_use_import_on_demand = 999 ij_kotlin_allow_trailing_comma = true ij_kotlin_allow_trailing_comma_on_call_site = true +ij_kotlin_name_count_to_use_star_import = 999 +ij_kotlin_name_count_to_use_star_import_for_members = 999 +insert_final_newline = true +max_line_length = off + +ktlint_code_style = intellij_idea +ktlint_function_naming_ignore_when_annotated_with = Composable +ktlint_standard_filename = disabled diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 41a3db7..cb47c27 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -5,7 +5,11 @@ on: [ push, workflow_dispatch ] jobs: semantic_library_workflow: name: push - uses: krogerco/Shared-CI-Workflow-Android/.github/workflows/semantic_library_workflow.yml@v1.0.0 + uses: krogerco/Shared-CI-Workflow-Android/.github/workflows/semantic_library_workflow.yml@v1.5.0 + with: + java_version: '17' + ktlint_version: '-1' + test_command: 'test' secrets: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }} diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..dfd6f61 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,23 @@ +name: Deploy Documentation + +on: + # Run any time code is pushed to main. + push: + branches: + - main + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +jobs: + deploy-docs: + name: Publish Documentation + uses: krogerco/Shared-CI-Workflow-Android/.github/workflows/pages.yml@v1.3.0 + with: + java_version: '17' diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh deleted file mode 100644 index 6809ccc..0000000 --- a/.husky/_/husky.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -if [ -z "$husky_skip_init" ]; then - debug () { - if [ "$HUSKY_DEBUG" = "1" ]; then - echo "husky (debug) - $1" - fi - } - - readonly hook_name="$(basename "$0")" - debug "starting $hook_name..." - - if [ "$HUSKY" = "0" ]; then - debug "HUSKY env variable is set to 0, skipping hook" - exit 0 - fi - - if [ -f ~/.huskyrc ]; then - debug "sourcing ~/.huskyrc" - . ~/.huskyrc - fi - - export readonly husky_skip_init=1 - sh -e "$0" "$@" - exitCode="$?" - - if [ $exitCode != 0 ]; then - echo "husky - $hook_name hook exited with code $exitCode (error)" - fi - - exit $exitCode -fi diff --git a/.husky/commit-msg b/.husky/commit-msg index 617efbd..813b76e 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx --no-install commitlint --edit +npx --no-install commitlint --edit diff --git a/.husky/pre-commit b/.husky/pre-commit index 89d73a2..866cb6f 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,25 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" +### AUTOGENERATED KGP KOTLINTER HOOK START - DO NOT MODIFY ### +staged_files="$(git --no-pager diff --name-status --no-color --staged | awk '$1 != "D" && $NF ~ /\.kts|\.kt/ { print $NF }')" +if [ -z "$staged_files" ]; then + echo "No Kotlin files are staged." + exit 0 +fi; -ktlint "**/src/**/*.kt" "!**/generated/**" --android --reporter=plain?group_by_file \ No newline at end of file +echo "Running ktlint on the following staged files:" +echo "$staged_files" + +auto_format_files=false +if [ "$auto_format_files" = true ] ; then + echo "auto-formatting staged files..." + ./gradlew formatKotlinFiles -Pfiles="$staged_files" +fi + +if ! ./gradlew checkKotlinFiles -Pfiles="$staged_files"; then + echo "pre-commit hook: Some files are either not properly formatted or could not be auto-formatted. Aborting commit." + exit 1 +else + # Re-index any files that may have been corrected before committing + echo "$staged_files" | xargs git add + exit_code=0 +fi +### AUTOGENERATED KGP KOTLINTER HOOK END ### diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c6ceaf..8d9bf0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,18 +3,15 @@ All notable changes to this project will be documented in this file. `Cache-Android` adheres to [Semantic Versioning](https://semver.org/). -## main - -### Added - -### Breaking Changes - -### Updated - -### Fixed - +## 3.1.0 +- [feat] use kotlin 1.9.23 +- [fix] remove kotlin serialization dependencies from android module +- [build] use convention plugins +- [chore] update sample app dependencies +## 3.0.0 +- [feat!] renamed `CacheSerializer.decodeFromString(...)` to `CacheSerializer.decodeFromByteArray(...)` +- [feat] add moshi serialization implementation module +## 2.0.0 +- [feat!] abstract serialization and add kotlin serialization implementation module ## 1.0.0 - -### Added - - Initial open source release. diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 7393e2b..c2b85ad 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,3 +1,5 @@ +import com.kroger.gradle.config.junitVintage + /** * MIT License * @@ -22,25 +24,27 @@ * SOFTWARE. */ plugins { - `android-library-module` - `release-module` + alias(libs.plugins.conventions.publishedAndroidLibrary) } android { namespace = "com.kroger.cache.android" } +koverReport { + defaults { + mergeWith("debug") + } +} + dependencies { api(project(":cache")) - api(libs.kotlinx.serialization.core) - implementation(libs.kotlinx.serialization.json) implementation(libs.kotlinx.coroutines) + junitVintage() testImplementation(project(":kotlinx")) - testImplementation(libs.jupiter.api) testImplementation(libs.mockk) testImplementation(libs.truth) - testRuntimeOnly(libs.jupiter.engine) androidTestImplementation(libs.androidx.test.ext) androidTestImplementation(libs.androidx.test.rules) diff --git a/build.gradle.kts b/build.gradle.kts index 906e94e..f628b88 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import com.kroger.gradle.config.koverAllProjects + /** * MIT License * @@ -22,12 +24,31 @@ * SOFTWARE. */ plugins { - id("org.jetbrains.dokka") - id("com.google.devtools.ksp") version "1.7.20-1.0.8" apply false + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.junit5) apply false + alias(libs.plugins.conventions.androidApplication) apply false + alias(libs.plugins.conventions.publishedAndroidLibrary) apply false + alias(libs.plugins.conventions.publishedKotlinLibrary) apply false + alias(libs.plugins.conventions.root) + alias(libs.plugins.dependencyAnalysis) apply false + alias(libs.plugins.dokka) + alias(libs.plugins.gradleVersions) apply false + alias(libs.plugins.hilt) apply false + alias(libs.plugins.kapt) apply false + alias(libs.plugins.kotlinter) apply false + alias(libs.plugins.kover) apply true + alias(libs.plugins.ksp) apply false + alias(libs.plugins.mavenPublish) apply false } -tasks { - register("clean", Delete::class) { - delete(rootProject.buildDir) +koverReport { + filters { + excludes { + packages("com.kroger.cache.sampleapp") + } } } + +dependencies { + koverAllProjects(rootProject) +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index e663de0..0000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,13 +0,0 @@ -plugins { - `kotlin-dsl` -} - -dependencies { - implementation("com.android.tools.build:gradle:7.4.2") - implementation("de.mannodermaus.gradle.plugins:android-junit5:1.8.2.1") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20") - implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20") - implementation("org.jetbrains.kotlin:kotlin-serialization:1.7.20") - implementation("com.vanniktech:gradle-maven-publish-plugin:0.25.2") - implementation("com.google.dagger:hilt-android-gradle-plugin:2.43.2") -} diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts deleted file mode 100644 index c7c3c5d..0000000 --- a/buildSrc/settings.gradle.kts +++ /dev/null @@ -1,6 +0,0 @@ -dependencyResolutionManagement { - repositories { - google() - mavenCentral() - } -} diff --git a/buildSrc/src/main/java/SdkVersions.kt b/buildSrc/src/main/java/SdkVersions.kt deleted file mode 100644 index 79808f9..0000000 --- a/buildSrc/src/main/java/SdkVersions.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2023 The Kroger Co. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/** - * Project-specific Version numbers - */ -object SdkVersions { - const val targetSdkVersion = 33 - const val compileSdkVersion = 33 - const val minSdkVersion = 24 -} diff --git a/buildSrc/src/main/java/android-library-module.gradle.kts b/buildSrc/src/main/java/android-library-module.gradle.kts deleted file mode 100644 index efe94fe..0000000 --- a/buildSrc/src/main/java/android-library-module.gradle.kts +++ /dev/null @@ -1,53 +0,0 @@ -plugins { - id("com.android.library") - kotlin("android") - id("jacoco") - id("de.mannodermaus.android-junit5") - id("org.jetbrains.dokka") -} - -android { - compileSdk = SdkVersions.compileSdkVersion - - defaultConfig { - minSdk = (SdkVersions.minSdkVersion) - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = "11" - } - - packagingOptions { - resources.excludes.add("META-INF/AL2.0") - resources.excludes.add("META-INF/LGPL2.1") - } -} - -jacoco { - toolVersion = "0.8.7" -} - -tasks { - withType { - kotlinOptions.jvmTarget = "11" - kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" - kotlinOptions.freeCompilerArgs += "-Xexplicit-api=strict" - } - - withType { - reports { - csv.required.set(false) - html.required.set(false) - } - } - - tasks.withType().configureEach { - useJUnitPlatform() - } -} diff --git a/buildSrc/src/main/java/java-library-module.gradle.kts b/buildSrc/src/main/java/java-library-module.gradle.kts deleted file mode 100644 index e8ca0a5..0000000 --- a/buildSrc/src/main/java/java-library-module.gradle.kts +++ /dev/null @@ -1,16 +0,0 @@ -plugins { - kotlin("jvm") - `java-library` - id("org.jetbrains.dokka") -} - -kotlin { - jvmToolchain(11) - explicitApi() -} - -tasks { - test { - useJUnitPlatform() - } -} diff --git a/buildSrc/src/main/java/release-module.gradle.kts b/buildSrc/src/main/java/release-module.gradle.kts deleted file mode 100644 index 27852ad..0000000 --- a/buildSrc/src/main/java/release-module.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -plugins { - id("com.vanniktech.maven.publish") -} - -val libraryVersion = System.getenv("BUILD_VERSION") ?: "0.0.1" - -mavenPublishing { - version = libraryVersion -} diff --git a/cache/build.gradle.kts b/cache/build.gradle.kts index cb6b5a6..48da38d 100644 --- a/cache/build.gradle.kts +++ b/cache/build.gradle.kts @@ -1,3 +1,5 @@ +import com.kroger.gradle.config.junit5 + /** * MIT License * @@ -22,16 +24,14 @@ * SOFTWARE. */ plugins { - `java-library-module` - `release-module` + alias(libs.plugins.conventions.publishedKotlinLibrary) } dependencies { implementation(libs.kotlinx.coroutines) api(libs.telemetry) - testImplementation(libs.jupiter.api) + junit5() testImplementation(libs.kotlinx.coroutines.test) testImplementation(libs.truth) - testRuntimeOnly(libs.jupiter.engine) } diff --git a/gradle.properties b/gradle.properties index 0ddfa20..e339f10 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,6 +22,9 @@ kotlin.code.style=official # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true +## Kroger Gradle Plugin Properties +kgp.android.autoconfigure.compose=false + ## Publishing Properties SONATYPE_AUTOMATIC_RELEASE=true SONATYPE_HOST=DEFAULT diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d0e7bc4..7fc2eaa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,61 +1,94 @@ [versions] -androidDesugarJdkLibs = "2.0.3" -androidGradlePlugin = "7.4.2" -androidxActivity = "1.5.1" -androidxCompose = "1.2.1" -androidxComposeCompiler = "1.3.2" -androidxCore = "1.8.0" -androidJunit5Plugin = "1.8.2.1" -androidxLifecycle = "2.6.1" -androidxTest = "1.4.0" -androidxTestExt = "1.1.3" +androidGradlePlugin = "8.3.2" +androidxActivity = "1.9.0" +androidxCore = "1.13.0" +androidJunit5Plugin = "1.10.0.0" +androidxLifecycle = "2.7.0" +androidxTestExt = "1.1.5" androidxTestOrchestrator = "1.4.1" +androidxTestRules = "1.5.0" +androidxTestRunner = "1.5.2" androidxTestServices = "1.4.1" -androidxTestUiAutomator = "2.2.0" -googleMaterial = "1.6.1" -hilt = "2.43.2" -junit4 = "4.13.2" -junit5 = "5.9.0" -kotlin = "1.7.20" +androidxTestUiAutomator = "2.3.0" +conventionPlugin = "1.0.0" +dependencyAnalysis = "1.31.0" +googleMaterial = "1.11.0" +gradleMavenPublishPlugin = "0.28.0" +gradleVersions = "0.51.0" +kgpAndroidDesugarJdkLibs = "2.0.4" +kgpAndroidxComposeBom = "2024.04.01" +kgpAndroidxComposeCompiler = "1.5.12" +kgpAndroidxHiltCompiler = "1.0.0" +kgpAndroidxRoom = "2.6.1" +kgpCompileSdk = "34" +kgpDagger = "2.51.1" +kgpDeepLink = "3.0.0" +kgpDokka = "1.9.10" +kgpJdk = "17" +kgpJunit4 = "4.13.2" +kgpJunit5 = "5.10.1" +kgpKotlinxSerialization = "1.4.0" +kgpMinSdk = "24" +kgpMoshi = "1.15.0" +kgpTargetSdk = "34" +kotlin = "1.9.23" +kotlinter = "4.2.0" kotlinxCoroutines = "1.6.4" -kotlinxSerialization = "1.4.0" -minSdk = "24" +kover = "0.7.5" +ksp = "1.9.23-1.0.20" mockk = "1.12.5" -moshi = "1.15.0" telemetry = "1.0.0" truth = "1.1.3" [libraries] -android-desugarJdkLibs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "androidDesugarJdkLibs" } androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxActivity" } -androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "androidxCompose" } -androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended", version.ref = "androidxCompose" } -androidx-compose-ui-testManifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "androidxCompose" } -androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidxCompose" } -androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidxCompose" } +androidx-compose-material = { module = "androidx.compose.material:material" } +androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" } +androidx-compose-ui-testManifest = { module = "androidx.compose.ui:ui-test-manifest" } +androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" } androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidxLifecycle" } androidx-lifecycle-viewModelCompose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidxLifecycle" } androidx-test-ext = { module = "androidx.test.ext:junit-ktx", version.ref = "androidxTestExt" } -androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTest" } -androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidxTest" } +androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestRules" } +androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidxTestRunner" } androidx-test-uiAutomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androidxTestUiAutomator" } googleMaterial = { module = "com.google.android.material:material", version.ref = "googleMaterial" } -hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } -hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" } +hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "kgpDagger" } +hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "kgpDagger" } inject = { module = "javax.inject:javax.inject", version = "1" } -junit4 = { module = "junit:junit", version.ref = "junit4" } -junitVintageEngine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit5" } -jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit5" } -jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit5" } +junit4 = { module = "junit:junit", version.ref = "kgpJunit4" } +junitVintageEngine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "kgpJunit5" } +jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "kgpJunit5" } +jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "kgpJunit5" } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } -kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinxSerialization" } -kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" } +kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kgpKotlinxSerialization" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kgpKotlinxSerialization" } mockk = { module = "io.mockk:mockk", version.ref = "mockk" } -moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" } -moshi-ksp = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshi" } +moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "kgpMoshi" } +moshi-ksp = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "kgpMoshi" } truth = { module = "com.google.truth:truth", version.ref = "truth" } telemetry = { module = "com.kroger.telemetry:telemetry", version.ref = "telemetry" } telemetry-android = { module = "com.kroger.telemetry:android", version.ref = "telemetry" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +android-junit5 = { id = "de.mannodermaus.android-junit5", version.ref = "androidJunit5Plugin" } +android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +conventions-androidApplication = { id = "com.kroger.gradle.android-application-conventions", version.ref = "conventionPlugin" } +conventions-publishedAndroidLibrary = { id = "com.kroger.gradle.published-android-library-conventions", version.ref = "conventionPlugin" } +conventions-publishedKotlinLibrary = { id = "com.kroger.gradle.published-kotlin-library-conventions", version.ref = "conventionPlugin" } +conventions-root = { id = "com.kroger.gradle.root", version.ref = "conventionPlugin" } +hilt = { id = "com.google.dagger.hilt.android", version.ref = "kgpDagger" } +dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyAnalysis" } +dokka = { id = "org.jetbrains.dokka", version.ref = "kgpDokka" } +gradleVersions = { id = "com.github.ben-manes.versions", version.ref = "gradleVersions"} +kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +kotlinter = { id = "org.jmailen.kotlinter", version.ref = "kotlinter" } +kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "gradleMavenPublishPlugin" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c..e644113 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e0b8d4c..b82aa23 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Wed Mar 01 14:14:26 EST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,99 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +119,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,88 +130,120 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd3..25da30d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +41,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/kotlinx/build.gradle.kts b/kotlinx/build.gradle.kts index 24e4fb8..d2ec837 100644 --- a/kotlinx/build.gradle.kts +++ b/kotlinx/build.gradle.kts @@ -1,3 +1,5 @@ +import com.kroger.gradle.config.junit5 + /** * MIT License * @@ -22,9 +24,8 @@ * SOFTWARE. */ plugins { - `java-library-module` - `release-module` - kotlin("plugin.serialization") + alias(libs.plugins.conventions.publishedKotlinLibrary) + alias(libs.plugins.kotlin.serialization) } dependencies { @@ -33,8 +34,7 @@ dependencies { implementation(libs.kotlinx.serialization.json) implementation(libs.inject) - testImplementation(libs.jupiter.api) + junit5() testImplementation(libs.kotlinx.coroutines.test) testImplementation(libs.truth) - testRuntimeOnly(libs.jupiter.engine) } diff --git a/kotlinx/src/main/java/com/kroger/cache/kotlinx/CacheEntrySerializer.kt b/kotlinx/src/main/java/com/kroger/cache/kotlinx/CacheEntrySerializer.kt index 126893f..4d18dec 100644 --- a/kotlinx/src/main/java/com/kroger/cache/kotlinx/CacheEntrySerializer.kt +++ b/kotlinx/src/main/java/com/kroger/cache/kotlinx/CacheEntrySerializer.kt @@ -25,9 +25,9 @@ package com.kroger.cache.kotlinx import com.kroger.cache.internal.CacheEntry import kotlinx.serialization.KSerializer +import kotlinx.serialization.builtins.serializer import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.descriptors.buildClassSerialDescriptor -import kotlinx.serialization.descriptors.element import kotlinx.serialization.encoding.CompositeDecoder import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder @@ -41,8 +41,8 @@ public class CacheEntrySerializer(private val keySerializer: KSerializer("creationDate") - element("lastAccessDate") + element("creationDate", Long.serializer().descriptor) + element("lastAccessDate", Long.serializer().descriptor) } override fun serialize(encoder: Encoder, value: CacheEntry) { diff --git a/moshi/build.gradle.kts b/moshi/build.gradle.kts index 4fe0a89..6c3ce7a 100644 --- a/moshi/build.gradle.kts +++ b/moshi/build.gradle.kts @@ -1,3 +1,5 @@ +import com.kroger.gradle.config.junit5 + /** * MIT License * @@ -22,8 +24,7 @@ * SOFTWARE. */ plugins { - `java-library-module` - `release-module` + alias(libs.plugins.conventions.publishedKotlinLibrary) } dependencies { @@ -32,8 +33,7 @@ dependencies { implementation(libs.inject) - testImplementation(libs.jupiter.api) + junit5() testImplementation(libs.kotlinx.coroutines.test) testImplementation(libs.truth) - testRuntimeOnly(libs.jupiter.engine) } diff --git a/package-lock.json b/package-lock.json index e36568d..0281391 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "kap-np-android-cache", + "name": "Cache-Android", "lockfileVersion": 2, "requires": true, "packages": { @@ -7,7 +7,7 @@ "devDependencies": { "@commitlint/cli": "^12.1.4", "@commitlint/config-conventional": "^12.1.4", - "husky": "^7.0.4" + "husky": "^9.0.11" } }, "node_modules/@babel/code-frame": { @@ -755,15 +755,15 @@ } }, "node_modules/husky": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", - "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", "dev": true, "bin": { - "husky": "lib/bin.js" + "husky": "bin.mjs" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -2223,9 +2223,9 @@ } }, "husky": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", - "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", "dev": true }, "import-fresh": { diff --git a/package.json b/package.json index c80a64f..c712488 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,9 @@ "devDependencies": { "@commitlint/cli": "^12.1.4", "@commitlint/config-conventional": "^12.1.4", - "husky": "^7.0.4" + "husky": "^9.0.11" }, "scripts": { - "prepare": "husky install" + "prepare": "husky" } } diff --git a/sampleapp/build.gradle.kts b/sampleapp/build.gradle.kts index 3e87ad2..5f142bb 100644 --- a/sampleapp/build.gradle.kts +++ b/sampleapp/build.gradle.kts @@ -22,79 +22,33 @@ * SOFTWARE. */ plugins { - id("com.android.application") - kotlin("android") - kotlin("kapt") - kotlin("plugin.serialization") - id("com.google.dagger.hilt.android") - id("com.google.devtools.ksp") -} - -kapt { - correctErrorTypes = true + alias(libs.plugins.conventions.androidApplication) + alias(libs.plugins.kapt) + alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.ksp) } android { namespace = "com.kroger.cache.sampleapp" - compileSdk = SdkVersions.compileSdkVersion defaultConfig { applicationId = "com.kroger.cache.sampleapp" - minSdk = SdkVersions.minSdkVersion - targetSdk = SdkVersions.targetSdkVersion - } - - buildFeatures { - compose = true } buildTypes { - debug { - isDebuggable = true - } release { isMinifyEnabled = false } } - - compileOptions { - isCoreLibraryDesugaringEnabled = true - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get() - } - - kotlinOptions { - jvmTarget = "11" - } - - testOptions.unitTests.isIncludeAndroidResources = true } dependencies { - // Needed to work around issue https://stackoverflow.com/a/75298544/1435985 - constraints { - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") { - because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib") - } - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") { - because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib") - } - } - implementation(project(":android")) implementation(project(":kotlinx")) implementation(project(":moshi")) - coreLibraryDesugaring(libs.android.desugarJdkLibs) implementation(libs.androidx.activity.compose) implementation(libs.androidx.compose.material) implementation(libs.androidx.compose.material.iconsExtended) - debugImplementation(libs.androidx.compose.ui.testManifest) - debugImplementation(libs.androidx.compose.ui.tooling) - implementation(libs.androidx.compose.ui.tooling.preview) implementation(libs.androidx.core.ktx) implementation(libs.androidx.lifecycle.runtime.compose) implementation(libs.androidx.lifecycle.viewModelCompose) diff --git a/sampleapp/gradle.properties b/sampleapp/gradle.properties new file mode 100644 index 0000000..ea7dd2b --- /dev/null +++ b/sampleapp/gradle.properties @@ -0,0 +1,3 @@ +## Kroger Gradle Plugin Properties +kgp.android.autoconfigure.compose=true +kgp.android.autoconfigure.corelibrarydesugaring=true diff --git a/settings.gradle.kts b/settings.gradle.kts index 5751593..3061408 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,6 +32,7 @@ pluginManagement { repositories { google() gradlePluginPortal() + mavenCentral() } }