Skip to content

Commit

Permalink
FORGE-1284: Do not include JSR-251 dependencies in new addon projects
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Oct 24, 2013
1 parent 477cb16 commit eec0145
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ public void testComplexAddonProject() throws FileNotFoundException, FacetNotFoun
Assert.assertFalse(project.getProjectRoot().getChild("src").exists());
Assert.assertTrue(project.getFacet(DependencyFacet.class).hasDirectManagedDependency(
DefaultFurnaceContainerAPIFacet.FURNACE_CONTAINER_API_DEPENDENCY));
Assert.assertFalse(project.getFacet(DependencyFacet.class).hasDirectDependency(
DependencyBuilder.create("javax.annotation:jsr250-api:1.0")));
Assert.assertTrue(project.getFacet(DependencyFacet.class).hasDirectManagedDependency(
DependencyBuilder.create(addonProject.getFacet(MetadataFacet.class).getOutputDependency())
.setClassifier("forge-addon")));
Expand Down Expand Up @@ -188,6 +190,8 @@ public void testComplexAddonProject() throws FileNotFoundException, FacetNotFoun
DefaultFurnaceContainerAPIFacet.FURNACE_CONTAINER_API_DEPENDENCY));
Assert.assertTrue(implProject.getFacet(DependencyFacet.class).hasEffectiveManagedDependency(
DefaultFurnaceContainerAPIFacet.FURNACE_CONTAINER_API_DEPENDENCY));
Assert.assertFalse(implProject.getFacet(DependencyFacet.class).hasDirectDependency(
DependencyBuilder.create("javax.annotation:jsr250-api:1.0")));
Assert.assertTrue(implProject.hasFacet(AddonImplFacet.class));
Assert.assertFalse(implProject.hasFacet(FurnacePluginFacet.class));

Expand All @@ -212,6 +216,8 @@ public void testComplexAddonProject() throws FileNotFoundException, FacetNotFoun
DefaultFurnaceContainerAPIFacet.FURNACE_CONTAINER_API_DEPENDENCY));
Assert.assertTrue(apiProject.getFacet(DependencyFacet.class).hasEffectiveManagedDependency(
DefaultFurnaceContainerAPIFacet.FURNACE_CONTAINER_API_DEPENDENCY));
Assert.assertFalse(apiProject.getFacet(DependencyFacet.class).hasDirectDependency(
DependencyBuilder.create("javax.annotation:jsr250-api:1.0")));
Assert.assertTrue(apiProject.hasFacet(AddonAPIFacet.class));
Assert.assertFalse(apiProject.hasFacet(FurnacePluginFacet.class));

Expand All @@ -229,6 +235,8 @@ public void testComplexAddonProject() throws FileNotFoundException, FacetNotFoun
FurnaceAPIFacet.FURNACE_API_DEPENDENCY));
Assert.assertTrue(spiProject.getFacet(DependencyFacet.class).hasEffectiveManagedDependency(
FurnaceAPIFacet.FURNACE_API_DEPENDENCY));
Assert.assertFalse(spiProject.getFacet(DependencyFacet.class).hasDirectDependency(
DependencyBuilder.create("javax.annotation:jsr250-api:1.0")));
Assert.assertFalse(spiProject.hasFacet(DefaultFurnaceContainerFacet.class));
Assert.assertFalse(spiProject.hasFacet(DefaultFurnaceContainerAPIFacet.class));
Assert.assertFalse(spiProject.hasFacet(CDIFacet_1_1.class));
Expand Down Expand Up @@ -270,6 +278,8 @@ public void testComplexAddonProject() throws FileNotFoundException, FacetNotFoun
DefaultFurnaceContainerFacet.FURNACE_CONTAINER_DEPENDENCY));
Assert.assertTrue(addonProject.getFacet(DependencyFacet.class).hasEffectiveManagedDependency(
DefaultFurnaceContainerFacet.FURNACE_CONTAINER_DEPENDENCY));
Assert.assertFalse(addonProject.getFacet(DependencyFacet.class).hasDirectDependency(
DependencyBuilder.create("javax.annotation:jsr250-api:1.0")));

Assert.assertTrue(addonProject.hasFacet(FurnacePluginFacet.class));

Expand Down Expand Up @@ -303,6 +313,8 @@ public void testComplexAddonProject() throws FileNotFoundException, FacetNotFoun
DefaultFurnaceContainerFacet.FURNACE_CONTAINER_DEPENDENCY));
Assert.assertEquals(FURNACE_VERSION, testsProject.getFacet(DependencyFacet.class).getEffectiveDependency(
DefaultFurnaceContainerFacet.FURNACE_CONTAINER_DEPENDENCY).getCoordinate().getVersion());
Assert.assertFalse(testsProject.getFacet(DependencyFacet.class).hasDirectDependency(
DependencyBuilder.create("javax.annotation:jsr250-api:1.0")));

Assert.assertTrue(project.getProjectRoot().getChild("README.asciidoc").exists());
project.getProjectRoot().delete(true);
Expand Down Expand Up @@ -368,6 +380,8 @@ public void testSimpleAddonProject() throws FileNotFoundException, FacetNotFound
DefaultFurnaceContainerAPIFacet.FURNACE_CONTAINER_API_DEPENDENCY));
Assert.assertFalse(project.getFacet(DependencyFacet.class).hasDirectDependency(
DefaultFurnaceContainerAPIFacet.FURNACE_CONTAINER_API_DEPENDENCY));
Assert.assertFalse(project.getFacet(DependencyFacet.class).hasDirectDependency(
DependencyBuilder.create("javax.annotation:jsr250-api:1.0")));

Assert.assertTrue(project.getProjectRoot().getChild("README.asciidoc").exists());
project.getProjectRoot().delete(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
*/
public class CDIFacetImpl_1_0 extends AbstractCDIFacetImpl<BeansDescriptor> implements CDIFacet_1_0
{
private static final Dependency JBOSS_ANNOTATION_API = DependencyBuilder
private static final Dependency JBOSS_ANNOTATION_API_1_1 = DependencyBuilder
.create("org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec");
private static final Dependency JBOSS_ANNOTATION_API_1_2 = DependencyBuilder
.create("org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec");
private static final Dependency JAVAX_INTERCEPTOR_API = DependencyBuilder
.create("org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec");
private static final Dependency JAVAX_INJECT = DependencyBuilder.create("javax.inject:javax.inject:1");
Expand Down Expand Up @@ -69,7 +71,8 @@ protected Map<Dependency, List<Dependency>> getRequiredDependencyOptions()
Map<Dependency, List<Dependency>> result = new LinkedHashMap<Dependency, List<Dependency>>();

result.put(CDI_API, Arrays.asList(CDI_API));
result.put(JAVAX_ANNOTATION_API, Arrays.asList(JAVAX_ANNOTATION_API, JBOSS_ANNOTATION_API));
result.put(JAVAX_ANNOTATION_API,
Arrays.asList(JAVAX_ANNOTATION_API, JBOSS_ANNOTATION_API_1_1, JBOSS_ANNOTATION_API_1_2));
result.put(JAVAX_INJECT, Arrays.asList(JAVAX_INJECT));
result.put(JAVAX_INTERCEPTOR_API, Arrays.asList(JAVAX_INTERCEPTOR_API));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
*/
public class CDIFacetImpl_1_1 extends AbstractCDIFacetImpl<BeansDescriptor> implements CDIFacet_1_1
{
private static final Dependency JBOSS_ANNOTATION_API = DependencyBuilder
private static final Dependency JBOSS_ANNOTATION_API_1_1 = DependencyBuilder
.create("org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec");
private static final Dependency JBOSS_ANNOTATION_API_1_2 = DependencyBuilder
.create("org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec");
private static final Dependency JAVAX_INTERCEPTOR_API = DependencyBuilder
.create("org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec");
private static final Dependency JAVAX_INJECT = DependencyBuilder.create("javax.inject:javax.inject:1");
Expand Down Expand Up @@ -67,7 +69,7 @@ protected Map<Dependency, List<Dependency>> getRequiredDependencyOptions()
Map<Dependency, List<Dependency>> result = new LinkedHashMap<Dependency, List<Dependency>>();

result.put(CDI_API, Arrays.asList(CDI_API));
result.put(JAVAX_ANNOTATION_API, Arrays.asList(JAVAX_ANNOTATION_API, JBOSS_ANNOTATION_API));
result.put(JAVAX_ANNOTATION_API, Arrays.asList(JAVAX_ANNOTATION_API, JBOSS_ANNOTATION_API_1_1, JBOSS_ANNOTATION_API_1_2));
result.put(JAVAX_INJECT, Arrays.asList(JAVAX_INJECT));
result.put(JAVAX_INTERCEPTOR_API, Arrays.asList(JAVAX_INTERCEPTOR_API));

Expand Down

0 comments on commit eec0145

Please sign in to comment.