Skip to content

Commit

Permalink
Merge pull request #456 from lincolnthree/OndraZizka-rules-java-archi…
Browse files Browse the repository at this point in the history
…ves-WINDUP-398

WINDUP-398, WINDUP-459 - Archive identification and skipping
  • Loading branch information
jsight committed Feb 6, 2015
2 parents b3b2f67 + d0c913d commit a47b223
Show file tree
Hide file tree
Showing 62 changed files with 1,592 additions and 214 deletions.
16 changes: 16 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@
<version>${project.version}</version>
</dependency>

<!-- Windup Rules - Java - Projects -->
<dependency>
<groupId>org.jboss.windup.rules.apps</groupId>
<artifactId>rules-java-projects</artifactId>
<classifier>forge-addon</classifier>
<version>${project.version}</version>
</dependency>

<!-- Windup Rules - Java - Archives -->
<dependency>
<groupId>org.jboss.windup.rules.apps</groupId>
<artifactId>rules-java-archives</artifactId>
<classifier>forge-addon</classifier>
<version>${project.version}</version>
</dependency>

<!-- Windup Rules - XML - Basic -->
<dependency>
<groupId>org.jboss.windup.rules.apps</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Sorts {@link WindupRuleProvider}s based upon their executeBefore/executeAfter methods.
*
* @author jsightler <jesse.sightler@gmail.com>
* @author Ondrej Zizka <zizka@seznam.cz>
* @author Ondrej Zizka <zizka@seznam.com>
*/
public class WindupRuleProviderSorter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public interface TestSomeModel extends WindupVertexFrame



}// class
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.logging.Logger;
import java.util.zip.ZipEntry;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jboss.windup.decompiler.api.DecompilationException;
import org.jboss.windup.decompiler.api.DecompilationFailure;
import org.jboss.windup.decompiler.api.DecompilationListener;
Expand Down
13 changes: 13 additions & 0 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<name>Windup - Distribution Build</name>
<packaging>pom</packaging>

<properties>
<version.nexus.index>1</version.nexus.index>
</properties>

<build>
<plugins>
<plugin>
Expand All @@ -41,6 +45,7 @@
<addonId>org.jboss.windup:ui,${project.version}</addonId>
<addonId>org.jboss.windup.rexster:rexster,${project.version}</addonId>
<addonId>org.jboss.windup.rules.apps:rules-java,${project.version}</addonId>
<addonId>org.jboss.windup.rules.apps:rules-java-project,${project.version}</addonId>
<addonId>org.jboss.windup.rules.apps:rules-java-ee,${project.version}</addonId>
</addonIds>
</configuration>
Expand Down Expand Up @@ -76,6 +81,14 @@
<artifactId>windup-bootstrap</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.jboss.windup.maven</groupId>
<artifactId>nexus-indexer-data</artifactId>
<version>${version.nexus.index}</version>
<type>zip</type>
</dependency>

</dependencies>

<profiles>
Expand Down
13 changes: 12 additions & 1 deletion dist/src/main/assembly/assembly-offline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,24 @@
<include>**</include>
</includes>
</fileSet>

</fileSets>

<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<excludes>
<exclude>org.jboss.windup.maven:nexus-indexer-data:zip:*</exclude>
</excludes>
</dependencySet>

<dependencySet>
<outputDirectory>/cache</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<unpack>true</unpack>
<includes>
<include>org.jboss.windup.maven:nexus-indexer-data:zip:*</include>
</includes>
</dependencySet>
</dependencySets>

Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/resources/bin/windup
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ if [ -z "$WINDUP_OPTS" ] ; then
fi
fi

windup_exec_cmd="\"$JAVACMD\" $WINDUP_DEBUG_ARGS $WINDUP_OPTS \"-Dforge.standalone=true\" \"-Dforge.home=${WINDUP_HOME}\" \
windup_exec_cmd="\"$JAVACMD\" $WINDUP_DEBUG_ARGS $WINDUP_OPTS \"-Dforge.standalone=true\" \"-Dforge.home=${WINDUP_HOME}\" \"-Dwindup.home=${WINDUP_HOME}\" \
-cp \"${WINDUP_HOME}/lib/*\" $WINDUP_MAIN_CLASS"

eval $windup_exec_cmd "$QUOTED_ARGS" "$ADDONS_DIR"
Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/resources/bin/windup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ if "%WINDUP_OPTS%" == "" (
set WINDUP_OPTS_INTERNAL=%WINDUP_OPTS%
)

%WINDUP_JAVA_EXE% %WINDUP_DEBUG_ARGS% %WINDUP_OPTS_INTERNAL% "-Dforge.standalone=true" "-Dforge.home=%WINDUP_HOME%" ^
%WINDUP_JAVA_EXE% %WINDUP_DEBUG_ARGS% %WINDUP_OPTS_INTERNAL% "-Dforge.standalone=true" "-Dforge.home=%WINDUP_HOME%" "-Dwindup.home=%WINDUP_HOME%" ^
-cp ".;%WINDUP_HOME%\lib\*" %WINDUP_MAIN_CLASS% %WINDUP_CMD_LINE_ARGS% %ADDONS_DIR%
if ERRORLEVEL 1 goto error
goto end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public static String prettyPrintRule(Rule rule)
}


}// class
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
import com.tinkerpop.frames.Property;
import com.tinkerpop.frames.modules.typedgraph.TypeValue;

@TypeValue("ArchiveModel")
@TypeValue(ArchiveModel.TYPE)
public interface ArchiveModel extends FileModel
{
public static String MALFORMED_ARCHIVE= "Malformed archive";

public static String TYPE = "ArchiveModel:";
public static String ARCHIVE_NAME = TYPE + "archiveName";

@Adjacency(label = "parentArchive", direction = Direction.IN)
public ArchiveModel getParentArchive();

@Adjacency(label = "parentArchive", direction = Direction.IN)
public void setParentArchive(ArchiveModel resource);

@Property("archiveName")
@Property(ARCHIVE_NAME)
public String getArchiveName();

@Property("archiveName")
@Property(ARCHIVE_NAME)
public void setArchiveName(String archiveName);

@Adjacency(label = "childArchive", direction = Direction.OUT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public GraphService(GraphContext context, Class<T> type)
this.type = type;
}

@SuppressWarnings("unchecked")
public static <T extends WindupVertexFrame> T refresh(GraphContext context, T frame)
{
return (T) context.getFramed().frame(frame.asVertex(), WindupVertexFrame.class);
}

@Override
public void commit()
{
Expand Down Expand Up @@ -73,7 +79,8 @@ public T createInMemory()
}

/**
* Create a new instance of the given {@link WindupVertexFrame} type. The ID is generated by the underlying graph database.
* Create a new instance of the given {@link WindupVertexFrame} type. The ID is generated by the underlying graph
* database.
*/
@Override
public T create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ public static Graph createFamilyGraph()
return g;
}

}// class
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ private static String asString(Person p)
return "Person name: " + p.getName() + " " + p.getClass().getSimpleName();
}

}// class
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ public String testJavaMethod()
return "base";
}
}
}// class
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public String testJavaMethod()
return "subclass";
}
}
}// class
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<module>rules-base</module>
<module>rules-java</module>
<module>rules-java-ee</module>
<module>rules-java-archives</module>
<module>rules-tattletale</module>
<module>rules-xml</module>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void vertexPropertyChanged(Vertex vertex, String key, Object oldValue, Ob
{
GraphService.addTypeToModel(event.getGraphContext(), model, type);
}
LOG.info("Mapped file [" + model.getFilePath() + "] matching pattern [" + pattern + "] to the following [" + types.size()
LOG.fine("Mapped file [" + model.getFilePath() + "] matching pattern [" + pattern + "] to the following [" + types.size()
+ "] types: " + types);
}
}
Expand Down
99 changes: 99 additions & 0 deletions rules-java-archives/addon/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jboss.windup.rules.apps</groupId>
<artifactId>rules-java-archives-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>rules-java-archives</artifactId>
<name>Windup Ruleset: Archive Identification - Addon</name>

<dependencies>

<!-- Local Dependencies -->

<!-- Addon Dependencies -->
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>dependencies</artifactId>
<classifier>forge-addon</classifier>
</dependency>
<dependency>
<groupId>org.jboss.windup.graph</groupId>
<artifactId>windup-graph</artifactId>
<classifier>forge-addon</classifier>
</dependency>
<dependency>
<groupId>org.jboss.windup.config</groupId>
<artifactId>windup-config</artifactId>
<classifier>forge-addon</classifier>
</dependency>
<dependency>
<groupId>org.jboss.windup.ext</groupId>
<artifactId>windup-config-groovy</artifactId>
<classifier>forge-addon</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.windup.utils</groupId>
<artifactId>utils</artifactId>
<classifier>forge-addon</classifier>
</dependency>
<dependency>
<groupId>org.jboss.windup.reporting</groupId>
<artifactId>windup-reporting</artifactId>
<classifier>forge-addon</classifier>
<scope>provided</scope>
</dependency>

<!-- Furnace Container -->
<dependency>
<groupId>org.jboss.forge.furnace.container</groupId>
<artifactId>cdi</artifactId>
<classifier>forge-addon</classifier>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jboss.forge.furnace</groupId>
<artifactId>furnace-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-dot</id>
<phase>prepare-package</phase>
<goals>
<goal>generate-dot</goal>
</goals>
<configuration>
<attach>true</attach>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>create-forge-addon</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>forge-addon</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.jboss.windup.rules.apps.java.archives;

import org.jboss.windup.config.WindupRulesetMetadata;

/**
* Metadata for the Java Archive Identification addon.
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*/
public class ArchiveIdentificationRulesetMetadata implements WindupRulesetMetadata
{
public static final String RULE_SET_ID = "JavaArchiveIdentification";

@Override
public String getRuleSetID()
{
return RULE_SET_ID;
}
}
Loading

0 comments on commit a47b223

Please sign in to comment.