Skip to content

Commit

Permalink
fix(manager/gradle): Add support for GCV 2.23.0 (renovatebot#29874)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestoyer authored and bryannaegele committed Jul 8, 2024
1 parent 6b9a6a3 commit 5159076
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ describe('modules/manager/gradle/extract/consistent-versions-plugin', () => {
expect(usesGcv('versions.props', fsMock)).toBeTrue();
});

it('detects lock file header introduced with gradle-consistent-versions version 2.23.0', () => {
const fsMock = {
'build.gradle.kts': `(this file contains) 'com.palantir.consistent-versions'`,
'versions.props': `org.apache.lucene:* = 1.2.3`,
'versions.lock': stripIndent`
# Run ./gradlew writeVersionsLocks to regenerate this file
org.apache.lucene:lucene-core:1.2.3`,
};

expect(usesGcv('versions.props', fsMock)).toBeTrue();
});

it('gradle-consistent-versions plugin correct position for CRLF and LF', () => {
const crlfProps = parsePropsFile(`a.b:c.d=1\r\na.b:c.e=2`);
expect(crlfProps).toBeArrayOfSize(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isDependencyString, versionLikeSubstring } from '../utils';
export const VERSIONS_PROPS = 'versions.props';
export const VERSIONS_LOCK = 'versions.lock';
export const LOCKFIlE_HEADER_TEXT = regEx(
/^# Run \.\/gradlew (?:--write-locks|writeVersionsLock) to regenerate this file/,
/^# Run \.\/gradlew (?:--write-locks|writeVersionsLock|writeVersionsLocks) to regenerate this file/,
);

/**
Expand Down

0 comments on commit 5159076

Please sign in to comment.