Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions framework/bin/d4j/d4j-compile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ d4j-compile -- compile a checked-out project version.

=head1 SYNOPSIS

d4j-compile [-w work_dir]
d4j-compile [-w work_dir -o compile_options]

=head1 DESCRIPTION

Expand All @@ -43,6 +43,10 @@ This script compiles sources and tests of a checked-out project version.
The working directory of the checked-out project version (optional). Default is
the current directory.

=item -o F<compile_options>

Manual options for ant.

=back

=cut
Expand All @@ -59,12 +63,12 @@ use Getopt::Std;
# Issue usage message and quit
#
sub _usage {
print "usage: $0 [-w work_dir]\n";
print "usage: $0 [-w work_dir] [-o compile_options]\n";
exit 1;
}

my %cmd_opts;
getopts('w:', \%cmd_opts) or _usage();
getopts('w:o:', \%cmd_opts) or _usage();

my $WORK_DIR = Utils::get_abs_path($cmd_opts{w} // ".");

Expand All @@ -79,7 +83,7 @@ my $project = Project::create_project($config->{$CONFIG_PID});
$project->{prog_root} = $WORK_DIR;

# Checkout and compile project version
$project->compile() or die "Cannot compile sources!";
$project->compile_tests() or die "Cannot compile tests!";
$project->compile(undef, $cmd_opts{o}) or die "Cannot compile sources!";
$project->compile_tests(undef, $cmd_opts{o}) or die "Cannot compile tests!";

1;
8 changes: 4 additions & 4 deletions framework/core/Project.pm
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ If F<log_file> is provided, the compiler output is written to this file.
=cut

sub compile {
my ($self, $log_file) = @_;
return $self->_ant_call_comp("compile", undef, $log_file);
my ($self, $log_file, $options_str) = @_;
return $self->_ant_call_comp("compile", $options_str, $log_file);
}

=pod
Expand All @@ -545,8 +545,8 @@ If F<log_file> is provided, the compiler output is written to this file.
=cut

sub compile_tests {
my ($self, $log_file) = @_;
return $self->_ant_call_comp("compile.tests", undef, $log_file);
my ($self, $log_file, $options_str) = @_;
return $self->_ant_call_comp("compile.tests", $options_str, $log_file);
}

=pod
Expand Down