-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gradle): gradle wrapper execution files updates #5842
Conversation
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
@viceice The build ( |
Java install is skipped on mac, so skip gradle tests or install java |
@viceice Can you enable the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please skip gradle test if process.env.SKIP_JAVA_TESTS==='true'
https://github.com/renovatebot/renovate/blob/master/lib/manager/gradle/__testutil__/gradle.ts#L10
https://github.com/renovatebot/renovate/blob/master/lib/manager/gradle/gradle-updates-report.spec.ts#L23
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
dc6bf80
to
054d9b4
Compare
Co-Authored-By: Michael Kriese <michael.kriese@visualon.de>
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test needs fix
536d5c0
to
5ac430b
Compare
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
5ac430b
to
7a4e518
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soory, forgot to mentions that we need to add docker compatibillity. see below for invoking gradle with docker
renovate/lib/manager/gradle/index.ts
Lines 34 to 100 in a1c14f0
function gradleWrapperFileName(config: ExtractConfig): string { | |
if ( | |
os.platform() === 'win32' && | |
config.binarySource !== BinarySource.Docker | |
) { | |
return 'gradlew.bat'; | |
} | |
return './gradlew'; | |
} | |
async function prepareGradleCommandLine( | |
config: ExtractConfig, | |
cwd: string, | |
gradlew: Stats | null | |
): Promise<string> { | |
const args = GRADLE_DEPENDENCY_REPORT_OPTIONS; | |
const gradlewName = gradleWrapperFileName(config); | |
/* eslint-disable no-bitwise */ | |
// istanbul ignore if | |
if (gradlew?.isFile() === true) { | |
// if the file is not executable by others | |
if ((gradlew.mode & 0o1) === 0) { | |
// add the execution permission to the owner, group and others | |
await fs.chmod(upath.join(cwd, gradlewName), gradlew.mode | 0o111); | |
} | |
return `${gradlewName} ${args}`; | |
} | |
/* eslint-enable no-bitwise */ | |
return `gradle ${args}`; | |
} | |
export async function executeGradle( | |
config: ExtractConfig, | |
cwd: string, | |
gradlew: Stats | null | |
): Promise<void> { | |
let stdout: string; | |
let stderr: string; | |
const timeout = | |
config.gradle && config.gradle.timeout | |
? config.gradle.timeout * 1000 | |
: undefined; | |
const cmd = await prepareGradleCommandLine(config, cwd, gradlew); | |
const execOptions: ExecOptions = { | |
timeout, | |
cwd, | |
docker: { | |
image: 'renovate/gradle', | |
}, | |
}; | |
try { | |
logger.debug({ cmd }, 'Start gradle command'); | |
({ stdout, stderr } = await exec(cmd, execOptions)); | |
} catch (err) /* istanbul ignore next */ { | |
if (err.code === TIMEOUT_CODE) { | |
const error = new DatasourceError(err); | |
error.datasource = 'gradle'; | |
throw error; | |
} | |
logger.warn({ errMessage: err.message }, 'Gradle extraction failed'); | |
return; | |
} | |
logger.debug(stdout + stderr); | |
logger.debug('Gradle report complete'); |
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
4945b2a
to
4e6ff01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, looks like github has some trouble with the macos workers. So wee need to wait and hope it will be resolved tomorrow.
@viceice One |
see #5851 |
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
Co-Authored-By: Michael Kriese <michael.kriese@visualon.de>
Signed-off-by: Mikhail Yakushin <driver733@gmail.com>
🎉 This PR is included in version 19.192.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Closes #3565