Commit 25e127e3 authored by Charles Ferguson's avatar Charles Ferguson
Browse files

Update the tools used by perl to be defined in the perl script.

The tools were fixed installing specific versions, but that's not a
lot of good if you're trying to allow the environment to be generic.
The code has been pinched from the Python common code, which allows
the configuration to be used to set up the versions of the tools
that are to be used.
parent 07c84e68
...@@ -5,6 +5,21 @@ ...@@ -5,6 +5,21 @@
set -eo pipefail set -eo pipefail
# Defaults for the tools we shall use
perl_tool_coverage='cover'
perl_tool_lint='perlcritic'
# Default versions of the tools
perl_toolversion_cover='1.25'
perl_toolversion_perlcritic='1.126'
# And the definitions of what we need in requirements
perl_tool_coverage_1_25='Devel::Cover@1.25'
perl_tool_perlcritic_1_126="
PPI@1.220
Perl::Critic@1.126
Perl::Critic::Pulp@93
"
## ##
# Is perl active for this action? # Is perl active for this action?
...@@ -58,6 +73,16 @@ function perl_environment() { ...@@ -58,6 +73,16 @@ function perl_environment() {
source "${scripts}/perl-env" -e "${root}/perllib" source "${scripts}/perl-env" -e "${root}/perllib"
} }
function perl_tool_requirements() {
local action="$1"
local reqs
reqs="$(tool_config_expansion perl "$action")"
local req
for req in $reqs ; do
echo -n " +$req"
done
}
function perl_environment_test() { function perl_environment_test() {
perl_environment +PadWalker@2.2 \ perl_environment +PadWalker@2.2 \
"${root}/cpan.txt" \ "${root}/cpan.txt" \
...@@ -66,19 +91,23 @@ function perl_environment_test() { ...@@ -66,19 +91,23 @@ function perl_environment_test() {
} }
function perl_environment_coverage() { function perl_environment_coverage() {
perl_environment +PadWalker@2.2 +Devel::Cover@1.25 \ perl_environment +PadWalker@2.2 \
"${root}/cpan.txt" \ "${root}/cpan.txt" \
"${root}/cpan-test.txt" \ "${root}/cpan-test.txt" \
"${root}/cpan-coverage.txt" \ "${root}/cpan-coverage.txt" \
"${scripts}/cpan-test.txt" \ "${scripts}/cpan-test.txt" \
"${scripts}/cpan-coverage.txt" "${scripts}/cpan-coverage.txt" \
$(perl_tool_requirements coverage)
} }
function perl_environment_lint() { function perl_environment_lint() {
perl_environment +PadWalker@2.2 +Perl::Critic@1.126 +PPI@1.220 \ perl_environment +PadWalker@2.2 \
"${root}/cpan.txt" \ "${root}/cpan.txt" \
"${root}/cpan-test.txt" \
"${root}/cpan-lint.txt" \ "${root}/cpan-lint.txt" \
"${scripts}/cpan-lint.txt" "${scripts}/cpan-test.txt" \
"${scripts}/cpan-lint.txt" \
$(perl_tool_requirements lint)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment