This repository was archived by the owner on Oct 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +47
-0
lines changed
src/main/kotlin/app/passwordstore/gradle Expand file tree Collapse file tree 5 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ gradlePlugin {
65
65
id = " com.github.android-password-store.versioning-plugin"
66
66
implementationClass = " app.passwordstore.gradle.versioning.VersioningPlugin"
67
67
}
68
+ register(" versions" ) {
69
+ id = " com.github.android-password-store.versions"
70
+ implementationClass = " app.passwordstore.gradle.DependencyUpdatesPlugin"
71
+ }
68
72
}
69
73
}
70
74
@@ -84,6 +88,7 @@ dependencies {
84
88
implementation(libs.build.r8)
85
89
implementation(libs.build.semver)
86
90
implementation(libs.build.sentry)
91
+ implementation(libs.build.vcu)
87
92
implementation(libs.kotlinx.coroutines.core)
88
93
89
94
// Expose the generated version catalog API to the plugin.
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
3
+ * SPDX-License-Identifier: GPL-3.0-only
4
+ */
5
+ package app.passwordstore.gradle
6
+
7
+ import com.github.zafarkhaja.semver.Version
8
+ import kotlin.jvm.optionals.getOrNull
9
+ import nl.littlerobots.vcu.plugin.VersionCatalogUpdateExtension
10
+ import nl.littlerobots.vcu.plugin.VersionCatalogUpdatePlugin
11
+ import nl.littlerobots.vcu.plugin.versionSelector
12
+ import org.gradle.api.Plugin
13
+ import org.gradle.api.Project
14
+ import org.gradle.kotlin.dsl.apply
15
+ import org.gradle.kotlin.dsl.configure
16
+
17
+ @Suppress(" Unused" )
18
+ class DependencyUpdatesPlugin : Plugin <Project > {
19
+ override fun apply (project : Project ) {
20
+ project.pluginManager.apply (VersionCatalogUpdatePlugin ::class )
21
+ project.extensions.configure<VersionCatalogUpdateExtension > {
22
+ keep.keepUnusedLibraries.set(true )
23
+ versionSelector {
24
+ val currentVersion = Version .tryParse(it.currentVersion).getOrNull()
25
+ val newVersion = Version .tryParse(it.candidate.version).getOrNull()
26
+ if (currentVersion == null || newVersion == null ) {
27
+ false
28
+ } else {
29
+ newVersion.isHigherThan(currentVersion)
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ plugins {
6
6
id(" com.github.android-password-store.git-hooks" )
7
7
id(" com.github.android-password-store.kotlin-common" )
8
8
id(" com.github.android-password-store.ktfmt" )
9
+ id(" com.github.android-password-store.versions" )
9
10
}
Original file line number Diff line number Diff line change @@ -58,3 +58,9 @@ SONATYPE_CONNECT_TIMEOUT_SECONDS=120
58
58
SONATYPE_CLOSE_TIMEOUT_SECONDS =1800
59
59
60
60
org.gradle.jvmargs =-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
61
+
62
+ # Version Catalog Update Plugin workarounds and fixes
63
+ systemProp.javax.xml.parsers.SAXParserFactory =com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
64
+ systemProp.javax.xml.transform.TransformerFactory =com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
65
+ systemProp.javax.xml.parsers.DocumentBuilderFactory =com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
66
+ nl.littlerobots.vcu.resolver =true
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ build-okhttp = "com.squareup.okhttp3:okhttp:4.12.0"
50
50
build-r8 = " com.android.tools:r8:8.3.37"
51
51
build-semver = " com.github.zafarkhaja:java-semver:0.10.2"
52
52
build-sentry = " io.sentry.android.gradle:io.sentry.android.gradle.gradle.plugin:4.3.1"
53
+ build-vcu = " nl.littlerobots.version-catalog-update:nl.littlerobots.version-catalog-update.gradle.plugin:0.8.4"
53
54
compose-bom = " androidx.compose:compose-bom:2024.03.00"
54
55
compose-foundation-core = { module = " androidx.compose.foundation:foundation" }
55
56
compose-foundation-layout = { module = " androidx.compose.foundation:foundation-layout" }
You can’t perform that action at this time.
0 commit comments