Workaround for CS1730 caused by complex AssemblyInfo.cs

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 9 years ago
parent 428cf645fc
commit 0ba3d35537
  1. 12
      BuildServer/lib/tasks/dotnetrewrite.js

@ -5,6 +5,14 @@ var async = require('async');
var glob = require('glob'); var glob = require('glob');
var settings = require('../../settings'); var settings = require('../../settings');
var addAssemblyAttribute = function (content, attribute) {
var regex = /\[\s*assembly/;
if (regex.test(content)) {
return content.replace(regex, attribute + "\r\n[assembly");
}
return content + attribute + "\r\n";
}
module.exports = function (params, processor) { module.exports = function (params, processor) {
return { return {
process: function () { process: function () {
@ -49,9 +57,9 @@ module.exports = function (params, processor) {
return "InternalsVisibleTo(\"" + p1 + ",PublicKey=" + settings.codeSigningPublicKey + "\")"; return "InternalsVisibleTo(\"" + p1 + ",PublicKey=" + settings.codeSigningPublicKey + "\")";
} }
); );
content += "[assembly: AssemblyKeyFileAttribute(\"" + settings.codeSigningKeyFile + "\")]\r\n" content = addAssemblyAttribute(content, "[assembly: AssemblyKeyFileAttribute(\"" + settings.codeSigningKeyFile + "\")]\r\n");
} }
content += "[assembly: AssemblyInformationalVersion(\"" + version + "\")]\r\n"; content = addAssemblyAttribute(content, "[assembly: AssemblyInformationalVersion(\"" + version + "\")]");
return cb(null, content); return cb(null, content);
}, },
fs.writeFile.bind(null, processor.context.exported + "/" + file) fs.writeFile.bind(null, processor.context.exported + "/" + file)

Loading…
Cancel
Save