Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the printModulePaths task and read modules direct from settings #1460

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,3 @@ plugins {
alias(libs.plugins.room) apply false
alias(libs.plugins.module.graph) apply true // Plugin applied to allow module graph generation
}

// Task to print all the module paths in the project e.g. :core:data
// Used by module graph generator script
tasks.register("printModulePaths") {
subprojects {
if (subprojects.size == 0) {
println(this.path)
}
}
}
15 changes: 14 additions & 1 deletion generateModuleGraphs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ then
exit 1
fi

# Check for a version of grep which supports Perl regex.
# On MacOS the OS installed grep doesn't support Perl regex so check for the existence of the
# GNU version instead which is prefixed with 'g' to distinguish it from the OS installed version.
if grep -P "" /dev/null > /dev/null 2>&1; then
GREP_COMMAND=grep
elif command -v ggrep &> /dev/null; then
GREP_COMMAND=ggrep
else
echo "You don't have a version of 'grep' installed which supports Perl regular expressions."
echo "On MacOS you can install one using Homebrew with the command: 'brew install grep'"
exit 1
fi

# Initialize an array to store excluded modules
excluded_modules=()

Expand All @@ -50,7 +63,7 @@ while [[ $# -gt 0 ]]; do
done

# Get the module paths
module_paths=$(./gradlew -q printModulePaths --no-configuration-cache)
module_paths=$(${GREP_COMMAND} -oP 'include\("\K[^"]+' settings.gradle.kts)

# Ensure the output directory exists
mkdir -p docs/images/graphs/
Expand Down
Loading