jhthorsen / app-git-ship Goto Github PK
View Code? Open in Web Editor NEWGit command for shipping your project
Git command for shipping your project
I have a .ship.conf
that refers to the main module path thus:
$ cat .ship.conf
main_module_path = lib/AppName.pm
This results in the following error with git ship build
.
Can't use string ("lib/AppName.pm") as an ARRAY ref while "strict refs" in use at local/lib/perl5/App/git/ship/perl.pm line 209.
Calling git ship build
as GIT_SHIP_MAIN_MODULE_PATH=lib/AppName.pm git ship build
resolves the error but is tedious.
It looks like this line expects the config value to be a Mojo::File
object, as is the case elsewhere too.
diff --git a/lib/App/git/ship/perl.pm b/lib/App/git/ship/perl.pm
index 0342d28..0329750 100644
--- a/lib/App/git/ship/perl.pm
+++ b/lib/App/git/ship/perl.pm
@@ -155,7 +155,7 @@ sub _build_config_param_contributors {
return decode 'UTF-8', $ENV{GIT_SHIP_CONTRIBUTORS} if $ENV{GIT_SHIP_CONTRIBUTORS};
my @contributors;
- my $module = decode 'UTF-8', $self->config('main_module_path')->slurp;
+ my $module = decode 'UTF-8', path($self->config('main_module_path'))->slurp;
my $contrib_block;
for my $line (split /\n/, $module) {
if ($line =~ $CONTRIB_START_RE) {
@@ -206,7 +206,7 @@ PATH_PART:
sub _build_config_param_project_name {
my $self = shift;
- my @name = @{$self->config('main_module_path')};
+ my @name = @{path($self->config('main_module_path'))};
shift @name if $name[0] eq 'lib';
$name[-1] =~ s!\.pm$!!;
return join '::', @name;
@@ -323,7 +323,7 @@ sub _render_readme {
open my $README, '>:encoding(UTF-8)', 'README.md' or die "Write README.md: $!";
my $parser = Pod::Markdown->new;
$parser->output_fh($README);
- $parser->parse_string_document($self->config('main_module_path')->slurp);
+ $parser->parse_string_document(path($self->config('main_module_path'))->slurp);
say '# Generated README.md' unless $self->SILENT;
}
Where all does author get used? One place is Makefile.PL. And it grabs the author of the user that runs git ship build. For example this very module... Written by @jhthorsen but if I'm an accepted co-author / co-maintainer then I can git ship it myself, but then I become listed as the author. Is that right?
I'm thinking a solution would be to add an author = attribute to .ship.conf that would allow overriding authorship from git's config author.
There is no list of contributors in published code. Technically,
META_MERGE => {
x_contributors => [...],
}
is missing in Makefile.PL
.
I think we should extract them from the pod and not from git log
.
t/perl-basic.t fails:
!! Cannot find project name from lib/App/git/ship.pm: Not a directory
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 20 just after 1.
t/perl-basic.t ..............
Dubious, test returned 20 (wstat 5120, 0x1400)
All 1 subtests passed
Noticed https://metacpan.org/source/CSANDEEP/0.1.1/.ship.conf
The release is bad, I suspect the empty project_name to be the culprit and maybe it should be a required field?
t/perl-start.t fails, probably because /usr/bin/perl is used instead of $^X:
Can't locate Applify.pm in @INC (@INC contains: /tmpfs/.cpan-build/2016011215/App-git-ship-0.20-Yuky5u/lib /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /tmpfs/.cpan-build/2016011215/App-git-ship-0.20-Yuky5u/bin/git-ship line 2.
BEGIN failed--compilation aborted at /tmpfs/.cpan-build/2016011215/App-git-ship-0.20-Yuky5u/bin/git-ship line 2.
2 at t/perl-start.t line 86.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 29 just after 35.
t/perl-start.t ..............
Dubious, test returned 29 (wstat 7424, 0x1d00)
All 35 subtests passed
Another question: why tests run only on linux & darwin? Why not on freebsd?
$ cpanm App::git::ship
--> Working on App::git::ship
Fetching http://www.cpan.org/authors/id/J/JH/JHTHORSEN/App-git-ship-0.19.tar.gz ... OK
Configuring App-git-ship-0.19 ... OK
Scalar found where operator expected at (eval 112) line 1, near "*/$1"
(Missing operator before $1?)
==> Found dependencies: Applify
--> Working on Applify
Fetching http://www.cpan.org/authors/id/J/JH/JHTHORSEN/Applify-0.12.tar.gz ... OK
Configuring Applify-0.12 ... OK
Building and testing Applify-0.12 ... OK
Successfully installed Applify-0.12
Building and testing App-git-ship-0.19 ... OK
Successfully installed App-git-ship-0.19
2 distributions installed
Build fails:
Output from '/usr/bin/make':
cp lib/App/git/ship/perl.pm blib/lib/App/git/ship/perl.pm
cp lib/App/git/ship.pm blib/lib/App/git/ship.pm
make: *** No rule to make target 'script/git-ship.bak', needed by 'blib/script/git-ship.bak'. Stop.
Probably the .bak file here should be removed:
https://metacpan.org/source/JHTHORSEN/App-git-ship-0.34/Makefile.PL#L10
"git ship start" for an existing project: Yeah. It should work for an existing project. Can you make a new issue? I wonder if "git ship build" should also create initial files, unless they exist. ("build" calls "start" if ".ship.conf" doesn't exist)
Whenever a change is done in a new year, the copyright part should be updated in the POD.
Example:
Copyright (C) 2011, Jan Henning Thorsen
...would become:
Copyright (C) 2011-2015, Jan Henning Thorsen
Most of my smoker systems show the following failure --- which looks just like a whitespace issue:
# Failed test 'File Makefile.PL match (?^s:EXE_FILES => \[qw\( bin/e-x-e \)\])'
# at t/Util.pm line 56.
# '# Generated by git-ship. See 'git-ship --man' for help or https://github.com/jhthorsen/app-git-ship
# use ExtUtils::MakeMaker;
# WriteMakefile(
# NAME => 'Perl::Build',
# AUTHOR => 'Slaven Rezic <[email protected]>',
# LICENSE => 'artistic_2',
# ABSTRACT_FROM => 'lib/Perl/Build.pm',
# VERSION_FROM => 'lib/Perl/Build.pm',
# EXE_FILES => [qw(bin/e-x-e)],
# META_MERGE => {
# resources => {
# bugtracker => 'https://github.com/cpansand/perl-build/issues',
# homepage => 'https://github.com/cpansand/perl-build',
# repository => 'https://github.com/cpansand/perl-build',
# },
# },
# BUILD_REQUIRES => {
# 'Test::More' => '0.88'
# }
# ,
# PREREQ_PM => {
# 'perl' => 'v5.10.0'
# }
# ,
# test => {TESTS => (-e 'META.yml' ? 't/*.t' : 't/*.t xt/*.t')},
# );
# '
# doesn't match '(?^s:EXE_FILES => \[qw\( bin/e-x-e \)\])'
# Looks like you failed 1 test of 21.
t/perl-build.t ..............
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/21 subtests
It passes only on systems where this test is skipped (Cannot run with unknown git user
).
ok 1 - some_attr() does not exist
ok 2 - some_attr() injected
ok 3 - some_attr does not exist
ok 4 - some_attr() 123
ok 5 - some_attr exists
ok 6 - got test template
ok 7 - App::git::ship can handle any git project
ok 8 - abort foo
ok 9 - abort foo 123
There is no git in PATH.
Changes is automatically created for you if you set the class to
App::git::ship::perl
I don't think think this is a true statement. When I follow the quick-start guide, I am unable to be successful until I create my own Changes file (with the text "Not Released" as the timestamp).
This error is caused by the die
on line 86, a result of the system
call to $git_ship start lib/Perl/Start.pm
. This test expects the deleted MANIFEST.SKIP to be recreated but is not. The ok
message (which fails) is "MANIFEST.SKIP was regenerated when start autodetect project type".
t/perl-start.t .............. # Workdir is workdir/perl-start
t/perl-start.t .............. 1/? !! 'git commit -m git ship start' failed: 1 (On branch master
Changes not staged for commit:
deleted: MANIFEST.SKIP
no changes added to commit
)
25 at t/perl-start.t line 86.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 29 just after 35.
t/perl-start.t .............. Dubious, test returned 29 (wstat 7424, 0x1d00)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.