diff --git a/perl/Makefile b/perl/Makefile index e5a7838b6..a1a3ef547 100644 --- a/perl/Makefile +++ b/perl/Makefile @@ -17,7 +17,7 @@ SOURCES = $(patsubst ../testdata/%,acceptance/testdata/%.source.ndjson,$(GO ERRORS = $(patsubst ../testdata/%,acceptance/testdata/%.errors.ndjson,$(BAD_FEATURE_FILES)) .DEFAULT_GOAL = help -PERL5LIB = $$PWD/perl5/lib/perl5 +PERL5LIB = $$PWD/perl5/lib/perl5:Gherkin-$(shell cat VERSION)/lib GHERKIN = PERL5LIB=${PERL5LIB} bin/gherkin GHERKIN_GENERATE_TOKENS = PERL5LIB=${PERL5LIB} bin/gherkin-generate-tokens @@ -37,22 +37,20 @@ clean-gherkin-languages: ## Remove gherkin-languages.json and any derived files echo "TODO: Depends on perl, this task should only depend on jq" clean: ## Remove all build artifacts and files generated by the acceptance tests - rm -f .built + PERL5LIB=${PERL5LIB} dzil clean rm -rf acceptance rm -rf perl5 .DELETE_ON_ERROR: -acceptance: .built lib/Gherkin/Generated/Languages.pm $(TOKENS) $(ASTS) $(PICKLES) $(SOURCES) $(ERRORS) ## Build acceptance test dir and compare results with reference +acceptance: Gherkin-$(shell cat VERSION) $(TOKENS) $(ASTS) $(PICKLES) $(SOURCES) $(ERRORS) ## Build acceptance test dir and compare results with reference -.built: perl5 $(SOURCE_FILES) - touch $@ +Gherkin-$(shell cat VERSION): perl5 $(SOURCE_FILES) + PERL5LIB=${PERL5LIB} dzil build perl5: cpanm --notest --local-lib ./perl5 --installdeps --with-develop . - -lib/Gherkin/Generated/Languages.pm: - perl helper-scripts/build_languages.pl > $@ + PERL5LIB=${PERL5LIB} dzil authordeps --missing | cpanm --notest --local-lib ./perl5 $(GHERKIN_PARSER): $(GHERKIN_RAZOR) ../gherkin.berp berp -g ../gherkin.berp -t $< -o $@ --noBOM diff --git a/perl/cpanfile b/perl/cpanfile index 23731e1ea..a2190fe41 100644 --- a/perl/cpanfile +++ b/perl/cpanfile @@ -15,5 +15,5 @@ on 'test' => sub { }; on 'develop' => sub { - # there are no specific development dependencies... + requires "Dist::Zilla"; };