Skip to content
Snippets Groups Projects
Commit 0d2427a0 authored by Sho Ikeda's avatar Sho Ikeda Committed by Rhys Arkins
Browse files

fix(gradle): Support extension without classifier (#4050)

parent 64eb9886
No related branches found
No related tags found
No related merge requests found
......@@ -156,7 +156,7 @@ function updatePropertyFileGlobalVariables(
// https://github.com/patrikerdes/gradle-use-latest-versions-plugin/blob/8cf9c3917b8b04ba41038923cab270d2adda3aa6/src/main/groovy/se/patrikerdes/DependencyUpdate.groovy#L27-L29
function moduleStringVersionFormatMatch(dependency) {
return new RegExp(
`(["']${dependency.group}:${dependency.name}:)[^$].*?((:.*?)?["'])`
`(["']${dependency.group}:${dependency.name}:)[^$].*?(([:@].*?)?["'])`
);
}
......
......@@ -37,6 +37,23 @@ describe('lib/manager/gradle/updateGradleVersion', () => {
);
});
it('should returns a file updated with keeping an extension if the version is found', () => {
const gradleFile =
"runtime ( 'com.crashlytics.sdk.android:crashlytics:2.8.0@aar' )";
const updatedGradleFile = gradle.updateGradleVersion(
gradleFile,
{
group: 'com.crashlytics.sdk.android',
name: 'crashlytics',
version: '2.8.0',
},
'2.10.1'
);
expect(updatedGradleFile).toEqual(
"runtime ( 'com.crashlytics.sdk.android:crashlytics:2.10.1@aar' )"
);
});
it('should returns a file updated with keeping a classifier and an extension if the version is found', () => {
const gradleFile = "runtime ( 'junit:junit:4.0:javadoc@jar' )";
const updatedGradleFile = gradle.updateGradleVersion(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment