Skip to content

Commit

Permalink
Significant changes
Browse files Browse the repository at this point in the history
- Added D::H::OrderedPredecessorGraph and tests
- Changed references to "generator" to "visitor" since
  we are no longer tied to App::hopen
- Added tests of visitor
- DAG: Added warnings for non-connected nodes/goals; added t/023.
- D::H: Added ':v' export tag for the verbosity-related variables
- Scope: add()->put(); added merge(), merge_strategy
- Updated tests per changes to Scope
- Updated HopenTest from App::hopen to provide $DUT support
- Added G::OutputOp (mainly to support testing)
- DAG: Added merge strategies and default-strategy test
  • Loading branch information
Chris White committed Mar 8, 2019
1 parent 2ccb00e commit 60a9822
Show file tree
Hide file tree
Showing 37 changed files with 754 additions and 259 deletions.
6 changes: 6 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ lib/Data/Hopen/G/GraphBuilder.pm
lib/Data/Hopen/G/Link.pm
lib/Data/Hopen/G/Node.pm
lib/Data/Hopen/G/Op.pm
lib/Data/Hopen/G/OutputOp.pm
lib/Data/Hopen/G/Runnable.pm
lib/Data/Hopen/OrderedPredecessorGraph.pm
lib/Data/Hopen/Scope.pm
lib/Data/Hopen/Scope/Environment.pm
lib/Data/Hopen/Scope/Hash.pm
Expand Down Expand Up @@ -42,6 +44,10 @@ t/011-scope-env.t
t/012-scope-nested.t
t/020-dag.t
t/021-dag-single-goal.t
t/022-dag-visitor.t
t/023-dag-warnings.t
t/024-dag-merge-node-inputs.t
t/030-ordered_pred.t
t/dir200/inner.hopen.pl
t/dir200/inner/.hopen.pl
t/dir200/inner/z.hopen.pl
Expand Down
5 changes: 3 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ my %opts = (
## 'Test::Directory' => '0.02', # for subdirs
'Test::More' => '0',
# Test::TempDir::Tiny? If so, remove Test::Directory dependency?
'Test::Warn' => '0.35', # for metadata
},
PREREQ_PM => {
#'Algorithm::Dependency' => '1.106',
Expand All @@ -197,8 +198,6 @@ my %opts = (
# - Looks like it might be handy.
# 0.002+ because that has only core dependencies.

#'Class::Method::Modifiers' => '1.05', # version nums from Antlers
#'Role::Tiny' => '1.000000',

## 'Class::XPath' => '1.4',
'Config' => '0',
Expand Down Expand Up @@ -251,6 +250,8 @@ my %opts = (
# 'Probe::Perl' => '0', # For perl interpreter file location or other info.
# Alternative: Padre::Perl

#'Role::Tiny' => '1.000000', # version num from Antlers

'Scalar::Util' => '0',
'Set::Scalar' => '1.27', # For correct metadata
'Storable' => '3.06',
Expand Down
33 changes: 6 additions & 27 deletions README
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
NAME
Data::Hopen - A build generator with first-class edges and explicit
dependencies
Data::Hopen - A dataflow library with first-class edges

hopen is a cross-platform software build generator. It makes files you
can pass to Make, Ninja, Visual Studio, or other build tools, to compile
and link your software. hopen gives you:

* A full, Turing-complete, robust programming language to write your
build scripts (specifically, Perl 5.14+)

* No hidden magic! All your data is visible and accessible in a build
graph.

* Context-sensitivity. Your users can tweak their own builds for their
own platforms without affecting your project.

See Data::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!
"Data::Hopen" is a dataflow library that runs actions you specify, moves
data between those actions, and permits transforming data as the data
moves. It is the underlying engine of the App::hopen cross-platform
software build generator, but can be used for any dataflow task that can
be represented as a directed acyclic graph (DAG).

INSTALLATION
Easiest: install "cpanminus" if you don't have it - see
Expand Down Expand Up @@ -57,14 +44,6 @@ SUPPORT

<https://metacpan.org/release/Data-Hopen>

* AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/Data-Hopen>

* CPAN Ratings

<https://cpanratings.perl.org/d/Data-Hopen>

INSPIRED BY
* Luke <https://github.com/gvvaughan/luke>

Expand Down
29 changes: 6 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
# Data::Hopen - A build generator with first-class edges and explicit dependencies
# Data::Hopen - A dataflow library with first-class edges

[![Appveyor Badge](https://ci.appveyor.com/api/projects/status/github/hopenbuild/data-hopen?svg=true)](https://ci.appveyor.com/project/cxw42/data-hopen)



hopen is a cross-platform software build generator. It makes files you can
pass to Make, Ninja, Visual Studio, or other build tools, to compile and
link your software. hopen gives you:

- A full, Turing-complete, robust programming language to write your
build scripts (specifically, Perl 5.14+)
- No hidden magic! All your data is visible and accessible in a build graph.
- Context-sensitivity. Your users can tweak their own builds for their own
platforms without affecting your project.

See [Data::Hopen::Conventions](https://metacpan.org/pod/release/CXW/Build-Hopen-0.000006-TRIAL/lib/Build/Hopen/Conventions.pod) 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!
`Data::Hopen` is a dataflow library that runs actions you specify, moves data
between those actions, and permits transforming data as the data moves. It is
the underlying engine of the [App::hopen](https://metacpan.org/pod/App::hopen) cross-platform software build
generator, but can be used for any dataflow task that can be represented as a
directed acyclic graph (DAG).

# INSTALLATION

Expand Down Expand Up @@ -57,14 +48,6 @@ You can also look for information at:

[https://metacpan.org/release/Data-Hopen](https://metacpan.org/release/Data-Hopen)

- AnnoCPAN: Annotated CPAN documentation

[http://annocpan.org/dist/Data-Hopen](http://annocpan.org/dist/Data-Hopen)

- CPAN Ratings

[https://cpanratings.perl.org/d/Data-Hopen](https://cpanratings.perl.org/d/Data-Hopen)

# INSPIRED BY

- [Luke](https://github.com/gvvaughan/luke)
Expand Down
57 changes: 9 additions & 48 deletions lib/Data/Hopen.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!perl
# TODO: Move MYH material out to App::hopen.
# lib/Data/Hopen.pm: utility routines for hopen(1). This file is also the
# source of the repo's README.md, which is autogenerated from this POD.

Expand All @@ -14,6 +15,7 @@ BEGIN {
@EXPORT_OK = qw(loadfrom $VERBOSE $QUIET UNSPECIFIED NOTHING isMYH MYH);
%EXPORT_TAGS = (
default => [@EXPORT],
v => [qw($VERBOSE $QUIET)],
all => [@EXPORT, @EXPORT_OK]
);
}
Expand All @@ -22,42 +24,21 @@ use Data::Hopen::Util::NameSet;
use Getargs::Mixed;
use Storable ();

our $VERSION = '0.000012';
our $VERSION = '0.000013'; # TRIAL

# Docs {{{1

=head1 NAME
Data::Hopen - A build generator with first-class edges and explicit dependencies
Data::Hopen - A dataflow library with first-class edges
=head1 SYNOPSIS
hopen is a cross-platform software build generator. It makes files you can
pass to Make, Ninja, Visual Studio, or other build tools, to compile and
link your software. hopen gives you:
=over
=item *
A full, Turing-complete, robust programming language to write your
build scripts (specifically, Perl 5.14+)
=item *
No hidden magic! All your data is visible and accessible in a build graph.
=item *
Context-sensitivity. Your users can tweak their own builds for their own
platforms without affecting your project.
=back
See L<Data::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!
C<Data::Hopen> is a dataflow library that runs actions you specify, moves data
between those actions, and permits transforming data as the data moves. It is
the underlying engine of the L<App::hopen> cross-platform software build
generator, but can be used for any dataflow task that can be represented as a
directed acyclic graph (DAG).
=head1 INSTALLATION
Expand Down Expand Up @@ -253,18 +234,6 @@ __END__
# Rest of docs {{{1
=head1 INTERNALS
- C<Op>: A class representing an operation
- C<Op:run()> takes a Data::Hopen::Scope and returns a hashref of outputs.
=head2 Implementation
After the C<hopen> file is processed, cycles are detected and reported as
errors. *(TODO change this to support LaTeX multi-run files?)* Then the DAG
is traversed, and each operation writes the necessary information to the
file being generated.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
Expand All @@ -284,14 +253,6 @@ L<https://github.com/cxw42/hopen>
L<https://metacpan.org/release/Data-Hopen>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Data-Hopen>
=item * CPAN Ratings
L<https://cpanratings.perl.org/d/Data-Hopen>
=back
=head1 INSPIRED BY
Expand Down
2 changes: 1 addition & 1 deletion lib/Data/Hopen/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package Data::Hopen::Base;
use parent 'Exporter';
use Import::Into;

our $VERSION = '0.000012';
our $VERSION = '0.000013'; # TRIAL

# Pragmas
use 5.014;
Expand Down
13 changes: 6 additions & 7 deletions lib/Data/Hopen/G.pod
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ tools used in the hopen build system (L<App::hopen>).
=head2 C<Data::Hopen::G::Op>

An operation. Operations can, e.g., transform their inputs or invoke a
generator routine (L<Data::Hopen::Gen>) based on their inputs. Operations
can output values representing the generator action they took, or that will
later be used by the generator or downstream nodes.
visitor routine based on their inputs. Operations
can output values representing the visitor action they took, or that will
later be used by the visitor or downstream nodes.

=head2 C<Data::Hopen::G::Link>

A connection between operations. Edges should, generally speaking, B<not>
invoke generator routines. Instead, they should transform their inputs to
outputs, possibly with reference to the environment or (if necessary) the
B<identity> (but not details) of the generator in use.
A connection between operations. Edges are B<not> provided to a visitor
Instead, they have the opportunity to transform their inputs to
outputs, possibly with reference to the environment.

=head2 C<Data::Hopen::G::DAG>

Expand Down
3 changes: 1 addition & 2 deletions lib/Data/Hopen/G/CollectOp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package Data::Hopen::G::CollectOp;
use Data::Hopen::Base;

our $VERSION = '0.000012';
our $VERSION = '0.000013'; # TRIAL

use parent 'Data::Hopen::G::Op';
use Class::Tiny {
Expand Down Expand Up @@ -52,7 +52,6 @@ See L<Data::Hopen::G::Runnable/passthrough> for more details.

sub _run {
my ($self, %args) = getparameters('self', [qw(*)], @_);
hlog { Running => __PACKAGE__ , $self->name };
return $self->passthrough(-nocontext => 1, -levels => $self->levels);
# -nocontext because Runnable::run() already hooked in the context
} #run()
Expand Down
Loading

0 comments on commit 60a9822

Please sign in to comment.