|
15 | 15 | `npx semantic-release --branches main` |
16 | 16 | */ |
17 | 17 |
|
| 18 | +const fs = require("fs"); |
| 19 | + |
| 20 | +/** |
| 21 | + * Function to parse a simple properties file |
| 22 | + * @param {string} filePath - Path to the properties file |
| 23 | + * @returns {Object} Parsed properties as key-value pairs |
| 24 | + */ |
| 25 | +function parsePropertiesFile(filePath) { |
| 26 | + const content = fs.readFileSync(filePath, "utf8"); |
| 27 | + const properties = {}; |
| 28 | + |
| 29 | + content.split("\n").forEach((line) => { |
| 30 | + if (line && !line.startsWith("#") && line.includes("=")) { |
| 31 | + const [key, ...valueParts] = line.split("="); |
| 32 | + properties[key.trim()] = valueParts.join("=").trim(); |
| 33 | + } |
| 34 | + }); |
| 35 | + |
| 36 | + return properties; |
| 37 | +} |
| 38 | + |
| 39 | +// Read your project.properties file |
| 40 | +const props = parsePropertiesFile("./project.properties"); |
| 41 | + |
18 | 42 | // This project has several runtimes |
19 | 43 | // each one has files that need to be updated. |
20 | 44 | // We model all the files and the runtimes here in this structure |
@@ -122,6 +146,13 @@ module.exports = { |
122 | 146 | results: Object.keys(Runtimes.net).map(CheckResults), |
123 | 147 | countMatches: true, |
124 | 148 | }, |
| 149 | + { |
| 150 | + files: Object.keys(Runtimes.net), |
| 151 | + from: '<ProjectReference Include="../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj"/>', |
| 152 | + to: `<PackageReference Include="AWS.Cryptography.MaterialProviders" Version="[${props.mplDependencyNetVersion}]" />`, |
| 153 | + results: Object.keys(Runtimes.net).map(CheckResults), |
| 154 | + countMatches: true, |
| 155 | + }, |
125 | 156 | // Update the AssmeblyInfo.cs file of the DotNet projects |
126 | 157 | ...Object.entries(Runtimes.net).flatMap( |
127 | 158 | ([file, { assemblyInfo }]) => ({ |
|
0 commit comments