def project_config
project_plugins = Nucleon.loaded_plugins(:project)
register :project_provider, :str, :git, 'nucleon.core.mixin.action.project.options.project_provider' do |value|
value = value.to_sym
unless project_plugins.keys.include?(value)
warn('nucleon.core.mixin.action.project.errors.project_provider', { :value => value, :choices => project_plugins.keys.join(", ") })
next false
end
true
end
register :project_reference, :str, nil, 'nucleon.core.mixin.action.project.options.project_reference' do |value|
success = true
if info = Nucleon.plugin_class(:project).translate_reference(value)
if ! project_plugins.keys.include?(info[:provider].to_sym)
warn('nucleon.core.mixin.action.project.errors.project_reference', {
:value => value,
:provider => info[:provider],
:reference => info[:reference],
:url => info[:url],
:revision => info[:revision]
})
success = false
end
end
success
end
register :project_revision, :str, :master, 'nucleon.core.mixin.action.project.options.project_revision'
end