Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a7f3c5b

Browse files
committedMay 15, 2024
Fix CI, csproj
1 parent a70a569 commit a7f3c5b

File tree

5 files changed

+37
-4
lines changed

5 files changed

+37
-4
lines changed
 

‎.github/workflows/ci_examples_java.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ jobs:
6262
# A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports.
6363
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
6464

65+
- name: Regenerate code using smithy-dafny if necessary
66+
if: ${{ github.event_name == 'schedule' || inputs.nightly }}
67+
uses: ./.github/actions/polymorph_codegen
68+
with:
69+
dafny: ${{ env.DAFNY_VERSION }}
70+
library: DynamoDbEncryption
71+
diff-generated-code: false
72+
update-and-regenerate-mpl: true
73+
6574
- name: Build and locally deploy dependencies for examples
6675
shell: bash
6776
working-directory: ./DynamoDbEncryption

‎.github/workflows/ci_test_java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
6060

6161
- name: Regenerate code using smithy-dafny if necessary
62-
if: ${{ inputs.nightly }}
62+
if: ${{ github.event_name == 'schedule' || inputs.nightly }}
6363
uses: ./.github/actions/polymorph_codegen
6464
with:
6565
dafny: ${{ env.DAFNY_VERSION }}

‎.github/workflows/ci_test_net.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
6767

6868
- name: Regenerate code using smithy-dafny if necessary
69-
if: ${{ inputs.nightly }}
69+
if: ${{ github.event_name == 'schedule' || inputs.nightly }}
7070
uses: ./.github/actions/polymorph_codegen
7171
with:
7272
dafny: ${{ env.DAFNY_VERSION }}

‎.github/workflows/ci_verification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
5555

5656
- name: Regenerate code using smithy-dafny if necessary
57-
if: ${{ inputs.nightly }}
57+
if: ${{ github.event_name == 'schedule' || inputs.nightly }}
5858
uses: ./.github/actions/polymorph_codegen
5959
with:
6060
dafny: ${{ env.DAFNY_VERSION }}

‎DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,35 @@
3131
<NoWarn>CS0105,CS0618</NoWarn>
3232
</PropertyGroup>
3333

34+
<PropertyGroup>
35+
<!-- This is somewhat brittle,
36+
but having the value in a properties file
37+
that can be shared is worth it.
38+
See: https://learn.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2022
39+
for more details on property functions
40+
41+
This takes a properties file (a=b)
42+
1. Loads the file
43+
2. Splits on `dafnyVersion=` and takes everything to the right of that
44+
e.g. the version + any trailing data
45+
3. Splits on newline and takes the second element.
46+
This SHOULD be the value of `dafnyVersion` and not contain any trailing data
47+
-->
48+
<projectProperties>
49+
$([System.IO.File]::ReadAllText('$(MSBuildProjectDirectory)/../../../project.properties'))
50+
</projectProperties>
51+
<dropBeforeDafnyVersionProperty>
52+
$([System.Text.RegularExpressions.Regex]::Split("$(projectProperties)", "dafnyVersion=")[1])
53+
</dropBeforeDafnyVersionProperty>
54+
<DafnyVersion>
55+
$([System.Text.RegularExpressions.Regex]::Split("$(dropBeforeDafnyVersionProperty)", "\n")[1])
56+
</DafnyVersion>
57+
</PropertyGroup>
3458

3559
<ItemGroup>
3660
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.300.2"/>
3761
<PackageReference Include="AWSSDK.Core" Version="3.7.300.2"/>
38-
<PackageReference Include="DafnyRuntime" Version="4.2.0" />
62+
<PackageReference Include="DafnyRuntime" Version="$(DafnyVersion)" />
3963
<ProjectReference Include="../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj"/>
4064
<!--
4165
System.Collections.Immutable can be removed once dafny.msbuild is updated with

0 commit comments

Comments
 (0)
Please sign in to comment.