diff --git a/alitheia/core/src/main/java/eu/sqooss/service/abstractmetric/PluginAnnotationProcessor.java b/alitheia/core/src/main/java/eu/sqooss/service/abstractmetric/PluginAnnotationProcessor.java index d9cf2b151..0cdd78db4 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/abstractmetric/PluginAnnotationProcessor.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/abstractmetric/PluginAnnotationProcessor.java @@ -32,16 +32,7 @@ */ package eu.sqooss.service.abstractmetric; -import com.sun.source.tree.MethodTree; -import com.sun.source.tree.VariableTree; -import com.sun.source.util.TreePath; -import com.sun.source.util.TreePathScanner; -import com.sun.source.util.Trees; - -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Set; import javax.tools.Diagnostic.Kind; @@ -49,155 +40,20 @@ import javax.annotation.processing.ProcessingEnvironment; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; -import javax.annotation.processing.SupportedSourceVersion; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.AnnotationMirror; -import javax.lang.model.element.AnnotationValue; -import javax.lang.model.element.Element; -import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; -@SupportedSourceVersion(SourceVersion.RELEASE_6) +//@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedAnnotationTypes("eu.sqooss.service.abstractmetric.*") public class PluginAnnotationProcessor extends AbstractProcessor { - Set declActivators = new HashSet(); - - private Trees trees; @Override public void init(ProcessingEnvironment pe) { super.init(pe); - trees = Trees.instance(pe); } @Override - public boolean process(Set annotations, - RoundEnvironment roundEnvironment) { - - MethodVisitor mv = new MethodVisitor(); - - for (Element e : roundEnvironment.getRootElements()) { - for (AnnotationMirror mirror : e.getAnnotationMirrors()) { - String annotationType = mirror.getAnnotationType().toString(); - - if (annotationType.equals(MetricDeclarations.class.getName())) { - processMetricDeclarations(mirror); - } else if (annotationType.equals(MetricDecl.class.getName())) { - processingEnv.getMessager().printMessage(Kind.ERROR, - "The @MetricDecl annotation is only allowed " + - "as a child of @MetricDeclarations"); - } - } - - TreePath tp = trees.getPath(e); - mv.scan(tp, trees); - } - - - + public boolean process(Set annotations, RoundEnvironment roundEnvironment) { return true; } - - private void processMetricDeclarations(AnnotationMirror aMirror) { - try { - Map mirrorMap = aMirror.getElementValues(); - - for (Map.Entry mirrorEntry : mirrorMap.entrySet()) { - final String mirrorKey = mirrorEntry.getKey().toString(); - - if (mirrorKey.equals("metrics()")) { - List anns = extractMetricDecl(mirrorEntry.getValue()); - for (AnnotationValue annVal : anns) { - extractMetricDeclParams(annVal); - } - } - } - } catch (Exception ex) { - processingEnv.getMessager().printMessage(Kind.ERROR, - "processMetricDeclarations: " + ex.getMessage()); - } - } - - private List extractMetricDecl( - AnnotationValue aAnnotationValue) { - return (List) aAnnotationValue.getValue(); - } - - private void extractMetricDeclParams(AnnotationValue aAnnotationValue) { - - AnnotationMirror am = (AnnotationMirror) aAnnotationValue; - Map amMap = am - .getElementValues(); - String mnemonic = "", descr = "", act = ""; - for (Map.Entry amMirrorEntry : amMap.entrySet()) { - String amMirrorKey = amMirrorEntry.getKey().toString(); - - - if (amMirrorKey.equals("mnemonic()")) { - mnemonic = amMirrorEntry.getValue().toString(); - mnemonic = mnemonic.substring(1, mnemonic.length() - 1); - } else if (amMirrorKey.equals("descr()")) { - descr = amMirrorEntry.getValue().toString(); - } else if (amMirrorKey.equals("activator()")) { - act = amMirrorEntry.getValue().toString(); - } - } - - if (mnemonic.length() > 10) - processingEnv.getMessager().printMessage(Kind.ERROR, - "Mnemonic " + mnemonic + " is too long. " + - "A metric mnemonic can only be < 10 chars long"); - - if (mnemonic.equals("")) - processingEnv.getMessager().printMessage(Kind.ERROR, - "Metric mnemonic is an empty String"); - - if (descr == null || descr.length() <= 0) - processingEnv.getMessager().printMessage(Kind.WARNING, - "A valid description should be specified with metric " - + mnemonic); - - declActivators.add(act); - } - - /* - * A simple visitor that records method objects for methods that comply with - * the Alitheia Core plug-in interface requirements. - */ - private class MethodVisitor extends TreePathScanner { - - List methods = new ArrayList(); - - @Override - public Object visitMethod(MethodTree methodTree, Trees trees) { - String name = methodTree.getName().toString(); - - if (name.equals("run")) { - if (!methodTree.getReturnType().toString().equals("void")) - return super.visitMethod(methodTree, trees); - - List params = methodTree.getParameters(); - - // The run method has exactly 1 argument - if (params.size() != 1) - return super.visitMethod(methodTree, trees); - - String paramType = params.get(0).getType().toString(); - - if (paramType.startsWith("eu.sqooss.service.db")) - methods.add(methodTree); - } - - if (name.equals("getResult")) { - methods.add(methodTree); - } - - return super.visitMethod(methodTree, trees); - } - - public List getMethodList() { - return methods; - } - } } diff --git a/doc/tutorials/STEREO-SQOOSS-Installation-tutorial-v1.pdf b/doc/tutorials/STEREO-SQOOSS-Installation-tutorial-v1.pdf new file mode 100644 index 000000000..5084ec804 Binary files /dev/null and b/doc/tutorials/STEREO-SQOOSS-Installation-tutorial-v1.pdf differ diff --git a/external/README.txt b/external/README.txt new file mode 100644 index 000000000..5b296423e --- /dev/null +++ b/external/README.txt @@ -0,0 +1 @@ +# TODO: Describe the usage of external directory \ No newline at end of file diff --git a/external/hsqldb/osgi.bnd b/external/hsqldb/osgi.bnd deleted file mode 100644 index 692dd1be9..000000000 --- a/external/hsqldb/osgi.bnd +++ /dev/null @@ -1,10 +0,0 @@ -#-------------------------------------------------------------------------- -# Use this file to add customized Bnd instructions for the wrapped library -#-------------------------------------------------------------------------- - -# -# this unpacks the contents of the wrapped jar artifact inside the bundle -# to also inline dependencies of this artifact add Embed-Transitive: true -# -Embed-Dependency: *;scope=compile|runtime;type=!pom;inline=true -Import-Package: sun.security.action;resolution:=optional, * diff --git a/external/hsqldb/pom.xml b/external/hsqldb/pom.xml deleted file mode 100644 index 7e09bc635..000000000 --- a/external/hsqldb/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - ../pom.xml - eu.sqooss - external - 0.95-SNAPSHOT - - - - hsqldb - hsqldb - hsqldb - 1.8.0.7 - - - 4.0.0 - eu.sqooss.external - hsqldb - 1.8.0.7 - - ${bundle.symbolicName} ${wrapped.version} [osgi] - - bundle - - - - ${wrapped.groupId} - ${wrapped.artifactId} - ${wrapped.version} - - - - diff --git a/external/pom.xml b/external/pom.xml index daef63f39..504763bda 100644 --- a/external/pom.xml +++ b/external/pom.xml @@ -22,7 +22,6 @@ mysql-connector-java org.hibernate.core log4j - hsqldb dom4j com.jcraft.jsch h2 diff --git a/plug-ins/java/src/main/java/eu/sqooss/plugins/javaparser/JavaUpdater.java b/plug-ins/java/src/main/java/eu/sqooss/plugins/javaparser/JavaUpdater.java index a318f12c5..149cfc9cf 100644 --- a/plug-ins/java/src/main/java/eu/sqooss/plugins/javaparser/JavaUpdater.java +++ b/plug-ins/java/src/main/java/eu/sqooss/plugins/javaparser/JavaUpdater.java @@ -90,13 +90,11 @@ public void update() throws Exception { if (db.isDBSessionActive())db.commitDBSession(); } - @Override public void jobStateChanged(Job j, State newState) { if (newState == State.Error || newState == State.Finished) progress = 100 - (float) (((double)jobCounter.decrementAndGet() / (double)numVersions) * 100); } - @Override public int progress() { return (int) progress; } diff --git a/pom.xml b/pom.xml index 1374513b6..9849211a5 100644 --- a/pom.xml +++ b/pom.xml @@ -108,6 +108,12 @@ gousiosg@gmail.com http://istlab.dmst.aueb.gr/~george + + bkarak + Vassilios Karakoidas + vassilios.karakoidas@gmail.com + http://bkarak.wizhut.com/ + @@ -116,8 +122,28 @@ scm:git:ssh://git@git.sqo-oss.org:sqo-oss.git + + + org.apache.maven.plugins + maven-assembly-plugin + 2.3 + + + + + jar-with-dependencies + + + + org.ops4j maven-pax-plugin @@ -164,6 +190,8 @@ + + @@ -178,6 +206,8 @@ + + skiptests @@ -218,7 +248,7 @@ false - +