From 748f16fde7a6b5d28a4289f2831a10fdbdb3ef25 Mon Sep 17 00:00:00 2001 From: Ruben Sousa Date: Sat, 5 Oct 2024 17:28:02 +0200 Subject: [PATCH 1/3] Bump to 1.4.0-beta01 --- docs/changelog.md | 8 ++++++++ gradle.properties | 2 +- mkdocs.yml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 4061315e..658e38b7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,14 @@ ## Version 1.4.0 +### 1.4.0-beta01 + +2024-10-05 + +#### Bug fixes + +- Do not allow scrolling more than the layout size when `AlignmentLookup` is used: ([#270](https://github.com/rubensousa/DpadRecyclerView/pull/270)) + ### 1.4.0-alpha06 2024-09-05 diff --git a/gradle.properties b/gradle.properties index c790c619..71e8e4d8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,4 +22,4 @@ kotlin.code.style=official # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true android.enableR8.fullMode=true -LIBRARY_VERSION=1.4.0-alpha06 \ No newline at end of file +LIBRARY_VERSION=1.4.0-beta01 \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 5588ecef..dca43e2f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,7 +24,7 @@ theme: extra: dpadrecyclerview: - version: '1.4.0-alpha06' + version: '1.4.0-beta01' social: - icon: 'fontawesome/brands/github' link: 'https://github.com/rubensousa/DpadRecyclerView' From 5cda1f866f74046b1cd886d0a68e8078a41069f6 Mon Sep 17 00:00:00 2001 From: Ruben Sousa Date: Sat, 5 Oct 2024 17:40:20 +0200 Subject: [PATCH 2/3] Setup publishing plugin --- build.gradle | 38 +----- dpadrecyclerview-compose/build.gradle | 9 +- dpadrecyclerview-compose/gradle.properties | 16 +-- dpadrecyclerview-testing/build.gradle | 10 +- dpadrecyclerview-testing/consumer-rules.pro | 0 dpadrecyclerview-testing/gradle.properties | 16 +-- dpadrecyclerview/build.gradle | 10 +- dpadrecyclerview/gradle.properties | 16 +-- gradle.properties | 19 ++- gradle/libs.versions.toml | 3 +- gradle/publish.gradle | 141 -------------------- 11 files changed, 27 insertions(+), 251 deletions(-) delete mode 100644 dpadrecyclerview-testing/consumer-rules.pro delete mode 100644 gradle/publish.gradle diff --git a/build.gradle b/build.gradle index 3b81c755..49f4c545 100644 --- a/build.gradle +++ b/build.gradle @@ -12,8 +12,8 @@ plugins { alias libs.plugins.android.library apply false alias libs.plugins.kotlin.android apply false alias libs.plugins.kotlin.kover apply false + alias libs.plugins.maven.publish apply false alias libs.plugins.androidx.navigation.safeargs apply false - id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' id 'org.jetbrains.dokka' version '1.9.20' id 'org.jetbrains.kotlinx.binary-compatibility-validator' version "0.14.0" } @@ -22,39 +22,3 @@ apiValidation { ignoredProjects += ["sample", "dpadrecyclerview-test-fixtures"] ignoredClasses += "com.rubensousa.dpadrecyclerview.BuildConfig" } - -nexusPublishing { - repositories { - sonatype { - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) - stagingProfileId = getSonatypeStagingId() - username = getSonatypeUsername() - password = getSonatypePassword() - } - } -} - -String getSonatypeStagingId() { - if (hasProperty("ossrhStagingProfileId")) { - return ossrhStagingProfileId - } else { - return "" - } -} - -String getSonatypeUsername() { - if (hasProperty("ossrhUsername")) { - return ossrhUsername - } else { - return "" - } -} - -String getSonatypePassword() { - if (hasProperty("ossrhPassword")) { - return ossrhPassword - } else { - return "" - } -} \ No newline at end of file diff --git a/dpadrecyclerview-compose/build.gradle b/dpadrecyclerview-compose/build.gradle index 06aafa81..9e9cf420 100644 --- a/dpadrecyclerview-compose/build.gradle +++ b/dpadrecyclerview-compose/build.gradle @@ -3,10 +3,10 @@ plugins { alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.compose) alias(libs.plugins.carioca.allure) + alias(libs.plugins.maven.publish) id 'org.jetbrains.dokka' } -apply from: "$rootProject.projectDir/gradle/publish.gradle" apply from: "$rootProject.projectDir/gradle/coverage.gradle" android { @@ -41,13 +41,6 @@ android { jvmTarget = '1.8' } - publishing { - singleVariant('release') { - withSourcesJar() - withJavadocJar() - } - } - } dependencies { diff --git a/dpadrecyclerview-compose/gradle.properties b/dpadrecyclerview-compose/gradle.properties index a26991f9..c9def865 100644 --- a/dpadrecyclerview-compose/gradle.properties +++ b/dpadrecyclerview-compose/gradle.properties @@ -13,20 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -LIBRARY_GROUP=com.rubensousa.dpadrecyclerview -LIBRARY_ARTIFACT=dpadrecyclerview-compose -# POM info -POM_PACKAGING=aar POM_NAME=dpadrecyclerview-compose +POM_ARTIFACT_ID=dpadrecyclerview-compose POM_DESCRIPTION=Compose extensions for DpadRecyclerView -POM_URL=https://github.com/rubensousa/dpadrecyclerview -POM_SCM_URL=https://github.com/rubensousa/dpadrecyclerview -POM_VCS_URL=https://github.com/rubensousa/dpadrecyclerview.git -POM_SCM_CONNECTION=scm:git@github.com:rubensousa/dpadrecyclerview.git -POM_SCM_DEV_CONNECTION=scm:git@github.com:rubensousa/dpadrecyclerview.git -POM_DEVELOPER_ID=rubensousa -POM_DEVELOPER_NAME=Rúben Sousa -POM_LICENSE_NAME=The Apache Software License, Version 2.0 -POM_LICENSE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt -POM_LICENSE_DIST=repo -POM_LICENSES=Apache-2.0 \ No newline at end of file diff --git a/dpadrecyclerview-testing/build.gradle b/dpadrecyclerview-testing/build.gradle index d1921ac8..8d041b21 100644 --- a/dpadrecyclerview-testing/build.gradle +++ b/dpadrecyclerview-testing/build.gradle @@ -2,10 +2,10 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) alias(libs.plugins.carioca.allure) + alias(libs.plugins.maven.publish) id 'org.jetbrains.dokka' } -apply from: "$rootProject.projectDir/gradle/publish.gradle" apply from: "$rootProject.projectDir/gradle/coverage.gradle" android { @@ -44,14 +44,6 @@ android { targetSdk versions.targetSdkVersion } - - publishing { - singleVariant('release') { - withSourcesJar() - withJavadocJar() - } - } - } dependencies { diff --git a/dpadrecyclerview-testing/consumer-rules.pro b/dpadrecyclerview-testing/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/dpadrecyclerview-testing/gradle.properties b/dpadrecyclerview-testing/gradle.properties index 2b93e69f..74c36509 100644 --- a/dpadrecyclerview-testing/gradle.properties +++ b/dpadrecyclerview-testing/gradle.properties @@ -13,20 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -LIBRARY_GROUP=com.rubensousa.dpadrecyclerview -LIBRARY_ARTIFACT=dpadrecyclerview-testing -# POM info -POM_PACKAGING=aar POM_NAME=dpadrecyclerview-testing +POM_ARTIFACT_ID=dpadrecyclerview-testing POM_DESCRIPTION=Testing extensions for DpadRecyclerView -POM_URL=https://github.com/rubensousa/dpadrecyclerview -POM_SCM_URL=https://github.com/rubensousa/dpadrecyclerview -POM_VCS_URL=https://github.com/rubensousa/dpadrecyclerview.git -POM_SCM_CONNECTION=scm:git@github.com:rubensousa/dpadrecyclerview.git -POM_SCM_DEV_CONNECTION=scm:git@github.com:rubensousa/dpadrecyclerview.git -POM_DEVELOPER_ID=rubensousa -POM_DEVELOPER_NAME=Rúben Sousa -POM_LICENSE_NAME=The Apache Software License, Version 2.0 -POM_LICENSE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt -POM_LICENSE_DIST=repo -POM_LICENSES=Apache-2.0 \ No newline at end of file diff --git a/dpadrecyclerview/build.gradle b/dpadrecyclerview/build.gradle index 2a75216e..c4c8e79d 100644 --- a/dpadrecyclerview/build.gradle +++ b/dpadrecyclerview/build.gradle @@ -2,10 +2,10 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) alias(libs.plugins.carioca.allure) + alias(libs.plugins.maven.publish) id 'org.jetbrains.dokka' } -apply from: "$rootProject.projectDir/gradle/publish.gradle" apply from: "$rootProject.projectDir/gradle/coverage.gradle" android { @@ -44,14 +44,6 @@ android { kotlinOptions { jvmTarget = '1.8' } - - publishing { - singleVariant('release') { - withSourcesJar() - withJavadocJar() - } - } - } dependencies { diff --git a/dpadrecyclerview/gradle.properties b/dpadrecyclerview/gradle.properties index 2d075666..caad5c52 100644 --- a/dpadrecyclerview/gradle.properties +++ b/dpadrecyclerview/gradle.properties @@ -13,20 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -LIBRARY_GROUP=com.rubensousa.dpadrecyclerview -LIBRARY_ARTIFACT=dpadrecyclerview -# POM info -POM_PACKAGING=aar POM_NAME=dpadrecyclerview +POM_ARTIFACT_ID=dpadrecyclerview POM_DESCRIPTION=A RecyclerView built for Android TV as a replacement for Leanback's BaseGridView -POM_URL=https://github.com/rubensousa/dpadrecyclerview -POM_SCM_URL=https://github.com/rubensousa/dpadrecyclerview -POM_VCS_URL=https://github.com/rubensousa/dpadrecyclerview.git -POM_SCM_CONNECTION=scm:git@github.com:rubensousa/dpadrecyclerview.git -POM_SCM_DEV_CONNECTION=scm:git@github.com:rubensousa/dpadrecyclerview.git -POM_DEVELOPER_ID=rubensousa -POM_DEVELOPER_NAME=Rúben Sousa -POM_LICENSE_NAME=The Apache Software License, Version 2.0 -POM_LICENSE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt -POM_LICENSE_DIST=repo -POM_LICENSES=Apache-2.0 \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 71e8e4d8..2dfa9768 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,4 +22,21 @@ kotlin.code.style=official # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true android.enableR8.fullMode=true -LIBRARY_VERSION=1.4.0-beta01 \ No newline at end of file + +SONATYPE_HOST=S01 +RELEASE_SIGNING_ENABLED=true + +GROUP=com.rubensousa.dpadrecyclerview +VERSION_NAME=1.4.0-beta01 +POM_URL=https://github.com/rubensousa/dpadrecyclerview/ +POM_SCM_URL=https://github.com/rubensousa/dpadrecyclerview/ +POM_SCM_CONNECTION=scm:git:git://github.com/rubensousa/dpadrecyclerview.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/rubensousa/dpadrecyclerview.git +POM_INCEPTION_YEAR=2024 +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=rubensousa +POM_DEVELOPER_NAME=Ruben Sousa +POM_DEVELOPER_URL=https://github.com/rubensousa/ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ef265af3..0a734ae2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -46,6 +46,7 @@ kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "ko kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } carioca-allure = { id = "com.rubensousa.carioca.report.allure", version.ref = "carioca-allure" } +maven-publish = { id = "com.vanniktech.maven.publish", version = "0.29.0" } [libraries] androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } @@ -87,4 +88,4 @@ guava = { module = "com.google.guava:guava", version.ref = "guava" } junit = { module = "junit:junit", version.ref = "test-junit" } mockk = { module = "io.mockk:mockk", version.ref = "test-mockk" } timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" } -truth = { module = "com.google.truth:truth", version.ref = "test-truth" } \ No newline at end of file +truth = { module = "com.google.truth:truth", version.ref = "test-truth" } diff --git a/gradle/publish.gradle b/gradle/publish.gradle deleted file mode 100644 index 65151767..00000000 --- a/gradle/publish.gradle +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2013 Chris Banes - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Copyright 2020 Rúben Sousa - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Adapted from: https://github.com/chrisbanes/gradle-mvn-push - * and: https://github.com/sky-uk/gradle-maven-plugin/blob/master/artifact-pom-manager.gradle - * - * This script requires the following variables: - * - * --- LIBRARY INFORMATION --- - * - * LIBRARY_VERSION=1.0.0-rc01 - * LIBRARY_GROUP=com.library.package - * LIBRARY_ARTIFACT=library - * LIBRARY_PUBLISH_SOURCES=true // default is true - * LIBRARY_PUBLISH_DOCS=true // default is true - * - * Gradle path for installation will be: com.library.package:library - * - * --- POM INFORMATION --- - * - * POM_PACKAGING=aar - * POM_NAME=Library - * POM_DESCRIPTION=A sample library that's published to github packages - * POM_URL=https://github.com/githubuser/Library - * POM_SCM_URL=https://github.com/githubuser/githubuser - * POM_SCM_CONNECTION=scm:git@github.com:githubuser/githubuser.git - * POM_SCM_DEV_CONNECTION=scm:git@github.com:githubuser/githubuser.git - * POM_DEVELOPER_ID=githubuser - * POM_DEVELOPER_NAME=Github User - * POM_LICENCE_NAME=The Apache Software License, Version 2.0 - * POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt - * POM_LICENCE_DIST=repo - */ -apply plugin: 'maven-publish' -apply plugin: 'signing' - -ext["signing.keyId"] = getSecretKeyId() -ext["signing.password"] = getSecretKeyPassword() -ext["signing.secretKeyRingFile"] = getSecretKeyRingFilePath() - -String getSecretKeyPassword() { - if (hasProperty("ossrhSecretKeyPassword")) { - return ossrhSecretKeyPassword - } else { - return "" - } -} - -String getSecretKeyId() { - if (hasProperty("ossrhSecretKeyId")) { - return ossrhSecretKeyId - } else { - return "" - } -} - -String getSecretKeyRingFilePath() { - if (hasProperty("ossrhSecretKeyRingFile")) { - return ossrhSecretKeyRingFile - } else { - return "" - } -} - -afterEvaluate { project -> - publishing { - publications { - release(MavenPublication) { - from components.release - groupId LIBRARY_GROUP - version LIBRARY_VERSION - artifactId LIBRARY_ARTIFACT - configurePom(pom) - } - } - } -} - -def configurePom(pom) { - pom.name = POM_NAME - pom.packaging = POM_PACKAGING - pom.description = POM_DESCRIPTION - pom.url = POM_URL - - pom.scm { - url = POM_SCM_URL - connection = POM_SCM_CONNECTION - developerConnection = POM_SCM_DEV_CONNECTION - } - - pom.licenses { - license { - name = "The Apache Software License, Version 2.0" - url = "http://www.apache.org/licenses/LICENSE-2.0.txt" - } - } - - pom.developers { - developer { - id = POM_DEVELOPER_ID - name = POM_DEVELOPER_NAME - } - } -} - -group LIBRARY_GROUP -version LIBRARY_VERSION - -signing { - sign publishing.publications -} From eb67075a41f705acfb7ba0f9fc472b703272b072 Mon Sep 17 00:00:00 2001 From: Ruben Sousa Date: Sat, 5 Oct 2024 18:33:54 +0200 Subject: [PATCH 3/3] Decrease number of events to decrease flakiness --- .../dpadrecyclerview/test/tests/selection/SelectionTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpadrecyclerview/src/androidTest/kotlin/com/rubensousa/dpadrecyclerview/test/tests/selection/SelectionTest.kt b/dpadrecyclerview/src/androidTest/kotlin/com/rubensousa/dpadrecyclerview/test/tests/selection/SelectionTest.kt index 55d08855..77f72a8e 100644 --- a/dpadrecyclerview/src/androidTest/kotlin/com/rubensousa/dpadrecyclerview/test/tests/selection/SelectionTest.kt +++ b/dpadrecyclerview/src/androidTest/kotlin/com/rubensousa/dpadrecyclerview/test/tests/selection/SelectionTest.kt @@ -151,7 +151,7 @@ class SelectionTest : DpadRecyclerViewTest() { assertSelectedPosition(position = 0) assertViewHolderSelected(position = 0, isSelected = true) - repeat(10) { index -> + repeat(5) { index -> KeyEvents.pressDown() assertViewHolderSelected(position = index, isSelected = false) assertSelectedPosition(position = index + 1)