Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
a28f688b
Commit
a28f688b
authored
5 years ago
by
Olexiy Myronenko
Committed by
Rhys Arkins
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(gradle): allow use of variables with platform keyword and… (#4378)
parent
75dcf30e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/manager/gradle/build-gradle.ts
+1
-1
1 addition, 1 deletion
lib/manager/gradle/build-gradle.ts
test/manager/gradle/build-gradle.spec.ts
+20
-0
20 additions, 0 deletions
test/manager/gradle/build-gradle.spec.ts
with
21 additions
and
1 deletion
lib/manager/gradle/build-gradle.ts
+
1
−
1
View file @
a28f688b
...
@@ -208,7 +208,7 @@ function moduleMapVariableVersionFormatMatch(
...
@@ -208,7 +208,7 @@ function moduleMapVariableVersionFormatMatch(
return
new
RegExp
(
return
new
RegExp
(
`group
\\
s*:
\\
s*["']
${
dependency
.
group
}
["']
\\
s*,
\\
s*`
+
`group
\\
s*:
\\
s*["']
${
dependency
.
group
}
["']
\\
s*,
\\
s*`
+
`name
\\
s*:
\\
s*["']
${
dependency
.
name
}
["']
\\
s*,
\\
s*`
+
`name
\\
s*:
\\
s*["']
${
dependency
.
name
}
["']
\\
s*,
\\
s*`
+
`version
\\
s*:
\\
s*([^
\\
s"']+
?
)
\\
s`
`version
\\
s*:
\\
s*([^
\\
s"'
)
]+)
\\
s
*
`
);
);
}
}
...
...
This diff is collapsed.
Click to expand it.
test/manager/gradle/build-gradle.spec.ts
+
20
−
0
View file @
a28f688b
...
@@ -206,6 +206,26 @@ describe('lib/manager/gradle/updateGradleVersion', () => {
...
@@ -206,6 +206,26 @@ describe('lib/manager/gradle/updateGradleVersion', () => {
expect
(
updatedGradleFile
).
toEqual
(
'
mysqlVersion=7.0.0
'
);
expect
(
updatedGradleFile
).
toEqual
(
'
mysqlVersion=7.0.0
'
);
});
});
it
(
'
should replace a external property variable assigned to a specific dependency parenthesis syntax
'
,
()
=>
{
const
gradleFile
=
"
implementation platform(group: 'mysql', name: 'mysql-connector-java', version: mysqlVersion)
"
;
// eslint-disable-line no-template-curly-in-string
const
mysqlDependency
=
{
group
:
'
mysql
'
,
depGroup
:
'
mysql
'
,
name
:
'
mysql-connector-java
'
,
version
:
'
6.0.5
'
,
};
collectVersionVariables
([
mysqlDependency
],
gradleFile
);
const
propertyFile
=
'
mysqlVersion=6.0.5
'
;
const
updatedGradleFile
=
updateGradleVersion
(
propertyFile
,
mysqlDependency
,
'
7.0.0
'
);
expect
(
updatedGradleFile
).
toEqual
(
'
mysqlVersion=7.0.0
'
);
});
it
(
'
should replace a external variable assigned to a map dependency
'
,
()
=>
{
it
(
'
should replace a external variable assigned to a map dependency
'
,
()
=>
{
const
gradleFile
=
`compile group : 'mysql' ,
const
gradleFile
=
`compile group : 'mysql' ,
name : 'mysql-connector-java',
name : 'mysql-connector-java',
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment