Skip to content

Commit

Permalink
Fix for failing functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed May 11, 2010
1 parent 4196f74 commit f460543
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
Expand Up @@ -114,6 +114,7 @@ abstract public class AbstractIvyDependencyManager {
protected Set<DependencyDescriptor> dependencyDescriptors = new HashSet<DependencyDescriptor>();
protected Set<DependencyDescriptor> pluginDependencyDescriptors = new HashSet<DependencyDescriptor>();
protected Set<String> pluginDependencyNames = new HashSet<String>();
protected Set<String> metadataRegisteredPluginNames = new HashSet<String>();
protected Map<String, Collection<ModuleRevisionId>> orgToDepMap = new HashMap<String, Collection<ModuleRevisionId>>();


Expand All @@ -128,7 +129,19 @@ Set<DependencyDescriptor> getDependencyDescriptors() {
return dependencyDescriptors;
};

/**

public Set<String> getMetadataRegisteredPluginNames() {
return metadataRegisteredPluginNames;
}


public void setMetadataRegisteredPluginNames(
Set<String> metadataRegisteredPluginNames) {
this.metadataRegisteredPluginNames = metadataRegisteredPluginNames;
}


/**
* Obtains a set of plugin dependency descriptors defined in the project
*/
Set<DependencyDescriptor> getPluginDependencyDescriptors() {
Expand Down
Expand Up @@ -650,7 +650,7 @@ public class IvyDependencyManager extends AbstractIvyDependencyManager implement
def dd = new EnhancedDefaultDependencyDescriptor(mrid, true, true, scope)
def artifact = new DefaultDependencyArtifactDescriptor(dd, name, "zip", "zip", null, null )
dd.addDependencyArtifact(scope, artifact)

metadataRegisteredPluginNames << name
configureDependencyDescriptor(dd, scope, null, true)
pluginDependencyDescriptors << dd
}
Expand Down
Expand Up @@ -205,7 +205,10 @@ class PluginInstallEngine {
assertNoExistingInlinePlugin(name)

def abort = checkExistingPluginInstall(name, version)
if(abort) return
if(abort) {
registerPluginWithMetadata(name, version)
return
}

eventHandler "StatusUpdate", "Installing zip ${pluginZip}..."

Expand Down Expand Up @@ -304,9 +307,8 @@ class PluginInstallEngine {

if (currentInstall?.exists()) {

def pluginDir = currentInstall.file.canonicalFile
PluginBuildSettings pluginSettings = pluginSettings
def pluginInfo = pluginSettings.getPluginInfo(pluginDir.absolutePath)
def pluginInfo = pluginSettings.getPluginInfo(currentInstall.file.absolutePath)
// if the versions are the same no need to continue
if(version == pluginInfo?.version) return true

Expand Down Expand Up @@ -488,7 +490,7 @@ You cannot upgrade a plugin that is configured via BuildConfig.groovy, remove th
IvyDependencyManager dependencyManager = settings.getDependencyManager()

// only register in metadata if not specified in BuildConfig.groovy
if(!dependencyManager.pluginDependencyNames?.contains(pluginName)) {
if(dependencyManager.metadataRegisteredPluginNames?.contains(pluginName)) {
metadata['plugins.' + pluginName] = pluginVersion
metadata.persist()
}
Expand Down

0 comments on commit f460543

Please sign in to comment.