Skip to content

Commit

Permalink
add dub describe --data=configs,builds
Browse files Browse the repository at this point in the history
supersedes the trivial part of #2204
  • Loading branch information
WebFreak001 committed Sep 4, 2023
1 parent 7d2a2a3 commit d638990
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/dub/project.d
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,10 @@ class Project {
case "post-build-environments":
case "pre-run-environments":
case "post-run-environments":
case "default-config":
case "configs":
case "default-build":
case "builds":
enforce(false, "--data="~requestedData~" can only be used with `--data-list` or `--data-list --data-0`.");
break;

Expand Down Expand Up @@ -1194,6 +1198,10 @@ class Project {
case "post-run-environments": return listBuildSetting!"postRunEnvironments"(args);
case "requirements": return listBuildSetting!"requirements"(args);
case "options": return listBuildSetting!"options"(args);
case "default-config": return [getDefaultConfiguration(settings.platform)];
case "configs": return configurations;
case "default-build": return [builds[0]];
case "builds": return builds;

default:
enforce(false, "--data="~requestedData~
Expand Down
31 changes: 31 additions & 0 deletions test/4-describe-data-1-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ if ! $DUB describe --compiler=$DC --filter-versions \
--data=pre-build-commands \
--data=post-build-commands \
'--data=requirements, options' \
--data=default-config \
--data=configs \
--data=default-build \
--data=builds \
> "$temp_file"; then
die $LINENO 'Printing project data failed!'
fi
Expand Down Expand Up @@ -130,6 +134,33 @@ echo "debugMode" >> "$expected_file"
echo "debugInfo" >> "$expected_file"
echo "stackStomping" >> "$expected_file"
echo "warnings" >> "$expected_file"
echo >> "$expected_file"
# --data=default-config
echo "my-project-config" >> "$expected_file"
echo >> "$expected_file"
# --data=configs
echo "my-project-config" >> "$expected_file"
echo >> "$expected_file"
# --data=default-build
echo "debug" >> "$expected_file"
echo >> "$expected_file"
# --data=builds
echo "debug" >> "$expected_file"
echo "plain" >> "$expected_file"
echo "release" >> "$expected_file"
echo "release-debug" >> "$expected_file"
echo "release-nobounds" >> "$expected_file"
echo "unittest" >> "$expected_file"
echo "profile" >> "$expected_file"
echo "profile-gc" >> "$expected_file"
echo "docs" >> "$expected_file"
echo "ddox" >> "$expected_file"
echo "cov" >> "$expected_file"
echo "cov-ctfe" >> "$expected_file"
echo "unittest-cov" >> "$expected_file"
echo "unittest-cov-ctfe" >> "$expected_file"
echo "syntax" >> "$expected_file"
# echo >> "$expected_file"

if ! diff "$expected_file" "$temp_file"; then
echo "Result:"
Expand Down

0 comments on commit d638990

Please sign in to comment.