get rid of androidLibraryVersion changes
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
d7204243dc
commit
82141c8885
@ -161,7 +161,7 @@ If automatic backport fails, it will create a comment.
|
|||||||
For speeding up developing, we do use a master snapshot of nextcloud-library, provided by jitpack.io.
|
For speeding up developing, we do use a master snapshot of nextcloud-library, provided by jitpack.io.
|
||||||
This means that if a breaking change is merged on library, master branch of the app will fail.
|
This means that if a breaking change is merged on library, master branch of the app will fail.
|
||||||
To limit this risk please follow this approach:
|
To limit this risk please follow this approach:
|
||||||
- on app PR: first use a reference to your library branch in gradle/libs.versions.toml: ext -> androidLibraryVersion, e.g. androidLibraryVersion = "changeSearch-SNAPSHOT"
|
- on app PR: first use a reference to your library branch in build.gradle: ext -> androidLibraryVersion, e.g. androidLibraryVersion = "changeSearch-SNAPSHOT"
|
||||||
- on library PR: use label "client change required" to indicate that this is breaking change. This will prevent GitHub from merging it.
|
- on library PR: use label "client change required" to indicate that this is breaking change. This will prevent GitHub from merging it.
|
||||||
|
|
||||||
Once both PRs are reviewed and ready to merge:
|
Once both PRs are reviewed and ready to merge:
|
||||||
|
@ -268,8 +268,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// region Nextcloud Libs
|
implementation("com.github.nextcloud:android-library:$androidLibraryVersion") {
|
||||||
implementation(libs.android.library) {
|
|
||||||
exclude group: "org.ogce", module: "xpp3" // unused in Android and brings wrong Junit version
|
exclude group: "org.ogce", module: "xpp3" // unused in Android and brings wrong Junit version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
|
androidLibraryVersion ="8e561c7e65f208492c20b106eb25cfbe43dc7189"
|
||||||
androidPluginVersion = "8.9.2"
|
androidPluginVersion = "8.9.2"
|
||||||
androidxMediaVersion = "1.5.1"
|
androidxMediaVersion = "1.5.1"
|
||||||
androidxTestVersion = "1.6.1"
|
androidxTestVersion = "1.6.1"
|
||||||
|
@ -261,12 +261,12 @@ end
|
|||||||
|
|
||||||
desc "check if library is set correctly"
|
desc "check if library is set correctly"
|
||||||
private_lane :checkLibrary_RC do
|
private_lane :checkLibrary_RC do
|
||||||
sh(" if [ $(egrep 'androidLibraryVersion.*master.*' ../gradle/libs.versions.toml -c) -eq 1 ] ; then echo 'Library is set to master tag; aborting!' ; exit 1 ; fi")
|
sh(" if [ $(egrep 'androidLibraryVersion.*master.*' ../build.gradle -c) -eq 1 ] ; then echo 'Library is set to master tag; aborting!' ; exit 1 ; fi")
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "check if library is set correctly: must NOT contain master nor rc"
|
desc "check if library is set correctly: must NOT contain master nor rc"
|
||||||
private_lane :checkLibrary_Final do
|
private_lane :checkLibrary_Final do
|
||||||
sh(" if [ $(grep 'androidLibraryVersion' ../gradle/libs.versions.toml | egrep 'master|rc' -c) -eq 1 ] ; then echo 'Library is still set to rc tag; aborting!' ; exit 1 ; fi")
|
sh(" if [ $(grep 'androidLibraryVersion' ../build.gradle | egrep 'master|rc' -c) -eq 1 ] ; then echo 'Library is still set to rc tag; aborting!' ; exit 1 ; fi")
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "check if screenshots exists and exit"
|
desc "check if screenshots exists and exit"
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
[versions]
|
[versions]
|
||||||
androidCommonLibraryVersion = "0.25.0"
|
androidCommonLibraryVersion = "0.25.0"
|
||||||
androidLibraryVersion = "cb9ebaa0c8839c8593ac5fe5930e633bf8b41328"
|
|
||||||
daggerVersion = "2.56.2"
|
daggerVersion = "2.56.2"
|
||||||
espressoVersion = "3.6.1"
|
espressoVersion = "3.6.1"
|
||||||
media3 = "1.5.1"
|
media3 = "1.5.1"
|
||||||
@ -52,7 +51,6 @@ kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", v
|
|||||||
detekt-gradle-plugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detektGradlePlugin" }
|
detekt-gradle-plugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detektGradlePlugin" }
|
||||||
|
|
||||||
# Android Library
|
# Android Library
|
||||||
android-library = { module = "com.github.nextcloud:android-library", version.ref = "androidLibraryVersion" }
|
|
||||||
android-common = { module = "com.github.nextcloud.android-common:ui", version.ref = "androidCommonLibraryVersion" }
|
android-common = { module = "com.github.nextcloud.android-common:ui", version.ref = "androidCommonLibraryVersion" }
|
||||||
|
|
||||||
# Dagger
|
# Dagger
|
||||||
|
@ -4,15 +4,12 @@
|
|||||||
# SPDX-FileCopyrightText: 2016 Tobias Kaminsky <tobias@kaminsky.me>
|
# SPDX-FileCopyrightText: 2016 Tobias Kaminsky <tobias@kaminsky.me>
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
snapshotCount=$(./gradlew dependencies | grep SNAPSHOT -c)
|
||||||
PROJECT_ROOT="$SCRIPT_DIR/../../"
|
betaCount=$(grep "<bool name=\"is_beta\">true</bool>" app/src/main/res/values/setup.xml -c)
|
||||||
|
libraryHash=$(grep androidLibraryVersion build.gradle | cut -d= -f2 | tr -d \")
|
||||||
|
|
||||||
snapshotCount=$("$PROJECT_ROOT/gradlew" -p "$PROJECT_ROOT" dependencies | grep SNAPSHOT -c)
|
|
||||||
betaCount=$(grep "<bool name=\"is_beta\">true</bool>" "$PROJECT_ROOT/app/src/main/res/values/setup.xml" -c)
|
|
||||||
libraryHash=$(grep androidLibraryVersion "$PROJECT_ROOT/gradle/libs.versions.toml" | cut -d= -f2 | tr -d \")
|
|
||||||
|
|
||||||
baseBranch="master"
|
|
||||||
lastHashes=$(curl "https://api.github.com/repos/nextcloud/android-library/commits?sha=$baseBranch" | jq ".[] .sha" | head -n 20)
|
lastHashes=$(curl "https://api.github.com/repos/nextcloud/android-library/commits?sha=$baseBranch" | jq ".[] .sha" | head -n 20)
|
||||||
|
baseBranch="master"
|
||||||
|
|
||||||
if [[ $(echo "$lastHashes" | grep -c $libraryHash) -ne 1 ]]; then
|
if [[ $(echo "$lastHashes" | grep -c $libraryHash) -ne 1 ]]; then
|
||||||
echo "Library commit not within last 10 hashes, please rebase!"
|
echo "Library commit not within last 10 hashes, please rebase!"
|
||||||
@ -27,4 +24,6 @@ if [[ $betaCount -gt 0 ]] ; then
|
|||||||
echo "Beta is set in setup.xml"
|
echo "Beta is set in setup.xml"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
@ -9,18 +9,15 @@ git checkout master
|
|||||||
git pull
|
git pull
|
||||||
|
|
||||||
latestCommit=$(curl -s https://api.github.com/repos/nextcloud/android-library/commits/master | jq .sha | sed s'/\"//g')
|
latestCommit=$(curl -s https://api.github.com/repos/nextcloud/android-library/commits/master | jq .sha | sed s'/\"//g')
|
||||||
SCRIPT_DIR="$(cd "$(dirname \"${BASH_SOURCE[0]}\")" && pwd)"
|
currentCommit=$(grep "androidLibraryVersion" build.gradle | cut -f2 -d'"')
|
||||||
PROJECT_ROOT="$SCRIPT_DIR/../../"
|
|
||||||
|
|
||||||
currentCommit=$(grep "androidLibraryVersion" "$PROJECT_ROOT/gradle/libs.versions.toml" | cut -f2 -d'"')
|
|
||||||
|
|
||||||
[[ $latestCommit == "$currentCommit" ]] && echo "Nothing to do. Commit is: $latestCommit" && exit # nothing to do
|
[[ $latestCommit == "$currentCommit" ]] && echo "Nothing to do. Commit is: $latestCommit" && exit # nothing to do
|
||||||
|
|
||||||
git fetch
|
git fetch
|
||||||
git checkout -B update-library-"$(date +%F)" origin/master
|
git checkout -B update-library-"$(date +%F)" origin/master
|
||||||
|
|
||||||
sed -i s"#androidLibraryVersion\ =.*#androidLibraryVersion =\"$latestCommit\"#" "$PROJECT_ROOT/gradle/libs.versions.toml"
|
sed -i s"#androidLibraryVersion\ =.*#androidLibraryVersion =\"$latestCommit\"#" build.gradle
|
||||||
"$PROJECT_ROOT/gradlew" --console=plain --dependency-verification lenient -q --write-verification-metadata sha256,pgp help
|
./gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256,pgp help
|
||||||
|
|
||||||
git add build.gradle
|
git add build.gradle
|
||||||
git add gradle/verification-metadata.xml
|
git add gradle/verification-metadata.xml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user