Commit e240d0cb authored by Johan Ouwerkerk's avatar Johan Ouwerkerk

Use a well-known 'third-party/' prefix for dependency paths of non-KDE modules.

See also issue: #26
Depends on Phabricator diff D20279: https://phabricator.kde.org/D20279
parent ec336711
Pipeline #2617 passed with stage
in 1 minute and 17 seconds
......@@ -424,7 +424,10 @@ sub _getDependencyPathOf
if ($module) {
my $projectPath = $module->fullProjectPath();
debug("\tUsing full project path: 'b[$projectPath]' for item: b[$item]");
$projectPath = "third-party/$projectPath" if(!$module->isKDEProject());
debug("\tUsing path: 'b[$projectPath]' for item: b[$item]");
return $projectPath;
}
......
......@@ -15,16 +15,23 @@ package ksb::Module {
sub new
{
my ($class, $projectPath) = @_;
my ($class, $projectPath, $kde) = @_;
my $self = {
projectPath => $projectPath,
kde => $kde
};
bless $self, $class;
return $self;
}
sub isKDEProject
{
my $self = shift;
return $self->{kde};
}
sub fullProjectPath
{
my $self = shift;
......@@ -32,13 +39,16 @@ package ksb::Module {
}
};
my $module1 = ksb::Module->new('test/path');
my $module1 = ksb::Module->new('test/path', 1);
is(ksb::DependencyResolver::_getDependencyPathOf($module1, 'foo', 'bar'), 'test/path', "should return full project path if a module object is passed");
is(ksb::DependencyResolver::_getDependencyPathOf($module1, 'foo', 'bar'), 'test/path', "should return full project path if a KDE module object is passed");
my $module2 = undef;
is(ksb::DependencyResolver::_getDependencyPathOf($module2, 'foo', 'bar'), 'bar', "should return the provided default if no module is passed");
my $module3 = ksb::Module->new('test/path', 0);
is(ksb::DependencyResolver::_getDependencyPathOf($module3, 'foo', 'bar'), 'third-party/test/path', "should return 'third-party/' prefixed project path if a non-KDE module object is passed");
done_testing();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment