Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions lib/autobuild.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module Autobuild
require 'autobuild/import/svn'
require 'autobuild/import/archive'
require 'autobuild/import/tar'
require 'autobuild/import/subpackage'

require 'autobuild/package'
require 'autobuild/configurable'
Expand Down
35 changes: 35 additions & 0 deletions lib/autobuild/import/subpackage.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module Autobuild
class Subpackage < Importer
def initialize(source, options = {})
@source = source

parent_name = options[:parent]
unless parent_name
raise "Subpackage must provide a parent package."
end

@parent = Autoproj.workspace.manifest.package_definition_by_name(parent_name)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Autobuild cannot depend on autoproj

unless @parent
raise "Parent package #{parent_name} does not exist."
end

super(options.merge(repository_id: source))
end

def update(_package, options = Hash.new) # Does nothing, parent will do update
false
end

def checkout(package, options = Hash.new) # Does nothing, parent will be checked out
package.depends_on(@parent.autobuild)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is going to behave as expected, especially with --no-deps...

end

def snapshot(*) # Does nothing, parent will do snapshot
true
end
end

def self.subpackage(source, options = {})
Subpackage.new(source, options)
end
end
Loading