Skip to content

Commit

Permalink
Simplify Renovate regex config
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfeo committed Jan 6, 2025
1 parent 7027534 commit e7a9b26
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
23 changes: 12 additions & 11 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,32 @@
"extends": [
"config:recommended"
],
// See https://docs.renovatebot.com/modules/manager/regex/
// Dependabot is used for all other updates.
"enabledManagers": ["regex"],
"customManagers": [
{
// See https://docs.renovatebot.com/modules/manager/regex/
// Matches AGP versions annotated with a "renovate: AGP version" comment
customType: "regex",
fileMatch: [
"src/main/resources/versions\\.json5",
"gradle\\.properties",
],
matchStrings: [
// Matches versions in JSON: the first double-quoted string below the comment line, e.g. "1.0.0"
"\/\/ renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>\\S+?))?\\s+?\"(?<currentValue>\\S+?)\"",
// Matches versions in properties: the value of the first property below the comment line, e.g. anyProperty=1.0.0
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>\\S+?))?\\s+?\\S+?=(?<currentValue>\\S+?)(?:\\s|$)",
// For JSON: the first double-quoted string below the comment line, e.g. "1.0.0"
"\/\/ renovate: AGP version\\s+?\"(?<currentValue>\\S+?)\"",
// For properties: the value of the first property below the comment line, e.g. anyProperty=1.0.0
"# renovate: AGP version\\s+?\\S+?=(?<currentValue>\\S+?)(?:\\s|$)",
],
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
"dataSourceTemplate": "maven",
"versioningTemplate": "maven",
"depNameTemplate": "com.android.tools.build:gradle",
"registryUrlTemplate": "https://dl.google.com/dl/android/maven2/",
},
],
"packageRules": [
{
"matchDepNames": ["com.android.tools.build:gradle"],
"registryUrls": ["https://dl.google.com/dl/android/maven2/"],
},
{
// In versions.json5, suggest only patches
// In versions.json5, disable bumps of major/minor, which should be added as new properties
"matchDepNames": ["com.android.tools.build:gradle"],
"matchUpdateTypes": ["major", "minor"],
"matchFileNames": ["src/main/resources/versions\\.json5"],
Expand Down
30 changes: 15 additions & 15 deletions src/main/resources/versions.json5
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
{
"supportedVersions": {
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.9.0-alpha04": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.8.0-beta01": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.7.2": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.6.0": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.5.2": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.4.2": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.3.2": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.2.2": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.1.4": [
"8.12"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"8.0.2": [
"8.0.2"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"7.4.2": [
"7.6.2"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"7.3.1": [
"7.4.2",
"7.6.2"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"7.2.2": [
"7.3.3",
"7.6.2"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"7.1.3": [
"7.2",
"7.6.2"
],
// renovate: datasource=maven depName=com.android.tools.build:gradle versioning=maven
// renovate: AGP version
"7.0.4": [
"7.0.2",
"7.6.2"
Expand Down

0 comments on commit e7a9b26

Please sign in to comment.