104 |
|
sub template_dir() |
105 |
|
{ |
106 |
|
my $self=shift; |
107 |
< |
my ($templatedir)=@_; |
108 |
< |
$templatedir ||= $ENV{LOCALTOP}."/".$ENV{SCRAM_CONFIGDIR}; |
107 |
> |
# Default template dir: |
108 |
> |
my $templatedir = $ENV{LOCALTOP}."/".$ENV{SCRAM_CONFIGDIR}; |
109 |
> |
# Allow projects to override the template dir (subdir of config): |
110 |
> |
if (exists ($ENV{SCRAM_PROJECT_TEMPLATEDIR})) { |
111 |
> |
$templatedir.="/".$ENV{SCRAM_PROJECT_TEMPLATEDIR}; |
112 |
> |
} |
113 |
|
$self->{TEMPLATE_DIR} = $templatedir; |
114 |
|
return $self; |
115 |
|
} |
117 |
|
sub template_config() |
118 |
|
{ |
119 |
|
my $self=shift; |
116 |
– |
|
120 |
|
# Set up Template opts: |
121 |
|
$self->{TEMPLATE_CONFIG} = |
122 |
|
{ |
123 |
< |
INCLUDE_PATH => $self->{TEMPLATE_DIR}, |
123 |
> |
INCLUDE_PATH => [ "$self->{TEMPLATE_DIR}","$ENV{LOCALTOP}/$ENV{SCRAM_CONFIGDIR}" ], |
124 |
|
PLUGIN_BASE => [ qw(SCRAM::Plugins BuildSystem::Template::Plugins) ], |
125 |
|
EVAL_PERL => 1 |
126 |
|
}; |