Commit e9d3a0d
committed
Unify run/create-expected-result scripts
Standardize result directory handling across all examples by
parameterizing run.sh scripts and eliminating code duplication
in create-expected-result.sh scripts.
Changes:
1. Parameterize result directory in run.sh (29 scripts):
- Add result_dir parameter: result_dir="${1:-run-result}"
- Setup result directory with cleanup: rm -rf/mkdir -p/touch
- Replace hardcoded "run-result/" with "${result_dir}/"
- Ensure all tee commands use -a flag for appending
- Proper ordering: source ../env.sh before result_dir setup
2. Refactor create-expected-result.sh to use ./run.sh (29 scripts):
- Replace duplicated Java command logic with: ./run.sh expected-result
- Eliminates code duplication (~184 lines removed)
- Ensures consistency between run and expected results
- Single source of truth for run logic
Benefits:
- Consistent pattern across all non-Maven/Gradle examples (35/40)
- Eliminated duplicate run logic in create-expected-result scripts
- Easier maintenance: changes only needed in one place (run.sh)
- Guaranteed consistency between actual runs and expected results
Statistics:
- 64 files changed: 341 insertions(+), 357 deletions(-)
- 35 examples now use parameterized result_dir (87.5%)
- All 35 create-expected-result scripts use ./run.sh pattern (100%)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Introduced in the course of support-and-care/maven-support-and-care#1371 parent 34f8908 commit e9d3a0d
File tree
64 files changed
+341
-357
lines changed- jigsaw-examples
- example_addExports_manifest
- example_addReads_addExports_reflection
- example_addReads_addExports
- example_annotations
- example_derived_private-package-protected
- example_exceptions
- example_interface-callback
- example_jerrymouse
- expected-result
- example_layer-hierarchy
- example_layer-modules-all-in-boot-layer
- example_layer-modules-grouped-in-hierarchy
- example_layer-modules-module-resolution
- example_reflection
- example_requires-static
- example_requires_exports-to
- example_requires_exports_requires-transitive_exports-to
- example_requires_exports
- example_resources
- example_splitpackage_automatic-modules
- example_splitpackage
- example_test
- example_unnamed-module_access-from-automatic-module
- example_unnamed-module_access-from-explicit-module-reflection
- example_unnamed-module_access-from-explicit-module
- example_unnamed-module_accessing-module-path
- example_uses-provides_uses-in-client
- example_uses-provides
- example_version
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
64 files changed
+341
-357
lines changedLines changed: 2 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 14 | + | |
| 15 | + | |
29 | 16 | | |
30 | 17 | | |
31 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
5 | 12 | | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
11 | | - | |
| 18 | + | |
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
18 | | - | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
Lines changed: 2 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 14 | + | |
| 15 | + | |
27 | 16 | | |
28 | 17 | | |
29 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
11 | | - | |
12 | | - | |
13 | 19 | | |
14 | | - | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
22 | | - | |
| 28 | + | |
Lines changed: 2 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 14 | + | |
| 15 | + | |
24 | 16 | | |
25 | 17 | | |
26 | 18 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | | - | |
10 | | - | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| |||
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | | - | |
| 25 | + | |
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 14 | + | |
| 15 | + | |
21 | 16 | | |
22 | 17 | | |
23 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
11 | | - | |
12 | | - | |
13 | 19 | | |
14 | | - | |
| 20 | + | |
15 | 21 | | |
16 | | - | |
| 22 | + | |
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 14 | + | |
| 15 | + | |
21 | 16 | | |
22 | 17 | | |
23 | 18 | | |
| |||
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
11 | | - | |
12 | | - | |
13 | 19 | | |
14 | | - | |
| 20 | + | |
15 | 21 | | |
16 | | - | |
| 22 | + | |
0 commit comments