Improve JS compilation times.

This commit is contained in:
Paulo Gustavo Veiga 2012-03-22 02:02:27 -03:00
parent 20c5ee5b43
commit 9a9837af35
7 changed files with 171 additions and 211 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@ wisemapping.ipr
wisemapping.iws
wisemapping.iml
wisemapping.ids
*/wisemapping.log*
wisemapping.log*
*/.DS_Store
.DS_Store
target

View File

@ -33,9 +33,8 @@
</plugin>
<plugin>
<groupId>net.sf.alchim</groupId>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>0.7.1</version>
<executions>
<execution>
<phase>generate-resources</phase>

View File

@ -47,157 +47,6 @@
</goals>
<configuration>
<tasks>
<mkdir dir="${basedir}/target/classes"/>
<concat destfile="${basedir}/target/tmp/mindplot.js" append="false">
<filelist dir="${basedir}/src/main/javascript/" files="header.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="TopicEventDispatcher.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/IMindmap.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/Mindmap.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/INodeModel.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/NodeModel.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/RelationshipModel.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ActionDispatcher.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="StandaloneActionDispatcher.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DesignerModel.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="Designer.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ScreenManager.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="Workspace.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ShrinkConnector.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DesignerKeyboard.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="NodeGraph.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="Topic.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="CentralTopic.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="MainTopic.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragTopic.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragManager.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragPivot.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ConnectionLine.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="RelationshipLine.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragConnector.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="TextEditor.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="MultilineTextEditor.js"/>
<!--<filelist dir="${basedir}/src/main/javascript/" files="RichTextEditor.js"/>-->
<filelist dir="${basedir}/src/main/javascript/" files="TextEditorFactory.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="util/Shape.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="util/FadeEffect.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="persistence/ModelCodeName.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="persistence/XMLSerializer_Pela.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="persistence/XMLSerializer_Tango.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="persistence/Pela2TangoMigrator.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="persistence/XMLSerializer_Beta.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="persistence/Beta2PelaMigrator.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="persistence/XMLSerializerFactory.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="PersistenceManager.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="RestPersistenceManager.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="LocalStorageManager.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="EditorProperties.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="IconGroup.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="Icon.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="LinkIcon.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="NoteIcon.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ActionIcon.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ImageIcon.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/FeatureModel.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/IconModel.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/LinkModel.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="model/NoteModel.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="Command.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DesignerActionRunner.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DesignerUndoManager.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ControlPoint.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="EditorOptions.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="RelationshipPivot.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="TopicFeature.js"/>
<filelist dir="${basedir}/src/main/javascript/commands/"
files="GenericFunctionCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/commands/" files="DeleteCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/commands/"
files="DragTopicCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/commands/"
files="AddTopicCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="commands/ChangeFeatureToTopicCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="commands/RemoveFeatureFromTopicCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="commands/AddFeatureToTopicCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="commands/AddRelationshipCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="commands/MoveControlPointCommand.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="collaboration/CollaborationManager.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="collaboration/framework/AbstractCollaborativeFramework.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="collaboration/framework/AbstractCollaborativeModelFactory.js"/>
<filelist dir="${basedir}/src/main/javascript/widget/" files="ToolbarNotifier.js"/>
<filelist dir="${basedir}/src/main/javascript/widget/" files="ToolbarItem.js"/>
<filelist dir="${basedir}/src/main/javascript/widget/" files="ToolbarPaneItem.js"/>
<filelist dir="${basedir}/src/main/javascript/widget/" files="NoteEditor.js"/>
<filelist dir="${basedir}/src/main/javascript/widget/" files="LinkEditor.js"/>
<filelist dir="${basedir}/src/main/javascript/widget/" files="FloatingTip.js"/>
<filelist dir="${basedir}/src/main/javascript/widget/" files="LinkIconTooltip.js"/>
<filelist dir="${basedir}/src/main/javascript/widget/" files="KeyboardShortcutTooltip.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="widget/ColorPalettePanel.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="widget/ListToolbarPanel.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="widget/FontFamilyPanel.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="widget/FontSizePanel.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="widget/TopicShapePanel.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="widget/IconPanel.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="widget/IMenu.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="widget/Menu.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="TopicFeature.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/EventBusDispatcher.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="layout/ChangeEvent.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/LayoutManager.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/Node.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/RootedTreeSet.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/ChildrenSorterStrategy.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/AbstractBasicSorter.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/BalancedSorter.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/SymmetricSorter.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/GridSorter.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="layout/OriginalLayout.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="layout/EventBus.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="footer.js"/>
</concat>
<concat destfile="${basedir}/target/classes/mindplot.js" append="false">
<filelist dir="${basedir}/../web2d/target/classes/" files="web2d.svg-min.js"/>
<filelist dir="${basedir}/target/tmp/" files="mindplot.js"/>
</concat>
<copy toDir="${basedir}/target/classes/">
<fileset dir="${basedir}/src/main/javascript/">
<include name="libraries/**/*"/>
@ -212,9 +61,8 @@
</executions>
</plugin>
<plugin>
<groupId>net.sf.alchim</groupId>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>0.7.1</version>
<executions>
<execution>
<phase>generate-resources</phase>
@ -222,16 +70,125 @@
<goal>compress</goal>
</goals>
<configuration>
<sourceDirectory>${basedir}/target/tmp/</sourceDirectory>
<outputDirectory>${basedir}/target/classes/</outputDirectory>
<sourceDirectory>${basedir}/src/main/javascript</sourceDirectory>
<outputDirectory>${basedir}/target/compress/</outputDirectory>
<nosuffix>true</nosuffix>
<excludes>
<exclude>libraries/**/*.js</exclude>
</excludes>
<aggregations>
<aggregation>
<output>${basedir}/target/classes/mindplot-min.js</output>
<output>${project.build.directory}/classes/mindplot-min.js</output>
<inputDir>${basedir}/target/compress</inputDir>
<includes>
<include>header.js</include>
<include>${basedir}/../web2d/target/classes/web2d.svg-min.js</include>
<include>TopicEventDispatcher.js</include>
<include>model/IMindmap.js</include>
<include>model/Mindmap.js</include>
<include>model/INodeModel.js</include>
<include>model/NodeModel.js</include>
<include>model/RelationshipModel.js</include>
<include>ActionDispatcher.js</include>
<include>StandaloneActionDispatcher.js</include>
<include>DesignerModel.js</include>
<include>Designer.js</include>
<include>ScreenManager.js</include>
<include>Workspace.js</include>
<include>ShrinkConnector.js</include>
<include>DesignerKeyboard.js</include>
<include>NodeGraph.js</include>
<include>Topic.js</include>
<include>CentralTopic.js</include>
<include>MainTopic.js</include>
<include>DragTopic.js</include>
<include>DragManager.js</include>
<include>DragPivot.js</include>
<include>ConnectionLine.js</include>
<include>RelationshipLine.js</include>
<include>DragConnector.js</include>
<include>TextEditor.js</include>
<include>MultilineTextEditor.js</include>
<include>TextEditorFactory.js</include>
<include>util/Shape.js</include>
<include>util/FadeEffect.js</include>
<include>persistence/ModelCodeName.js</include>
<include>persistence/XMLSerializer_Pela.js</include>
<include>persistence/XMLSerializer_Tango.js</include>
<include>persistence/Pela2TangoMigrator.js</include>
<include>persistence/XMLSerializer_Beta.js</include>
<include>persistence/Beta2PelaMigrator.js</include>
<include>persistence/XMLSerializerFactory.js</include>
<include>PersistenceManager.js</include>
<include>RestPersistenceManager.js</include>
<include>LocalStorageManager.js</include>
<include>EditorProperties.js</include>
<include>IconGroup.js</include>
<include>Icon.js</include>
<include>LinkIcon.js</include>
<include>NoteIcon.js</include>
<include>ActionIcon.js</include>
<include>ImageIcon.js</include>
<include>model/FeatureModel.js</include>
<include>model/IconModel.js</include>
<include>model/LinkModel.js</include>
<include>model/NoteModel.js</include>
<include>Command.js</include>
<include>DesignerActionRunner.js</include>
<include>DesignerUndoManager.js</include>
<include>ControlPoint.js</include>
<include>EditorOptions.js</include>
<include>RelationshipPivot.js</include>
<include>TopicFeature.js</include>
<include>commands/GenericFunctionCommand.js</include>
<include>commands/DeleteCommand.js</include>
<include>commands/DragTopicCommand.js</include>
<include>commands/AddTopicCommand.js</include>
<include>commands/ChangeFeatureToTopicCommand.js</include>
<include>commands/RemoveFeatureFromTopicCommand.js</include>
<include>commands/AddFeatureToTopicCommand.js</include>
<include>commands/AddRelationshipCommand.js</include>
<include>commands/MoveControlPointCommand.js</include>
<include>collaboration/CollaborationManager.js</include>
<include>collaboration/framework/AbstractCollaborativeFramework.js</include>
<include>collaboration/framework/AbstractCollaborativeModelFactory.js</include>
<include>widget/ToolbarNotifier.js</include>
<include>widget/ToolbarItem.js</include>
<include>widget/ToolbarPaneItem.js</include>
<include>widget/NoteEditor.js</include>
<include>widget/LinkEditor.js</include>
<include>widget/FloatingTip.js</include>
<include>widget/LinkIconTooltip.js</include>
<include>widget/KeyboardShortcutTooltip.js</include>
<include>widget/ColorPalettePanel.js</include>
<include>widget/ListToolbarPanel.js</include>
<include>widget/FontFamilyPanel.js</include>
<include>widget/FontSizePanel.js</include>
<include>widget/TopicShapePanel.js</include>
<include>widget/IconPanel.js</include>
<include>widget/IMenu.js</include>
<include>widget/Menu.js</include>
<include>TopicFeature.js</include>
<include>layout/EventBusDispatcher.js</include>
<include>layout/ChangeEvent.js</include>
<include>layout/LayoutManager.js</include>
<include>layout/Node.js</include>
<include>layout/RootedTreeSet.js</include>
<include>layout/ChildrenSorterStrategy.js</include>
<include>layout/AbstractBasicSorter.js</include>
<include>layout/BalancedSorter.js</include>
<include>layout/SymmetricSorter.js</include>
<include>layout/GridSorter.js</include>
<include>layout/OriginalLayout.js</include>
<include>layout/EventBus.js</include>
<include>footer.js</include>
</includes>
</aggregation>
</aggregations>
<jswarn>true</jswarn>
<force>true</force>
<jswarn>false</jswarn>
<force>false</force>
<encoding>UTF-8</encoding>
<statistics>false</statistics>
</configuration>
</execution>
</executions>
@ -244,8 +201,6 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -74,6 +74,11 @@
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.1</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>

View File

@ -32,9 +32,8 @@
</executions>
</plugin>
<plugin>
<groupId>net.sf.alchim</groupId>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>0.7.1</version>
<executions>
<execution>
<phase>generate-resources</phase>
@ -42,50 +41,52 @@
<goal>compress</goal>
</goals>
<configuration>
<nosuffix>true</nosuffix>
<sourceDirectory>src/main/javascript/</sourceDirectory>
<outputDirectory>target/tmp/</outputDirectory>
<outputDirectory>target/compress</outputDirectory>
<aggregations>
<aggregation>
<output>${basedir}/target/classes/web2d.svg-min.js</output>
<output>${basedir}/target/classes/web2d.svg.js</output>
<inputDir>${basedir}/target/compress</inputDir>
<includes>
<include>${basedir}/target/tmp/header-min.js</include>
<include>${basedir}/target/tmp/peer/utils/EventUtils-min.js</include>
<include>${basedir}/target/tmp/peer/utils/TransformUtils-min.js</include>
<include>${basedir}/target/tmp/peer/svg/ElementPeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/ElipsePeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/Font-min.js</include>
<include>${basedir}/target/tmp/peer/svg/ArialFont-min.js</include>
<include>${basedir}/target/tmp/peer/svg/PolyLinePeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/CurvedLinePeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/ArrowPeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/TextPeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/WorkspacePeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/GroupPeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/RectPeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/ImagePeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/TimesFont-min.js</include>
<include>${basedir}/target/tmp/peer/svg/LinePeer-min.js</include>
<include>${basedir}/target/tmp/peer/svg/TahomaFont-min.js</include>
<include>${basedir}/target/tmp/peer/svg/VerdanaFont-min.js</include>
<include>${basedir}/target/tmp/Element-min.js</include>
<include>${basedir}/target/tmp/Elipse-min.js</include>
<include>${basedir}/target/tmp/Font-min.js</include>
<include>${basedir}/target/tmp/Group-min.js</include>
<include>${basedir}/target/tmp/Image-min.js</include>
<include>${basedir}/target/tmp/Line-min.js</include>
<include>${basedir}/target/tmp/PolyLine-min.js</include>
<include>${basedir}/target/tmp/CurvedLine-min.js</include>
<include>${basedir}/target/tmp/Arrow-min.js</include>
<include>${basedir}/target/tmp/Rect-min.js</include>
<include>${basedir}/target/tmp/Text-min.js</include>
<include>${basedir}/target/tmp/Toolkit-min.js</include>
<include>${basedir}/target/tmp/Workspace-min.js</include>
<include>header.js</include>
<include>peer/utils/EventUtils.js</include>
<include>peer/utils/TransformUtils.js</include>
<include>peer/svg/ElementPeer.js</include>
<include>peer/svg/ElipsePeer.js</include>
<include>peer/svg/Font.js</include>
<include>peer/svg/ArialFont.js</include>
<include>peer/svg/PolyLinePeer.js</include>
<include>peer/svg/CurvedLinePeer.js</include>
<include>peer/svg/ArrowPeer.js</include>
<include>peer/svg/TextPeer.js</include>
<include>peer/svg/WorkspacePeer.js</include>
<include>peer/svg/GroupPeer.js</include>
<include>peer/svg/RectPeer.js</include>
<include>peer/svg/ImagePeer.js</include>
<include>peer/svg/TimesFont.js</include>
<include>peer/svg/LinePeer.js</include>
<include>peer/svg/TahomaFont.js</include>
<include>peer/svg/VerdanaFont.js</include>
<include>Element.js</include>
<include>Elipse.js</include>
<include>Font.js</include>
<include>Group.js</include>
<include>Image.js</include>
<include>Line.js</include>
<include>PolyLine.js</include>
<include>CurvedLine.js</include>
<include>Arrow.js</include>
<include>Rect.js</include>
<include>Text.js</include>
<include>Toolkit.js</include>
<include>Workspace.js</include>
</includes>
</aggregation>
</aggregations>
<nomunge>true</nomunge>
<jswarn>false</jswarn>
<force>true</force>
<force>false</force>
</configuration>
</execution>
</executions>

View File

@ -13,15 +13,20 @@ function JSPomLoader(pomUrl, callback) {
onSuccess: function(responseText, responseXML) {
// Collect JS Urls ...
var concatRoot = responseXML.getElementsByTagName('concat');
var concatRoot = responseXML.getElementsByTagName('includes');
var fileSetArray = Array.filter(concatRoot[0].childNodes, function(elem) {
return elem.nodeType == Node.ELEMENT_NODE
});
jsUrls = new Array();
Array.each(fileSetArray, function(elem) {
var jsUrl = elem.getAttribute("dir") + elem.getAttribute("files");
jsUrls.push(jsUrl.replace("${basedir}", pomUrl.substring(0, pomUrl.lastIndexOf('/'))));
var jsUrl = elem.firstChild.nodeValue;
if (jsUrl.indexOf("${basedir}") != -1) {
jsUrls.push(pomUrl.substring(0, pomUrl.lastIndexOf('/')) + jsUrl.replace("${basedir}",""));
} else {
jsUrls.push(pomUrl.substring(0, pomUrl.lastIndexOf('/')) + "/src/main/javascript/" + jsUrl);
}
}
);

View File

@ -112,11 +112,6 @@
<artifactId>jaxb-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jsr173_api</artifactId>