Skip to content

Commit

Permalink
Fix CI, csproj
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-aws committed May 15, 2024
1 parent a70a569 commit a7f3c5b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci_examples_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ jobs:
# A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports.
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}

- name: Regenerate code using smithy-dafny if necessary
if: ${{ github.event_name == 'schedule' || inputs.nightly }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
library: DynamoDbEncryption
diff-generated-code: false
update-and-regenerate-mpl: true

- name: Build and locally deploy dependencies for examples
shell: bash
working-directory: ./DynamoDbEncryption
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_test_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.nightly }}
if: ${{ github.event_name == 'schedule' || inputs.nightly }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_test_net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.nightly }}
if: ${{ github.event_name == 'schedule' || inputs.nightly }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.nightly }}
if: ${{ github.event_name == 'schedule' || inputs.nightly }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
Expand Down
26 changes: 25 additions & 1 deletion DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,35 @@
<NoWarn>CS0105,CS0618</NoWarn>
</PropertyGroup>

<PropertyGroup>
<!-- This is somewhat brittle,
but having the value in a properties file
that can be shared is worth it.
See: https://learn.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2022
for more details on property functions
This takes a properties file (a=b)
1. Loads the file
2. Splits on `dafnyVersion=` and takes everything to the right of that
e.g. the version + any trailing data
3. Splits on newline and takes the second element.
This SHOULD be the value of `dafnyVersion` and not contain any trailing data
-->
<projectProperties>
$([System.IO.File]::ReadAllText('$(MSBuildProjectDirectory)/../../../project.properties'))
</projectProperties>
<dropBeforeDafnyVersionProperty>
$([System.Text.RegularExpressions.Regex]::Split("$(projectProperties)", "dafnyVersion=")[1])
</dropBeforeDafnyVersionProperty>
<DafnyVersion>
$([System.Text.RegularExpressions.Regex]::Split("$(dropBeforeDafnyVersionProperty)", "\n")[1])
</DafnyVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.300.2"/>
<PackageReference Include="AWSSDK.Core" Version="3.7.300.2"/>
<PackageReference Include="DafnyRuntime" Version="4.2.0" />
<PackageReference Include="DafnyRuntime" Version="$(DafnyVersion)" />
<ProjectReference Include="../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj"/>
<!--
System.Collections.Immutable can be removed once dafny.msbuild is updated with
Expand Down

0 comments on commit a7f3c5b

Please sign in to comment.