Skip to content

Commit be3f58f

Browse files
authored
chore(.net): reference submoduled mpl (#2080)
1 parent fdaa9e3 commit be3f58f

4 files changed

Lines changed: 35 additions & 2 deletions

File tree

.releaserc.cjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@
1515
`npx semantic-release --branches main`
1616
*/
1717

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+
1842
// This project has several runtimes
1943
// each one has files that need to be updated.
2044
// We model all the files and the runtimes here in this structure
@@ -122,6 +146,13 @@ module.exports = {
122146
results: Object.keys(Runtimes.net).map(CheckResults),
123147
countMatches: true,
124148
},
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+
},
125156
// Update the AssmeblyInfo.cs file of the DotNet projects
126157
...Object.entries(Runtimes.net).flatMap(
127158
([file, { assemblyInfo }]) => ({

DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
<!-- See https://learn.microsoft.com/en-us/nuget/concepts/package-versioning?tabs=semver20sort#version-ranges -->
6262
<PackageReference Include="AWSSDK.Core" Version="[3.7.*, 4.0)" />
6363
<PackageReference Include="AWSSDK.DynamoDBv2" Version="[3.7.*, 4.0)" />
64-
<PackageReference Include="AWS.Cryptography.MaterialProviders" Version="[1.11.2]" />
64+
<!-- Before releasing a new DBESDK version ensure to pin the MPL -->
65+
<ProjectReference Include="../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj"/>
6566
<!--
6667
System.Collections.Immutable can be removed once dafny.msbuild is updated with
6768
https://github.com/dafny-lang/dafny.msbuild/pull/10 and versioned

project.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
projectJavaVersion=3.9.1
22
mplDependencyJavaVersion=1.11.2-SNAPSHOT
3+
mplDependencyNetVersion=1.11.2
34
dafnyVersion=4.9.0
45
dafnyVerifyVersion=4.9.1
56
dafnyRuntimeJavaVersion=4.9.0

submodules/MaterialProviders

0 commit comments

Comments
 (0)