Skip to content

Commit

Permalink
Use 'dzil build' to build a complete Gherkin-{VERSION} lib directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuelsmann committed Oct 13, 2023
1 parent 9fd1084 commit 63a22b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions perl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion perl/cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ on 'test' => sub {
};

on 'develop' => sub {
# there are no specific development dependencies...
requires "Dist::Zilla";
};

0 comments on commit 63a22b5

Please sign in to comment.