Skip to content

Commit 4e8bcf1

Browse files
committed
chore: update dependencies.txt file to a new format
1 parent 74e2a15 commit 4e8bcf1

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/scripts/test_dependency_compatibility.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ function print_help() {
3232
# Function to parse a dependency string and append it to the Maven command
3333
function add_dependency_to_maven_command() {
3434
local dep_pair=$1
35-
if [[ ! "${dep_pair}" =~ .*=.* ]]; then
36-
echo "Malformed dependency string: ${dep_pair}. Expected format: dependency=version"
35+
if [[ ! "${dep_pair}" =~ .*:.*:.* ]]; then
36+
echo "Malformed dependency string: ${dep_pair}. Expected format: {GroupID}:{ArtifactID}:{Version}:{MavenPropertyName}"
3737
exit 1
3838
fi
39-
local full_dependency=$(echo "${dep_pair}" | cut -d'=' -f1 | tr -d '[:space:]')
40-
# The dependency can be in the format of {groupId}:{artifactId};{pomPropertyName}
41-
# We only want the pomPropertyName
42-
local dependency=$(echo "${full_dependency}" | awk -F';' '{print $NF}')
43-
local version=$(echo "${dep_pair}" | cut -d'=' -f2 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
39+
local full_dependency=$(echo "${dep_pair}" | rev | cut -d':' -f2- | rev)
40+
local dependency=$(echo "${dep_pair}" | rev | cut -d':' -f1 | rev)
41+
local version=$(echo "${full_dependency}" | awk -F':' '{print $NF}')
4442
MAVEN_COMMAND+=" -D${dependency}.version=${version}"
4543
}
4644

renovate.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
"^library_generation/requirements\\.txt$"
1111
],
1212
"customManagers": [
13+
{
14+
"customType": "regex",
15+
"fileMatch": [
16+
"^dependencies\\.txt$"
17+
],
18+
"matchStrings": [
19+
"^(?<depName>[^:]+:[^:]+):(?<currentValue>[^:]+):(?<additionalInfo>[^:]+?)$"
20+
],
21+
"datasourceTemplate": "maven"
22+
},
1323
{
1424
"customType": "regex",
1525
"fileMatch": [

0 commit comments

Comments
 (0)