Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Apr 10, 2015
1 parent b1db99b commit ca05e0c
Showing 1 changed file with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Response<File[]> resolveResources(final AddonId addonId)
for (ArtifactResult artifactResult : artifactResults)
{
Artifact artifact = artifactResult.getArtifact();
if (isFurnaceAPI(artifact) ||
if (isFurnaceAPI(artifact) ||
(this.classifier.equals(artifact.getClassifier())
&& !addonId.getName().equals(artifact.getGroupId() + ":" + artifact.getArtifactId())))
{
Expand Down Expand Up @@ -197,7 +197,7 @@ private Response<String> resolveAPIVersion(AddonId addonId, RepositorySystem sys
public boolean selectDependency(Dependency dependency)
{
Artifact artifact = dependency.getArtifact();
if (classifier.equals(artifact.getClassifier()))
if (isAddon(artifact))
{
return true;
}
Expand Down Expand Up @@ -297,10 +297,7 @@ private AddonInfo fromNode(AddonId id, DependencyNode dependencyNode, Repository
String scope = dependency.getScope();
if (scope != null && !optional)
{
if ("compile".equalsIgnoreCase(scope) || "runtime".equalsIgnoreCase(scope))
exported = true;
else if ("provided".equalsIgnoreCase(scope))
exported = false;
exported = isExported(scope);
}
DependencyNode node = traverseAddonGraph(toMavenCoords(childId), system, settings, session);
AddonInfo addonInfo = fromNode(childId, node, system, settings, session);
Expand Down Expand Up @@ -424,4 +421,21 @@ private boolean isFurnaceAPI(Artifact artifact)
return (FURNACE_API_GROUP_ID.equals(artifact.getGroupId()) && FURNACE_API_ARTIFACT_ID.equals(artifact
.getArtifactId()));
}

/**
* @param scope the scope to be tested upon
* @return <code>true</code> if the scope indicates an exported dependency
*/
private boolean isExported(String scope)
{
switch (scope)
{
case "compile":
case "runtime":
return true;
case "provided":
default:
return false;
}
}
}

0 comments on commit ca05e0c

Please sign in to comment.