From cfd6913b4f452c2d474c614a80b680f1253e8291 Mon Sep 17 00:00:00 2001 From: Paul Rybitskyi Date: Tue, 6 Aug 2024 19:34:42 +0300 Subject: [PATCH] Update dependencies (#45) --- .github/workflows/build.yml | 12 ++++---- .github/workflows/release.yml | 4 +-- build.gradle.kts | 11 ++++++- buildSrc/build.gradle.kts | 4 +-- buildSrc/src/main/java/Dependencies.kt | 30 ++++++++----------- gradle/wrapper/gradle-wrapper.properties | 2 +- persistentsearchview/build.gradle.kts | 8 +++++ sample/build.gradle.kts | 1 + .../sample/DemoActivity.kt | 1 + .../sample/adapters/model/UserItem.kt | 11 ++----- 10 files changed, 45 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0d665b..2b65cd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,11 +16,11 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: '11' + java-version: '17' - name: Generate a Cache Key run: ./checksum.sh checksum.txt @@ -50,11 +50,11 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: '11' + java-version: '17' - name: Generate a Cache Key run: ./checksum.sh checksum.txt @@ -84,11 +84,11 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: '11' + java-version: '17' - name: Generate a Cache Key run: ./checksum.sh checksum.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a445c29..b5c693d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,11 +13,11 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: '11' + java-version: '17' - name: Generate a Cache Key run: ./checksum.sh checksum.txt diff --git a/build.gradle.kts b/build.gradle.kts index 8a54070..a724699 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,6 +14,8 @@ * limitations under the License. */ +import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask + plugins { gradleVersions() } @@ -31,12 +33,19 @@ buildscript { } } +tasks.withType { + rejectVersionIf { + listOf("alpha", "beta", "rc").any { keyword -> + candidate.version.lowercase().contains(keyword) + } + } +} + allprojects { repositories { mavenCentral() google() maven { url = uri("https://jitpack.io") } - //jcenter() // adapster library has not migrated yet } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 6c6f059..85f43b4 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -24,6 +24,6 @@ repositories { } dependencies { - implementation("com.android.tools.build:gradle:7.2.2") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0") + implementation("com.android.tools.build:gradle:8.3.1") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0") } \ No newline at end of file diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 6628019..811f8b1 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -21,14 +21,13 @@ import org.gradle.api.JavaVersion object appConfig { - const val compileSdkVersion = 32 - const val targetSdkVersion = 32 + const val compileSdkVersion = 34 + const val targetSdkVersion = 34 const val minSdkVersion = 21 const val applicationId = "com.paulrybitskyi.persistentsearchview.sample" val javaCompatibilityVersion = JavaVersion.VERSION_1_8 val kotlinCompatibilityVersion = JavaVersion.VERSION_1_8 - } @@ -53,26 +52,24 @@ object publishingConfig { const val artifactName = "persistentsearchview" const val artifactVersion = "1.1.4" const val artifactDescription = "An android library designed to simplify the process of implementing search-related functionality." - } object versions { - const val kotlin = "1.7.0" // also in buildSrc build.gradle.kts file - const val gradlePlugin = "7.2.2" // also in buildSrc build.gradle.kts file - const val gradleVersionsPlugin = "0.42.0" - const val appCompat = "1.4.2" + const val kotlin = "2.0.0" // also in buildSrc build.gradle.kts file + const val androidPlugin = "8.3.1" // also in buildSrc build.gradle.kts file + const val gradleVersionsPlugin = "0.51.0" + const val appCompat = "1.7.0" const val cardView = "1.0.0" - const val browser = "1.4.0" - const val recyclerView = "1.2.1" + const val browser = "1.8.0" + const val recyclerView = "1.3.2" const val adapster = "1.0.13" - const val annotations = "1.4.0" - const val coreKtx = "1.8.0" + const val annotations = "1.8.1" + const val coreKtx = "1.13.1" const val commonsKtx = "1.0.4" const val jUnit = "4.13.2" - const val testRunner = "1.3.0" - + const val testRunner = "1.6.1" } @@ -80,16 +77,14 @@ object deps { object plugins { - const val androidGradle = "com.android.tools.build:gradle:${versions.gradlePlugin}" + const val androidGradle = "com.android.tools.build:gradle:${versions.androidPlugin}" const val kotlinGradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" const val gradleVersions = "com.github.ben-manes:gradle-versions-plugin:${versions.gradleVersionsPlugin}" } object local { - const val persistentSearchView = ":persistentsearchview" - } const val appCompat = "androidx.appcompat:appcompat:${versions.appCompat}" @@ -102,5 +97,4 @@ object deps { const val commonsKtx = "com.paulrybitskyi.commons:commons-ktx:${versions.commonsKtx}" const val jUnit = "junit:junit:${versions.jUnit}" const val testRunner = "androidx.test:runner:${versions.testRunner}" - } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index eea3be5..2e3a9f5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip diff --git a/persistentsearchview/build.gradle.kts b/persistentsearchview/build.gradle.kts index eba95cb..9bfdb63 100644 --- a/persistentsearchview/build.gradle.kts +++ b/persistentsearchview/build.gradle.kts @@ -21,7 +21,15 @@ plugins { android { compileSdk = appConfig.compileSdkVersion + publishing { + singleVariant(publishingConfig.mavenPublicationName) { + withJavadocJar() + withSourcesJar() + } + } + defaultConfig { + namespace = "com.paulrybitskyi.persistentsearchview" minSdk = appConfig.minSdkVersion targetSdk = appConfig.targetSdkVersion diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index f2cdc07..bffa532 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -24,6 +24,7 @@ android { defaultConfig { applicationId = appConfig.applicationId + namespace = appConfig.applicationId minSdk = appConfig.minSdkVersion targetSdk = appConfig.targetSdkVersion diff --git a/sample/src/main/java/com/paulrybitskyi/persistentsearchview/sample/DemoActivity.kt b/sample/src/main/java/com/paulrybitskyi/persistentsearchview/sample/DemoActivity.kt index 30e1bbf..fbf3b0f 100644 --- a/sample/src/main/java/com/paulrybitskyi/persistentsearchview/sample/DemoActivity.kt +++ b/sample/src/main/java/com/paulrybitskyi/persistentsearchview/sample/DemoActivity.kt @@ -31,6 +31,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.arthurivanets.adapster.listeners.OnItemClickListener import com.paulrybitskyi.commons.ktx.* import com.paulrybitskyi.persistentsearchview.PersistentSearchView +import com.paulrybitskyi.persistentsearchview.R import com.paulrybitskyi.persistentsearchview.adapters.model.SuggestionItem import com.paulrybitskyi.persistentsearchview.listeners.OnSearchConfirmedListener import com.paulrybitskyi.persistentsearchview.listeners.OnSearchQueryChangeListener diff --git a/sample/src/main/java/com/paulrybitskyi/persistentsearchview/sample/adapters/model/UserItem.kt b/sample/src/main/java/com/paulrybitskyi/persistentsearchview/sample/adapters/model/UserItem.kt index 1bbb767..9762721 100644 --- a/sample/src/main/java/com/paulrybitskyi/persistentsearchview/sample/adapters/model/UserItem.kt +++ b/sample/src/main/java/com/paulrybitskyi/persistentsearchview/sample/adapters/model/UserItem.kt @@ -37,13 +37,6 @@ import com.paulrybitskyi.persistentsearchview.sample.model.User internal class UserItem(itemModel: User): BaseItem(itemModel) { - companion object { - - const val MAIN_LAYOUT = R.layout.item_user - - } - - override fun init( adapter: Adapter>?, parent: ViewGroup, inflater: LayoutInflater, @@ -51,7 +44,7 @@ internal class UserItem(itemModel: User): BaseItem(itemView) {