diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-06 19:51:33 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-06 19:51:33 -0400 |
commit | 294d543163dd785092f4383a4ac359d1815eba6c (patch) | |
tree | 7da3436ea897758595ce93bd73e6d53805a3bca2 /rules | |
parent | 7e01abb99f835440bfac61761c65ea68e58191d6 (diff) |
build plexus-component-metadata(-bootstrap)!
Diffstat (limited to 'rules')
3 files changed, 242 insertions, 0 deletions
diff --git a/rules/plexus-component-metadata-bootstrap/0001-valid-java.patch b/rules/plexus-component-metadata-bootstrap/0001-valid-java.patch new file mode 100644 index 0000000..cec35d5 --- /dev/null +++ b/rules/plexus-component-metadata-bootstrap/0001-valid-java.patch @@ -0,0 +1,34 @@ +From 0ef54eedd0cbfe90809e547b88f2e0447a2754a6 Mon Sep 17 00:00:00 2001 +From: Luke Shumaker <LukeShu@sbcglobal.net> +Date: Fri, 6 Jun 2014 19:46:29 -0400 +Subject: [PATCH 1/2] valid java + +--- + .../org/codehaus/plexus/component/repository/ComponentDescriptor.java | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/main/java/org/codehaus/plexus/component/repository/ComponentDescriptor.java b/src/main/java/org/codehaus/plexus/component/repository/ComponentDescriptor.java +index 1139d17..087e33e 100644 +--- a/src/main/java/org/codehaus/plexus/component/repository/ComponentDescriptor.java ++++ b/src/main/java/org/codehaus/plexus/component/repository/ComponentDescriptor.java +@@ -189,7 +189,7 @@ public class ComponentDescriptor<T> + { + try + { +- roleClass = realm.loadClass( role ); ++ roleClass = (Class<? extends T>)realm.loadClass( role ); + Thread.currentThread(); + } + catch ( Throwable ignored ) +@@ -299,7 +299,7 @@ public class ComponentDescriptor<T> + { + try + { +- implementationClass = realm.loadClass( implementation ); ++ implementationClass = (Class<? extends T>)realm.loadClass( implementation ); + Thread.currentThread(); + } + catch ( Throwable ignored ) +-- +2.0.0 + diff --git a/rules/plexus-component-metadata-bootstrap/0002-qdox2.patch b/rules/plexus-component-metadata-bootstrap/0002-qdox2.patch new file mode 100644 index 0000000..edc9b68 --- /dev/null +++ b/rules/plexus-component-metadata-bootstrap/0002-qdox2.patch @@ -0,0 +1,207 @@ +From 1913330f81f809db1f29bc61230af818baac5cc6 Mon Sep 17 00:00:00 2001 +From: Luke Shumaker <LukeShu@sbcglobal.net> +Date: Fri, 6 Jun 2014 19:49:12 -0400 +Subject: [PATCH 2/2] qdox2 + +--- + .../SourceComponentDescriptorExtractor.java | 11 +++++----- + .../metadata/gleaner/QDoxComponentGleaner.java | 24 +++++++++------------- + .../metadata/gleaner/SourceComponentGleaner.java | 4 ++-- + .../metadata/gleaner/QDoxComponentGleanerTest.java | 6 +++--- + 4 files changed, 21 insertions(+), 24 deletions(-) + +diff --git a/src/main/java/org/codehaus/plexus/metadata/SourceComponentDescriptorExtractor.java b/src/main/java/org/codehaus/plexus/metadata/SourceComponentDescriptorExtractor.java +index 522e9ad..9b357fc 100644 +--- a/src/main/java/org/codehaus/plexus/metadata/SourceComponentDescriptorExtractor.java ++++ b/src/main/java/org/codehaus/plexus/metadata/SourceComponentDescriptorExtractor.java +@@ -16,6 +16,7 @@ package org.codehaus.plexus.metadata; + + import java.io.File; + import java.util.ArrayList; ++import java.util.Collection; + import java.util.List; + import java.util.Map; + +@@ -24,7 +25,7 @@ import org.codehaus.plexus.metadata.gleaner.QDoxComponentGleaner; + import org.codehaus.plexus.metadata.gleaner.SourceComponentGleaner; + import org.codehaus.plexus.util.StringUtils; + +-import com.thoughtworks.qdox.JavaDocBuilder; ++import com.thoughtworks.qdox.JavaProjectBuilder; + import com.thoughtworks.qdox.model.JavaClass; + + /** +@@ -66,7 +67,7 @@ public class SourceComponentDescriptorExtractor + List<ComponentDescriptor<?>> descriptors = new ArrayList<ComponentDescriptor<?>>(); + + // Scan the sources +- JavaDocBuilder builder = new JavaDocBuilder(); ++ JavaProjectBuilder builder = new JavaProjectBuilder(); + + if ( StringUtils.isNotEmpty( sourceEncoding ) ) + { +@@ -80,12 +81,12 @@ public class SourceComponentDescriptorExtractor + builder.addSourceTree( dir ); + } + +- JavaClass[] classes = builder.getClasses(); ++ Collection<JavaClass> classes = builder.getClasses(); + + // For each class we find, try to glean off a descriptor +- for ( int i = 0; i < classes.length; i++ ) ++ for ( JavaClass klass : classes ) + { +- ComponentDescriptor<?> descriptor = gleaner.glean( builder, classes[i] ); ++ ComponentDescriptor<?> descriptor = gleaner.glean( builder, klass ); + + if ( descriptor != null ) + { +diff --git a/src/main/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleaner.java b/src/main/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleaner.java +index a1396d9..f818fea 100644 +--- a/src/main/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleaner.java ++++ b/src/main/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleaner.java +@@ -45,7 +45,7 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; + import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable; + import org.codehaus.plexus.util.StringUtils; + +-import com.thoughtworks.qdox.JavaDocBuilder; ++import com.thoughtworks.qdox.JavaProjectBuilder; + import com.thoughtworks.qdox.model.DocletTag; + import com.thoughtworks.qdox.model.JavaClass; + import com.thoughtworks.qdox.model.JavaField; +@@ -90,7 +90,7 @@ public class QDoxComponentGleaner + // ComponentGleaner Implementation + // ---------------------------------------------------------------------- + +- public ComponentDescriptor<?> glean( JavaDocBuilder classCache, JavaClass javaClass ) ++ public ComponentDescriptor<?> glean( JavaProjectBuilder classCache, JavaClass javaClass ) + throws ComponentGleanerException + { + DocletTag tag = javaClass.getTagByName( PLEXUS_COMPONENT_TAG ); +@@ -255,7 +255,7 @@ public class QDoxComponentGleaner + // Remove any Plexus specific interfaces from the calculation + // ---------------------------------------------------------------------- + +- List<JavaClass> interfaces = new ArrayList<JavaClass>( Arrays.asList( javaClass.getImplementedInterfaces() ) ); ++ List<JavaClass> interfaces = new ArrayList<JavaClass>( javaClass.getImplementedInterfaces() ); + + for ( Iterator<JavaClass> it = interfaces.iterator(); it.hasNext(); ) + { +@@ -344,10 +344,10 @@ public class QDoxComponentGleaner + return role; + } + +- private void findRequirements( JavaDocBuilder classCache, ComponentDescriptor<?> componentDescriptor, ++ private void findRequirements( JavaProjectBuilder classCache, ComponentDescriptor<?> componentDescriptor, + JavaClass javaClass ) + { +- JavaField[] fields = javaClass.getFields(); ++ List<JavaField> fields = javaClass.getFields(); + + // ---------------------------------------------------------------------- + // Search the super class for requirements +@@ -362,10 +362,8 @@ public class QDoxComponentGleaner + // Search the current class for requirements + // ---------------------------------------------------------------------- + +- for ( int i = 0; i < fields.length; i++ ) ++ for ( JavaField field : fields ) + { +- JavaField field = fields[i]; +- + DocletTag tag = field.getTagByName( PLEXUS_REQUIREMENT_TAG ); + + if ( tag == null ) +@@ -379,7 +377,7 @@ public class QDoxComponentGleaner + // Role + // ---------------------------------------------------------------------- + +- String requirementClass = field.getType().getJavaClass().getFullyQualifiedName(); ++ String requirementClass = field.getType().getFullyQualifiedName(); + + boolean isMap = requirementClass.equals( Map.class.getName() ) || + requirementClass.equals( Collection.class.getName() ); +@@ -483,7 +481,7 @@ public class QDoxComponentGleaner + private void findConfiguration( XmlPlexusConfiguration configuration, JavaClass javaClass ) + throws ComponentGleanerException + { +- JavaField[] fields = javaClass.getFields(); ++ List<JavaField> fields = javaClass.getFields(); + + // ---------------------------------------------------------------------- + // Search the super class for configurable fields. +@@ -498,10 +496,8 @@ public class QDoxComponentGleaner + // Search the current class for configurable fields. + // ---------------------------------------------------------------------- + +- for ( int i = 0; i < fields.length; i++ ) ++ for ( JavaField field : fields ) + { +- JavaField field = fields[i]; +- + DocletTag tag = field.getTagByName( PLEXUS_CONFIGURATION_TAG ); + + if ( tag == null ) +@@ -565,4 +561,4 @@ public class QDoxComponentGleaner + + return value; + } +-} +\ No newline at end of file ++} +diff --git a/src/main/java/org/codehaus/plexus/metadata/gleaner/SourceComponentGleaner.java b/src/main/java/org/codehaus/plexus/metadata/gleaner/SourceComponentGleaner.java +index d8e26c5..6a027c9 100644 +--- a/src/main/java/org/codehaus/plexus/metadata/gleaner/SourceComponentGleaner.java ++++ b/src/main/java/org/codehaus/plexus/metadata/gleaner/SourceComponentGleaner.java +@@ -18,7 +18,7 @@ package org.codehaus.plexus.metadata.gleaner; + + import org.codehaus.plexus.component.repository.ComponentDescriptor; + +-import com.thoughtworks.qdox.JavaDocBuilder; ++import com.thoughtworks.qdox.JavaProjectBuilder; + import com.thoughtworks.qdox.model.JavaClass; + + /** +@@ -30,6 +30,6 @@ public interface SourceComponentGleaner + { + String ROLE = SourceComponentGleaner.class.getName(); + +- ComponentDescriptor<?> glean( JavaDocBuilder classCache, JavaClass javaClass ) ++ ComponentDescriptor<?> glean( JavaProjectBuilder classCache, JavaClass javaClass ) + throws ComponentGleanerException; + } +\ No newline at end of file +diff --git a/src/test/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleanerTest.java b/src/test/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleanerTest.java +index c94531e..7ac7395 100644 +--- a/src/test/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleanerTest.java ++++ b/src/test/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleanerTest.java +@@ -23,7 +23,7 @@ import org.codehaus.plexus.component.repository.ComponentDescriptor; + import org.codehaus.plexus.component.repository.ComponentRequirement; + import org.codehaus.plexus.configuration.PlexusConfiguration; + +-import com.thoughtworks.qdox.JavaDocBuilder; ++import com.thoughtworks.qdox.JavaProjectBuilder; + import com.thoughtworks.qdox.model.JavaClass; + import com.thoughtworks.qdox.model.JavaSource; + +@@ -37,7 +37,7 @@ public class QDoxComponentGleanerTest + { + private QDoxComponentGleaner gleaner; + +- private JavaDocBuilder builder; ++ private JavaProjectBuilder builder; + + // @Override + protected void setUp() +@@ -46,7 +46,7 @@ public class QDoxComponentGleanerTest + super.setUp(); + + gleaner = new QDoxComponentGleaner(); +- builder = new JavaDocBuilder(); ++ builder = new JavaProjectBuilder(); + } + + // @Override +-- +2.0.0 + diff --git a/rules/plexus-component-metadata-bootstrap/delete.list b/rules/plexus-component-metadata-bootstrap/delete.list new file mode 100644 index 0000000..a8e67aa --- /dev/null +++ b/rules/plexus-component-metadata-bootstrap/delete.list @@ -0,0 +1 @@ +src/main/java/org/codehaus/plexus/maven |