renovate/lib/manager/index.js
Sam Neirinck 87575f49a3 feat: nuget support
Adds basic support for renovating C# project files. The scope is initially limited to:

- .Csproj only (no VB.NET / F#)
- SDK style csproj's only (this is the default in .net core anyway)
- Limited to nuget.org support (no custom repository support)

Closes #935, Closes #2050
2018-06-14 11:17:14 +02:00

61 lines
1.3 KiB
JavaScript

const managerList = [
'bazel',
'buildkite',
'circleci',
'composer',
'docker',
'docker-compose',
'meteor',
'npm',
'nvm',
'pip_requirements',
'travis',
'nuget',
];
const managers = {};
for (const manager of managerList) {
// eslint-disable-next-line global-require,import/no-dynamic-require
managers[manager] = require(`./${manager}`);
}
const languageList = ['node', 'python'];
const get = (manager, name) => managers[manager][name];
const getLanguageList = () => languageList;
const getManagerList = () => managerList;
module.exports = {
get,
getLanguageList,
getManagerList,
};
const managerFunctions = [
'extractDependencies',
'postExtract',
'getPackageUpdates',
'updateDependency',
'supportsLockFileMaintenance',
];
for (const f of managerFunctions) {
module.exports[f] = (manager, ...params) => {
if (managers[manager][f]) {
return managers[manager][f](...params);
}
return null;
};
}
module.exports.getRangeStrategy = config => {
const { manager, rangeStrategy } = config;
if (managers[manager].getRangeStrategy) {
// Use manager's own function if it exists
return managers[manager].getRangeStrategy(config);
}
if (rangeStrategy === 'auto') {
// default to 'replace' for auto
return 'replace';
}
return config.rangeStrategy;
};