Skip to content

Commit ddea2ed

Browse files
authored
Merge pull request #15 from perl-actions/oalders/makefile
add support for Makefile.PL with and without MANIFEST.SKIP (reworks #12)
2 parents 0736be9 + 3fca5a0 commit ddea2ed

File tree

14 files changed

+199
-4
lines changed

14 files changed

+199
-4
lines changed

.github/workflows/compile.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
run: >
3131
git config --global user.email "[email protected]" &&
3232
git config --global user.name "Min Illa"
33-
- name: minil tests
34-
run: bats -t t/minil_module.bats
35-
- name: dzil tests
36-
run: bats -t t/dzil_module.bats
33+
- name: copy bin files
34+
run: cp bin/* /usr/local/bin/
35+
- name: bats tests
36+
run: bats -v && bats t
3737
env:
3838
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
3939
COVERALLS_TOKEN: ${{secrets.COVERALLS_TOKEN}}

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,23 @@
44
/t/test-data/module-build_module/MANIFEST*
55
/t/test-data/module-build_module/Build
66

7+
/t/test-data/extutils-makemaker-module-with-manifest.skip/Acme-Helpers-*
8+
/t/test-data/extutils-makemaker-module-with-manifest.skip/MANIFEST
9+
/t/test-data/extutils-makemaker-module-with-manifest.skip/MYMETA.*
10+
/t/test-data/extutils-makemaker-module-with-manifest.skip/Makefile
11+
/t/test-data/extutils-makemaker-module-with-manifest.skip/blib/
12+
/t/test-data/extutils-makemaker-module-with-manifest.skip/pm_to_blib
13+
/t/test-data/extutils-makemaker-module-with-manifest.skip/MANIFEST.bak
14+
/t/test-data/extutils-makemaker-module-with-manifest.skip/build_dir/
15+
/t/test-data/extutils-makemaker-module-with-manifest.skip/cover_db/
16+
17+
18+
/t/test-data/extutils-makemaker-module-with-manifest/Acme-Helpers-*
19+
/t/test-data/extutils-makemaker-module-with-manifest/MYMETA.*
20+
/t/test-data/extutils-makemaker-module-with-manifest/Makefile
21+
/t/test-data/extutils-makemaker-module-with-manifest/blib/
22+
/t/test-data/extutils-makemaker-module-with-manifest/pm_to_blib
23+
/t/test-data/extutils-makemaker-module-with-manifest/MANIFEST.bak
24+
/t/test-data/extutils-makemaker-module-with-manifest/build_dir/
25+
/t/test-data/extutils-makemaker-module-with-manifest/cover_db/
26+

bin/build-dist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ elif [[ -e Build.PL ]]; then
2626
# the last created dir and use that.
2727
DIR="$(perl -MModule::Build -e'print Module::Build->resume->dist_dir;')"
2828
mv "$DIR" "$BUILD_DIR"
29+
elif [[ -e Makefile.PL ]]; then
30+
rm -rf "$BUILD_DIR"
31+
perl Makefile.PL
32+
make
33+
if [[ -e MANIFEST.SKIP ]]; then
34+
make manifest
35+
fi
36+
make distdir
37+
38+
# same as with minil
39+
# shellcheck disable=SC2012
40+
DIR=$(ls -td -- */ | head -n 1 | cut -d'/' -f1)
41+
mv "$DIR" "$BUILD_DIR"
2942
fi
3043

3144
exit 0
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bats
2+
3+
PATH="$PATH:../../../bin"
4+
5+
setup() {
6+
cd t/test-data/extutils-makemaker-module-with-manifest || exit 1
7+
}
8+
9+
@test "Makefile.PL cpan-install-dist-deps" {
10+
run cpan-install-build-deps
11+
[ "$status" -eq 0 ]
12+
}
13+
14+
@test "Makefile.PL build-dist" {
15+
run build-dist
16+
[ "$status" -eq 0 ]
17+
}
18+
19+
@test "Makefile.PL test-dist" {
20+
run cd build_dir && test-dist
21+
[ "$status" -eq 0 ]
22+
}
23+
24+
@test "Makefile.PL auto-build-and-test-dist" {
25+
GITHUB_ACTIONS=${GITHUB_ACTIONS:=''}
26+
if [[ $GITHUB_ACTIONS = true ]]; then
27+
skip "Tricky to test under CI"
28+
fi
29+
run rm -rf build_dir && bash auto-build-and-test-dist && rm -rf build_dir
30+
[ "$status" -eq 0 ]
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bats
2+
3+
PATH="$PATH:../../../bin"
4+
5+
setup() {
6+
cd t/test-data/extutils-makemaker-module-with-manifest.skip || exit 1
7+
}
8+
9+
@test "Makefile.PL cpan-install-dist-deps" {
10+
run cpan-install-build-deps
11+
[ "$status" -eq 0 ]
12+
}
13+
14+
@test "Makefile.PL build-dist" {
15+
run build-dist
16+
[ "$status" -eq 0 ]
17+
}
18+
19+
@test "Makefile.PL test-dist" {
20+
run cd build_dir && test-dist
21+
[ "$status" -eq 0 ]
22+
}
23+
24+
@test "Makefile.PL auto-build-and-test-dist" {
25+
GITHUB_ACTIONS=${GITHUB_ACTIONS:=''}
26+
if [[ $GITHUB_ACTIONS = true ]]; then
27+
skip "Tricky to test under CI"
28+
fi
29+
run rm -rf build_dir && bash auto-build-and-test-dist && rm -rf build_dir
30+
[ "$status" -eq 0 ]
31+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.*\.gz
2+
\.git/
3+
blib/
4+
MANIFEST.bak
5+
MANIFEST.SKIP
6+
pm_to_blib
7+
Makefile$
8+
.gitignore
9+
^eg/.*
10+
.travis.yml
11+
README.md
12+
.vscode/
13+
.*\.db
14+
MYMETA.*
15+
\.github/.*
16+
docs/.*
17+
cover_db/.*
18+
19+
Acme-Helpers-.*
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use strict;
2+
use warnings;
3+
4+
use ExtUtils::MakeMaker;
5+
WriteMakefile(
6+
NAME => 'Acme::Helpers',
7+
AUTHOR => 'Gabor Szabo <[email protected]>',
8+
VERSION => '1.00',
9+
ABSTRACT => 'Acme',
10+
LICENSE => 'perl',
11+
);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package Acme::Helpers;
2+
3+
use strict;
4+
use warnings;
5+
6+
our $VERSION = '0.01';
7+
8+
sub true {
9+
return 1;
10+
}
11+
12+
1;
13+
14+
# ABSTRACT: turns baubles into trinkets
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use strict;
2+
use warnings;
3+
4+
use Test::More;
5+
6+
use Acme::Helpers ();
7+
ok( Acme::Helpers::true() );
8+
9+
done_testing();
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lib/Acme/Helpers.pm
2+
Makefile.PL
3+
MANIFEST This list of files
4+
t/load.t

0 commit comments

Comments
 (0)