forked from dagolden/Dist-Zilla-Plugin-OSPrereqs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Munge both Makefile.PL and Build.PL if specified.
dagolden#4 Thanks to @karenetheridge for the report. ---- I hereby disclaim any implicit or explicit ownership of my changes in this changeset, and put them under a multiple licence consisting of your choice of one of more of: - The CC0 / Public Domain - https://creativecommons.org/choose/zero/ . - The MIT / Expat license - https://en.wikipedia.org/wiki/MIT_License - The default licence of your project - The https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License - version 2.1 or higher - The https://en.wikipedia.org/wiki/GNU_General_Public_License - version 2 or higher - Any licence in the 2018-Aug-27 popular licenses list of https://opensource.org/licenses - The https://en.wikipedia.org/wiki/Apache_License version 2.0 or later - The https://en.wikipedia.org/wiki/Artistic_License version 2.0 or later - The https://en.wikipedia.org/wiki/ISC_license - The https://opensource.org/licenses/BSD-2-Clause Crediting me will be nice, but not mandatory, and you can change the licence of the project without needing my permission.
- Loading branch information
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name = DZ3 | ||
version = 0.001 | ||
author = E. Xavier Ample <[email protected]> | ||
license = Perl_5 | ||
copyright_holder = E. Xavier Ample | ||
|
||
[@Filter] | ||
bundle = @FakeClassic | ||
remove = ConfirmRelease | ||
remove = FakeRelease | ||
|
||
[ModuleBuild] | ||
[OSPrereqs / MSWin32] | ||
Win32API::File = 0.11 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use strict; | ||
use warnings; | ||
package DZ1; | ||
# ABSTRACT: this is a sample package for testing Dist::Zilla; | ||
|
||
sub main { | ||
return 1; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use lib 't/lib'; | ||
|
||
use Test::More 0.88; | ||
|
||
use Test::DZil; | ||
|
||
my $tzil = Builder->from_config( { dist_root => 'corpus/DZ6' }, ); | ||
|
||
$tzil->build; | ||
|
||
my $contents = $tzil->slurp_file('build/Build.PL'); | ||
|
||
my $conditional = q|if ( $^O eq 'MSWin32' ) {|; | ||
my $prereq = q|$module_build_args{requires}{'Win32API::File'} = '0.11'|; | ||
|
||
like( | ||
$contents, | ||
qr/\Q$conditional\E.*?\Q$prereq\E.*?^\}/ms, | ||
"saw MSWin32 conditional in Build.PL" | ||
); | ||
|
||
my $meta = $tzil->slurp_file('build/META.yml'); | ||
like( $meta, qr/dynamic_config: +1/, "dynamic_config is true in META.yml" ); | ||
|
||
$contents = $tzil->slurp_file('build/Makefile.PL'); | ||
like( | ||
$contents, | ||
qr/\Q$conditional\E/ms, | ||
"saw MSWin32 conditional in Makefile.PL too" | ||
); | ||
|
||
done_testing; | ||
|