-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
95 lines (77 loc) · 3.53 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
PROJECT_ROOT := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
# This finds all Dafny projects in this repository
# This makes building root level targets for each project easy
PROJECTS = $(shell find . -mindepth 2 -maxdepth 2 -type f -name "Makefile" | fgrep -v smithy-dafny | xargs dirname | xargs basename)
verify:
$(foreach PROJECT, $(PROJECTS), \
$(MAKE) -C $(PROJECT) verify CORES=4 && \
) true
dafny-reportgenerator:
$(foreach PROJECT, $(PROJECTS), \
$(MAKE) -C $(PROJECT) dafny-reportgenerator && \
) true
clean-dafny-report:
$(foreach PROJECT, $(PROJECTS), \
$(MAKE) -C $(PROJECT) clean-dafny-report && \
) true
format_dafny:
$(foreach PROJECT, $(PROJECTS), \
$(MAKE) -C $(PROJECT) format_dafny && \
) true
format_net:
$(foreach PROJECT, $(PROJECTS), \
$(MAKE) -C $(PROJECT) format_net && \
) true
format_java_misc:
npx prettier --plugin=prettier-plugin-java . --write
format_java_misc-check:
npx prettier --plugin=prettier-plugin-java . --check
setup_prettier:
npm i --no-save prettier@3 [email protected]
polymorph_code_gen:
$(foreach PROJECT, $(PROJECTS), \
$(MAKE) -C $(PROJECT) polymorph_code_gen && \
) true
setup_semantic_release:
npm i --no-save semantic-release @semantic-release/changelog semantic-release-replace-plugin @semantic-release/git @semantic-release/exec
run_semantic_release:
npx semantic-release --no-ci
dry_run_semantic_release:
npx semantic-release --dry-run
duvet: | duvet_extract duvet_report
duvet_extract:
rm -rf compliance
$(foreach file, $(shell find aws-encryption-sdk-specification/framework -name '*.md'), duvet extract -o compliance -f MARKDOWN $(file);)
# $(foreach file, $(shell find aws-encryption-sdk-specification/client-apis -name '*.md'), duvet extract -o compliance -f MARKDOWN $(file);)
# $(foreach file, $(shell find aws-encryption-sdk-specification/data-format -name '*.md'), duvet extract -o compliance -f MARKDOWN $(file);)
duvet_report:
duvet \
report \
--spec-pattern "compliance/**/*.toml" \
--source-pattern "AwsCryptographicMaterialProviders/dafny/**/src/**/*.dfy" \
--source-pattern "AwsCryptographicMaterialProviders/dafny/**/test/**/*.dfy" \
--source-pattern "AwsCryptographicMaterialProviders/dafny/**/Model/**/*.smithy" \
--source-pattern "AwsCryptographicMaterialProviders/compliance_exceptions/**/*.txt" \
--source-pattern "TestVectorsAwsCryptographicMaterialProviders/compliance_exceptions/**/*.txt" \
--source-pattern "(# //=,# //#).github/workflows/duvet.yaml" \
--source-pattern "TestVectorsAwsCryptographicMaterialProviders/dafny/**/src/**/*.dfy" \
--html specification_compliance_report.html
# Generate the top-level project.properties file using smithy-dafny.
# This is for the benefit of the nightly Dafny CI,
# to verify that everything works with the latest Dafny prerelease.
# We use smithy-dafny rather than just cat-ing the file directly
# because smithy-dafny currently maintains the knowledge
# of how Dafny release versions maps to Dafny runtime library versions,
# especially prerelease versions like 4.4.0-nightly-2024-01-30-908f95f.
generate_properties_file:
cd smithy-dafny/codegen/smithy-dafny-codegen-cli; \
./../gradlew run --args="\
--dafny-version ${DAFNY_VERSION} \
--library-root $(PROJECT_ROOT)/StandardLibrary \
--model $(PROJECT_ROOT)/StandardLibrary/Model \
--dependent-model $(PROJECT_ROOT)/StandardLibrary/Model \
--namespace aws.polymorph \
--properties-file $(PROJECT_ROOT)/project.properties \
";