renovate/lib/manager/bazel/resolve.js
Rhys Arkins 987891ba2e
feat: bazel WORKSPACE support (#1268)
This PR adds support for bazel WORKSPACE package files, as suggested https://github.com/alexeagle/angular-bazel-example/issues/17#issuecomment-349167982

Renovate will:
1. Detect `WORKSPACE` files anywhere in the repository
2. Look for all `git_repository()` sections in the file
3. Extract any dependencies with name, remote and tag values
4. Look up any dependencies that (a) have a github https remote, and (b) a valid semver as tag
5. Update the tag to the latest available
2017-12-07 09:22:10 +01:00

18 lines
509 B
JavaScript

const configParser = require('../../config');
module.exports = {
resolvePackageFile,
};
async function resolvePackageFile(config, inputFile) {
const packageFile = configParser.mergeChildConfig(config.bazel, inputFile);
logger.debug(
`Resolving packageFile ${JSON.stringify(packageFile.packageFile)}`
);
packageFile.content = await platform.getFile(packageFile.packageFile);
if (!packageFile.content) {
logger.debug('No packageFile content');
return null;
}
return packageFile;
}