Skip to content

Commit

Permalink
Added Ninja generator, examples, Travis
Browse files Browse the repository at this point in the history
Organization:
- moved examples from t/samples to eg/
- added example 002, which uses two C files!
- added example 003, which uses two C files **and two compile nodes**!

Code:
- Added first version of Ninja generator
- Commented out some unused imports
- Fixed bugs when run under Perl 5.18

Documentation:
- added POD to bin/hopen; updated POD in App::hopen
- corrected some references to Data::Hopen
- fixed POD in Ah::Gen::Make::AssetGraphVisitor and
  Ah::T::Gnu::C::LinkCmd

Dependencies:
- Specified version of Data::Dumper

Tests:
- Added Kwalitee test
- Added `use strict` to all modules since Kwalitee doesn't know that
  Data::Hopen::Base applies `use strict` automatically.
- Added Travis configuration; fixed Appveyor configuration
- Added a test of Check and Gen phases using eg/001.
  • Loading branch information
Chris White committed Jun 4, 2019
1 parent 257173d commit 14c9081
Show file tree
Hide file tree
Showing 59 changed files with 924 additions and 207 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ image:

build_script:
# Grab the latest Data::Hopen
- svn export --force https://github.com/hopenbuild/Data-Hopen/trunk/lib
# Thanks to https://stackoverflow.com/a/39317180/2877364
- cpanm https://github.com/hopenbuild/Data-Hopen/tarball/master
# Thanks to https://gist.github.com/keisatou/7499464

# Grab the rest of the dependencies
- cpanm --installdeps --notest --verbose .
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ t/TEMPLATE-dot-t
foo
foo.*
TODO
TODO*

# Things we generate
built/
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Christopher White <[email protected]> <[email protected]>
Christopher White <[email protected]> <[email protected]>
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: perl
perl:
- "5.26"
- "5.26-shrplib"
- "5.20"
- "5.18-shrplib"
- "5.14"
# 5.14 is the minimum Data-Hopen supports

install:
- cpanm ExtUtils::MakeMaker
# Because EUMM v6.66 doesn't seem to generate the correct MYMETA.json,
# causing lib::relative not to be loaded as a dependency. See, e.g.,
# https://travis-ci.org/cxw42/Class-Tiny-ConstrainedAccessor/jobs/535823908

# Grab the latest Data::Hopen
- cpanm https://github.com/hopenbuild/Data-Hopen/tarball/master
# Thanks to https://gist.github.com/keisatou/7499464

# Grab the rest. PERL5LIB=lib + --skip-installed => skip trying to
# grab Data::Hopen, so that we can just use the latest.
- cpanm --with-recommends --verbose --installdeps --notest .
19 changes: 12 additions & 7 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
Revision history for App-hopen

0.000011 2019-06-04
- Added Ninja generator
- Added examples in the `eg/` directory
- Updated documentation

0.000010 2019-05-26
First non-trial release.
Major internal changes. Finished removing Data-Hopen leftovers.
- First non-trial release.
- Major internal changes. Finished removing Data-Hopen leftovers.

0.000009 2019-02-24 (TRIAL RELEASE)
Split former Build-Hopen into App-hopen and Data-Hopen
- Split former Build-Hopen into App-hopen and Data-Hopen

0.000008 2019-02-09 (TRIAL RELEASE)
Tweak File::Glob usage to support Perl 5.14
- Tweak File::Glob usage to support Perl 5.14

0.000007 2019-02-08 (TRIAL RELEASE)
First version that can generate a Makefile
- First version that can generate a Makefile

0.000006 2019-02-06 (TRIAL RELEASE)
Substantially expanded
- Substantially expanded

0.000003 2018-01-02 (TRIAL RELEASE)
First full trial release
- First full trial release
19 changes: 16 additions & 3 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
bin/hopen
Changes
eg/001-single-file-hello/001.hopen.pl
eg/001-single-file-hello/hello.c
eg/001-single-file-hello/README.md
eg/002-double-file-hello/.hopen.pl
eg/002-double-file-hello/hello.c
eg/002-double-file-hello/printmsg.c
eg/002-double-file-hello/README.md
eg/003-double-file-double-compile/.hopen.pl
eg/003-double-file-double-compile/hello.c
eg/003-double-file-double-compile/printmsg.c
eg/003-double-file-double-compile/README.md
lib/App/hopen.pm
lib/App/hopen/AppUtil.pm
lib/App/hopen/Asset.pm
Expand All @@ -12,6 +23,9 @@ lib/App/hopen/Gen.pm
lib/App/hopen/Gen/Make.pm
lib/App/hopen/Gen/Make/AssetGraphNode.pm
lib/App/hopen/Gen/Make/AssetGraphVisitor.pm
lib/App/hopen/Gen/Ninja.pm
lib/App/hopen/Gen/Ninja/AssetGraphNode.pm
lib/App/hopen/Gen/Ninja/AssetGraphVisitor.pm
lib/App/hopen/H.pm
lib/App/hopen/HopenFileKit.pm
lib/App/hopen/Phase.pod
Expand All @@ -35,18 +49,17 @@ support/readme.pl
t/00-load-ah.t
t/005-op.t
t/006-collect-op.t
t/020-dag.t
t/030-util-basedpath.t
t/040-ah-g-assetop.t
t/100-h.t
t/200-apputil-basic.t
t/900-eg-001.t
t/dir200/inner.hopen.pl
t/dir200/inner/.hopen.pl
t/dir200/inner/z.hopen.pl
t/lib/HopenTest.pm
t/samples/01/01.hopen.pl
t/samples/01/hello.c
xt/boilerplate.t
xt/kwalitee.t
xt/manifest.t
xt/pod-coverage.t
xt/pod.t
1 change: 1 addition & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ App-hopen-.*
TODO
\brunhopen$
\.stackdump$
\.mailmap$

# Backup files
\.swp$
Expand Down
11 changes: 6 additions & 5 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ testhere: # Run the tests from lib rather than blib
\tprove -lj4
README.md: @{[$VERSION_FROM]} Makefile.PL $make_readme_md
\t"$secure_perl_path" "$make_readme_md" -i "\$<" -o "\$@" -f md --appveyor cxw42/app-hopen --avbadge hopenbuild/app-hopen
\t"$secure_perl_path" "$make_readme_md" -i "\$<" -o "\$@" -f md --appveyor cxw42/app-hopen --travis hopenbuild/app-hopen
README: @{[$VERSION_FROM]} Makefile.PL $make_readme_md
\t"$secure_perl_path" "$make_readme_md" -i "\$<" -o "\$@" -f text
Expand Down Expand Up @@ -143,7 +143,7 @@ EOT
# Main options for EUMM
my %opts = (
NAME => 'App::hopen',
AUTHOR => q{Christopher White <[email protected]>},
AUTHOR => q{Christopher White <[email protected]>},
VERSION_FROM => $VERSION_FROM,
ABSTRACT_FROM => $VERSION_FROM,
#ABSTRACT => 'The hopen build system, command-line interface',
Expand Down Expand Up @@ -184,15 +184,15 @@ my %opts = (
'rlib' => '0',
'Scalar::Util' => '0',
'Test::Deep' => '0.084', # for superhashof
## 'Test::Directory' => '0.02', # for subdirs
'Test::Directory' => '0.02', # for subdirs
'Test::Exception' => '0',
'Test::More' => '0',
# Test::TempDir::Tiny? If so, remove Test::Directory dependency?
'Test::Warn' => '0.35', # for metadata
},
PREREQ_PM => {
# Other hopen packages -------------------
'Data::Hopen' => '0.000013',
'Data::Hopen' => '0.000014',

# Non-hopen dependencies -----------------
#'Algorithm::Dependency' => '1.106',
Expand All @@ -215,7 +215,7 @@ my %opts = (
'Cwd' => '0',

'constant' => '0',
'Data::Dumper' => '0',
'Data::Dumper' => '2.154', # For Maxrecurse
'Deep::Hash::Utils' => '0.03', # For correct metadata
## 'experimental' => '0.009', # For support on perl < 5.15.7
'Exporter' => '0',
Expand Down Expand Up @@ -300,6 +300,7 @@ my %opts = (
requires => {
'App::RewriteVersion' => '0', # for perl-bump-version
'Module::Metadata' => '1.000016',
'Test::Kwalitee' => '0',
},
},
},
Expand Down
32 changes: 30 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,38 @@ NAME
Why Perl? Because (1) you probably already have it installed, and (2) it
is the original write-once, run-everywhere language!

USAGE
Example
Create a file ".hopen.pl" in your source tree. Then:

$ hopen
From ``.'' into ``built''
Running Check phase

Now "built/MY.hopen.pl" has been created, and loaded with information
about your configuration. You can edit that file if you want to change
what will happen next.

$ hopen
From ``.'' into ``built''
Running Gen phase

Now "built/Makefile" has been created.

$ hopen --build
Building in foo/built

And your software is ready to go!

See App::hopen::Conventions for information on writing ".hopen.pl" files.

SYNOPSIS
hopen [options] [--] [destination dir [project dir]]

If no project directory is specified, the current directory is used.

If no destination directory is specified, "<project dir>/built" is used.

See App::hopen::Conventions for more details.
See App::hopen and App::hopen::Conventions for more details.

OPTIONS
-a "architecture"
Expand Down Expand Up @@ -99,6 +123,10 @@ SUPPORT

<https://metacpan.org/pod/App::hopen>

* This distribution

See the "eg/" directory distributed with this software for examples.

LICENSE AND COPYRIGHT
Copyright (c) 2018--2019 Christopher White. All rights reserved.

Expand Down
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# App::hopen - hopen build system command-line interface

[![Appveyor Badge](https://ci.appveyor.com/api/projects/status/github/hopenbuild/app-hopen?svg=true)](https://ci.appveyor.com/project/cxw42/app-hopen)
[![Appveyor Status](https://img.shields.io/appveyor/ci/cxw42/app-hopen.svg?logo=appveyor)](https://ci.appveyor.com/project/cxw42/app-hopen) [![Travis Status](https://img.shields.io/travis/hopenbuild/app-hopen.svg?logo=travis)](https://travis-ci.org/hopenbuild/app-hopen)



Expand All @@ -17,20 +17,45 @@ build scripts (specifically, Perl 5.14+)
- Context-sensitivity. Your users can tweak their own builds for their own
platforms without affecting your project.

See [App::hopen::Conventions](https://github.com/hopenbuild/App-hopen/blob/master/lib/App/hopen/Conventions.pod) for details of the input format.
See [App::hopen::Conventions](https://metacpan.org/pod/App::hopen::Conventions) for details of the input format.

Why Perl? Because (1) you probably already have it installed, and
(2) it is the original write-once, run-everywhere language!

# USAGE
## Example

Create a file `.hopen.pl` in your source tree. Then:

$ hopen
From ``.'' into ``built''
Running Check phase

Now `built/MY.hopen.pl` has been created, and loaded with information about
your configuration. You can edit that file if you want to change what will
happen next.

$ hopen
From ``.'' into ``built''
Running Gen phase

Now `built/Makefile` has been created.

$ hopen --build
Building in foo/built

And your software is ready to go!

See [App::hopen::Conventions](https://metacpan.org/pod/App::hopen::Conventions) for information on writing `.hopen.pl` files.

# SYNOPSIS

hopen [options] [--] [destination dir [project dir]]

If no project directory is specified, the current directory is used.

If no destination directory is specified, `<project dir>/built` is used.

See [App::hopen::Conventions](https://github.com/hopenbuild/App-hopen/blob/master/lib/App/hopen/Conventions.pod) for more details.
See [App::hopen](https://metacpan.org/pod/App::hopen) and [App::hopen::Conventions](https://metacpan.org/pod/App::hopen::Conventions) for more details.

# OPTIONS

Expand Down Expand Up @@ -115,6 +140,10 @@ You can also look for information at:

[https://metacpan.org/pod/App::hopen](https://metacpan.org/pod/App::hopen)

- This distribution

See the `eg/` directory distributed with this software for examples.

# LICENSE AND COPYRIGHT

Copyright (c) 2018--2019 Christopher White. All rights reserved.
Expand Down
70 changes: 68 additions & 2 deletions bin/hopen
Original file line number Diff line number Diff line change
@@ -1,7 +1,73 @@
#!perl
# Copyright (c) 2018 cxw42. All rights reserved. See LICENSE file.
# Copyright (c) 2018--2019 cxw42. All rights reserved. See LICENSE file.
# To run this manually from the source tree, do
# perl -Ilib bin/hopen
use App::hopen;
use strict; use warnings; use App::hopen;
exit(App::hopen::Main(\@ARGV));
__END__
=head1 NAME
hopen - CLI for the App::hopen build system
=head1 SYNOPSIS
See L<App::hopen>. Basic usage:
hopen [options] [destination directory] [project directory]
The default C<destination directory> is C<built/>.
The default C<project directory> is C<.>.
=head1 AUTHOR
Christopher White, C<cxwembedded at gmail.com>
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc App::hopen For command-line options
perldoc App::hopen::Conventions For terminology and workflow
perldoc Data::Hopen For internals
You can also look for information at:
=over 4
=item * GitHub: The project's main repository and issue tracker
L<https://github.com/hopenbuild/App-hopen>
=item * MetaCPAN
L<https://metacpan.org/pod/App::hopen>
=item * This distribution
See the C<eg/> directory distributed with this software for examples.
=back
=head1 LICENSE AND COPYRIGHT
Copyright (c) 2018--2019 Christopher White. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free
Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
=cut
# vi: set ts=4 sts=4 sw=4 et ai ft=perl: #
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# t/samples/01/01.hopen.pl
# 001-single-file-hello/001.hopen.pl

use language 'C'; # uses <toolset>::C, and makes `C` an alias for it.
# The "language" package is synthesized by Data::Hopen::HopenFileKit.
Expand Down
3 changes: 3 additions & 0 deletions eg/001-single-file-hello/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 001-single-file-hello

As basic as it gets: compile one C file and link it into an executable.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ else
dbg=""
fi

perl -I../../../lib $dbg ../../../bin/hopen "$@"
perl -I../../lib $dbg ../../bin/hopen "$@"
Loading

0 comments on commit 14c9081

Please sign in to comment.