Revision: 65
          http://mvn-infix.svn.sourceforge.net/mvn-infix/?rev=65&view=rev
Author:   bindul
Date:     2010-11-29 12:48:12 +0000 (Mon, 29 Nov 2010)

Log Message:
-----------
Weekend work:
1. Further refactoring for velocity
2. Build/plugin updates in parent
3. Site id change in piwik
4. Updated modello handling

Modified Paths:
--------------
    plugins/maven-jsmooth-plugin/trunk/src/site/site.xml
    plugins/maven-nsis-plugin/trunk/pom.xml
    
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/actions/ScriptGenerationAction.java
    
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/io/ProjectFileReader.java
    
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/mojos/AbstractNsisMojo.java
    plugins/maven-nsis-plugin/trunk/src/main/mdo/nsisproj.mdo
    plugins/maven-nsis-plugin/trunk/src/site/apt/index.apt
    plugins/maven-nsis-plugin/trunk/src/site/apt/insight-nsis-proj.apt
    plugins/maven-nsis-plugin/trunk/src/site/apt/usage.apt
    plugins/maven-nsis-plugin/trunk/src/site/site.xml

Modified: plugins/maven-jsmooth-plugin/trunk/src/site/site.xml
===================================================================
--- plugins/maven-jsmooth-plugin/trunk/src/site/site.xml        2010-11-29 
12:47:23 UTC (rev 64)
+++ plugins/maven-jsmooth-plugin/trunk/src/site/site.xml        2010-11-29 
12:48:12 UTC (rev 65)
@@ -43,7 +43,7 @@
        <publishDate format="dd MMM yyyy" position="left"/>
        <body>
                <head>
-                       <piwik siteId="1" 
baseUrl="sourceforge.net/apps/piwik/mvn-infix/"/>
+                       <piwik siteId="4" 
baseUrl="sourceforge.net/apps/piwik/mvn-infix/"/>
                        <privacy 
href="http://mvn-infix.sourceforge.net/privacy.html"/>
                        <meta name="keywords" 
content="maven,plugin,plug-in,mindtree,maven2,maven3,mindtree 
ltd,jsmooth,jsmooth maven"/>
                        <google-cse cseId="001821074997410371686:oik3n7lzyvg" 
style="google.loader.themes.MINIMALIST" type="google-hosted"/>

Modified: plugins/maven-nsis-plugin/trunk/pom.xml
===================================================================
--- plugins/maven-nsis-plugin/trunk/pom.xml     2010-11-29 12:47:23 UTC (rev 64)
+++ plugins/maven-nsis-plugin/trunk/pom.xml     2010-11-29 12:48:12 UTC (rev 65)
@@ -64,10 +64,29 @@
                                                        <goal>xpp3-reader</goal>
                                                        <goal>xpp3-writer</goal>
                                                        <goal>java</goal>
+                                               </goals>
+                                       </execution>
+                                       <execution>
+                                               <id>generate-xsd</id>
+                                               
<phase>generate-resources</phase>
+                                               <goals>
                                                        <goal>xsd</goal>
                                                </goals>
+                                               <configuration>
+                                                       
<outputDirectory>${project.build.outputDirectory}/META-INF/xsds</outputDirectory>
+                                               </configuration>
                                        </execution>
                                        <execution>
+                                               <id>generate-xsd-site</id>
+                                               <phase>pre-site</phase>
+                                               <goals>
+                                                       <goal>xsd</goal>
+                                               </goals>
+                                               <configuration>
+                                                       
<outputDirectory>${project.reporting.outputDirectory}/xsds</outputDirectory>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
                                                <id>nsisproj-site</id>
                                                <phase>pre-site</phase>
                                                <goals>

Modified: 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/actions/ScriptGenerationAction.java
===================================================================
--- 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/actions/ScriptGenerationAction.java
 2010-11-29 12:47:23 UTC (rev 64)
+++ 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/actions/ScriptGenerationAction.java
 2010-11-29 12:48:12 UTC (rev 65)
@@ -21,24 +21,14 @@
 package com.mindtree.techworks.infix.plugins.nsis.actions;
 
 import java.io.File;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.exception.ParseErrorException;
-import org.apache.velocity.exception.ResourceNotFoundException;
-import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
-import org.apache.velocity.runtime.resource.loader.FileResourceLoader;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 
-import 
com.mindtree.techworks.infix.pluginscommon.velocity.MavenVelocityLogChute;
-import 
com.mindtree.techworks.infix.pluginscommon.velocity.RenderStringWithNewLine;
+import 
com.mindtree.techworks.infix.pluginscommon.velocity.AbstractVelocityExecutor;
 import com.mindtree.techworks.infix.pluginscommon.velocity.tools.VelocityTool;
 
 
@@ -49,7 +39,7 @@
  * @version $Revision$ $Date$
  */
 @Component ( role = NsisAction.class, hint = "script-generate" )
-public class ScriptGenerationAction implements NsisAction, NsisScriptConstants 
{
+public class ScriptGenerationAction extends AbstractVelocityExecutor 
implements NsisAction, NsisScriptConstants {
        
        /**
         * The Mojo information
@@ -258,60 +248,12 @@
                }
        }
 
-       /**
-        * Utility method to process a velocity template.
-        * @param templateName The name of the template to process
-        * @param contextInfo The map of contexts being used from the template
-        * @param outputFile The output file
-        * @throws Exception If there is an exception processing the template
+       /* (non-Javadoc)
+        * @see 
com.mindtree.techworks.infix.pluginscommon.velocity.AbstractVelocityExecutor#getMojoInfo()
         */
-       private void processVelocityTemplate(String templateName,
-                       Map<String, Object> contextInfo, File outputFile, 
boolean loadResourceFromClasspath) throws Exception {
-
-               VelocityEngine engine = new VelocityEngine();
-               engine.addProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, new 
MavenVelocityLogChute(mojoInfo.getLog()));
-               engine.addProperty("userdirective", 
RenderStringWithNewLine.class.getName());
-               
-               if (loadResourceFromClasspath) {
-                       engine.addProperty(Velocity.RESOURCE_LOADER, "class, 
file");
-                       engine.addProperty("class.resource.loader.class", 
ClasspathResourceLoader.class.getName());
-               }
-
-               StringBuilder pathBuilder = new StringBuilder();
-               
pathBuilder.append(mojoInfo.getProject().getBasedir().getAbsolutePath());
-               pathBuilder.append(", ");
-               pathBuilder.append(new 
File(System.getProperty("java.io.tmpdir")).getAbsolutePath());
-               engine.addProperty(Velocity.FILE_RESOURCE_LOADER_PATH, 
pathBuilder.toString());
-               engine.addProperty("file.resource.loader.class", 
FileResourceLoader.class.getName());
-               engine.init();
-               VelocityContext context = new VelocityContext(contextInfo);
-
-               Template template = null;
-               
-               try {
-               template = engine.getTemplate(templateName);
-               } catch (ResourceNotFoundException e) {
-                       mojoInfo.getLog().error("Unable to load required 
velocity template", e);
-                       throw e;
-               } catch (ParseErrorException e) {
-                       mojoInfo.getLog().error("Invalid velocity template", e);
-                       throw e;
-               }
-               
-               FileWriter fileWriter = null;
-               
-               try {
-                       fileWriter = new FileWriter(outputFile);
-                       template.merge(context, fileWriter);
-               } finally {
-                       if (null != fileWriter) {
-                               try {
-                                       fileWriter.close();
-                               } catch (IOException e) {
-                                       // Ignore
-                               }
-                       }
-               }
+       @Override
+       protected com.mindtree.techworks.infix.pluginscommon.mojo.MojoInfo 
getMojoInfo () {
+               return this.mojoInfo;
        }
 
 }

Modified: 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/io/ProjectFileReader.java
===================================================================
--- 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/io/ProjectFileReader.java
   2010-11-29 12:47:23 UTC (rev 64)
+++ 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/io/ProjectFileReader.java
   2010-11-29 12:48:12 UTC (rev 65)
@@ -35,9 +35,9 @@
 
        /**
         * Reads the project file
-        * @param nsisProjectFile 
-        * @return
-        * @throws IOException
+        * @param nsisProjectFile The location of the project configuration to 
read
+        * @return The read NSIS project model
+        * @throws IOException If there is an exception reading the project 
configuration
         */
        public NsisProject readProject (File nsisProjectFile) throws 
IOException;
 }

Modified: 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/mojos/AbstractNsisMojo.java
===================================================================
--- 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/mojos/AbstractNsisMojo.java
 2010-11-29 12:47:23 UTC (rev 64)
+++ 
plugins/maven-nsis-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/nsis/mojos/AbstractNsisMojo.java
 2010-11-29 12:48:12 UTC (rev 65)
@@ -23,6 +23,7 @@
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
@@ -65,6 +66,17 @@
        private MavenProject project;
        
        /**
+        * The maven session the execution is running in
+        * 
+     * @parameter expression="${session}"
+     * @readonly
+     * @required
+     * 
+     * @since 0.3.0
+     */
+    protected MavenSession session;
+       
+       /**
         * The maven project helper to attach the artifacts
         * 
         * @component
@@ -172,4 +184,12 @@
                return projectHelper;
        }
 
+       /* (non-Javadoc)
+        * @see 
com.mindtree.techworks.infix.pluginscommon.mojo.MojoInfo#getSession()
+        */
+       @Override
+       public MavenSession getSession () {
+               return session;
+       }
+
 }

Modified: plugins/maven-nsis-plugin/trunk/src/main/mdo/nsisproj.mdo
===================================================================
--- plugins/maven-nsis-plugin/trunk/src/main/mdo/nsisproj.mdo   2010-11-29 
12:47:23 UTC (rev 64)
+++ plugins/maven-nsis-plugin/trunk/src/main/mdo/nsisproj.mdo   2010-11-29 
12:48:12 UTC (rev 65)
@@ -20,7 +20,7 @@
        |
        | $Id$
 -->
-<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0 
http://modello.codehaus.org/xsd/modello-1.4.0.xsd"; 
xml.namespace="http://mindtree.com/techworks/infix/plugins/nsis-plugin/${version}";
 
xml.schemaLocation="http://mvn-infix.sourceforge.net/maven-nsis-plugin/xsds/nsis-config-${version}.xsd";
 java.suppressAllWarnings="true">
+<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0 
http://modello.codehaus.org/xsd/modello-1.4.0.xsd"; 
xml.namespace="http://mindtree.com/techworks/infix/plugins/nsis-plugin/${version}";
 
xml.schemaLocation="http://mvn-infix.sourceforge.net/maven-nsis-plugin/xsd/nsis-config-${version}.xsd";
 java.suppressAllWarnings="true">
        <id>NsisProject</id>
        <name>NsisProject</name>
        <description>

Modified: plugins/maven-nsis-plugin/trunk/src/site/apt/index.apt
===================================================================
--- plugins/maven-nsis-plugin/trunk/src/site/apt/index.apt      2010-11-29 
12:47:23 UTC (rev 64)
+++ plugins/maven-nsis-plugin/trunk/src/site/apt/index.apt      2010-11-29 
12:48:12 UTC (rev 65)
@@ -38,7 +38,7 @@
        setup file. For the compilation phase however, the installer requries
        NSIS to be pre installed on the system, and the makensis.exe file either
        being available on the path or the directory containing the executable
-       being configured using the {{{compile-mojo.html#nsisPath}nsisPath}}
+       being configured using the {{{./compile-mojo.html#nsisPath}nsisPath}}
        variable.
        
        The NSIS Plug-in has been designed and built primarily to aid in the 
@@ -50,15 +50,15 @@
 
        The plug-in has four goals:
        
-       * {{{clean-mojo.html}nsis:clean}}: Cleans the NSIS Work directory
+       * {{{./clean-mojo.html}nsis:clean}}: Cleans the NSIS Work directory
        
-       * {{{compile-mojo.html}nsis:compile}}: Generates the NSIS script, 
copies the 
+       * {{{./compile-mojo.html}nsis:compile}}: Generates the NSIS script, 
copies the 
        resources and compiles the script
        
-       * {{{copy-resources-mojo.html}nsis:copy-resources}}: Copies the required
+       * {{{./copy-resources-mojo.html}nsis:copy-resources}}: Copies the 
required
        resources to the NSIS work directory
        
-       * {{{generate-script-mojo.html}nsis:generate-script}}: Generates the 
NSIS
+       * {{{./generate-script-mojo.html}nsis:generate-script}}: Generates the 
NSIS
        script.
 
 * Stability
@@ -73,8 +73,8 @@
 
 * Usage
 
-       Instructions on using the plug-in is described {{{usage.html}here}}.
+       Instructions on using the plug-in is described {{{./usage.html}here}}.
        
 * Examples
        
-       An example for configuring the plug-in is available 
{{{insight-nsis-proj.html}here}}.
\ No newline at end of file
+       An example for configuring the plug-in is available 
{{{./insight-nsis-proj.html}here}}.
\ No newline at end of file

Modified: plugins/maven-nsis-plugin/trunk/src/site/apt/insight-nsis-proj.apt
===================================================================
--- plugins/maven-nsis-plugin/trunk/src/site/apt/insight-nsis-proj.apt  
2010-11-29 12:47:23 UTC (rev 64)
+++ plugins/maven-nsis-plugin/trunk/src/site/apt/insight-nsis-proj.apt  
2010-11-29 12:48:12 UTC (rev 65)
@@ -32,7 +32,7 @@
 
        The section below shows the section used in the pom.xml of the insight 
ui
        
-----
++-------------------------------------------------------------------------------
 <project>
        ...
        <build>
@@ -61,13 +61,13 @@
        </build>
        ...
 </project>
-----
++-------------------------------------------------------------------------------
 
 * insight-nsis.xml
 
        The following is the insight-nsis.xml file placed in src/assembly
        
-----
++-------------------------------------------------------------------------------
 <nsisProject
        xmlns="http://mindtreeinsight.sourceforge.net/releng/mvn/nsis/0.1.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
@@ -263,4 +263,4 @@
                </uninstallAppRunCheckFn>
        </functions>
 </nsisProject>
-----
\ No newline at end of file
++-------------------------------------------------------------------------------
\ No newline at end of file

Modified: plugins/maven-nsis-plugin/trunk/src/site/apt/usage.apt
===================================================================
--- plugins/maven-nsis-plugin/trunk/src/site/apt/usage.apt      2010-11-29 
12:47:23 UTC (rev 64)
+++ plugins/maven-nsis-plugin/trunk/src/site/apt/usage.apt      2010-11-29 
12:48:12 UTC (rev 65)
@@ -28,15 +28,15 @@
        build process. Once you configure the plugin, you may execute the 
plug-in
        by invoking
        
-----
++-------------------------------------------------------------------------------
 mvn package
-----
++-------------------------------------------------------------------------------
        
        The individual goals of the package can also be invoked as
        
-----
++-------------------------------------------------------------------------------
 mvn nsis:<goal>
-----
++-------------------------------------------------------------------------------
        
        Where <goal> is one of the existing goals of the plug-in.
        
@@ -55,7 +55,7 @@
        The plugin needs to be defined in the pom.xml with the following 
required
        configuration:
        
-----
++-------------------------------------------------------------------------------
 <project>
        ...
        <build>
@@ -75,10 +75,10 @@
        </build>
        ...
 </project>
-----
++-------------------------------------------------------------------------------
        
        The other optional configurations of this section can be seen in the 
-       {{{plugin-info.html}goal}} configuration page.
+       {{{./plugin-info.html}goal}} configuration page.
        
 ** NSIS Install Directory
 
@@ -113,6 +113,6 @@
        
 Maven Repository Configuration
 
-       Like other Infix plug-ins, this skin is not available in the 
+       Like other Infix plug-ins, this plug-in is not available in the 
        {{{http://repo1.maven.org/maven2/}Central Maven Repository}}, but only 
in
        the {{{../index.html#repository}infix maven2 repository}}.
\ No newline at end of file

Modified: plugins/maven-nsis-plugin/trunk/src/site/site.xml
===================================================================
--- plugins/maven-nsis-plugin/trunk/src/site/site.xml   2010-11-29 12:47:23 UTC 
(rev 64)
+++ plugins/maven-nsis-plugin/trunk/src/site/site.xml   2010-11-29 12:48:12 UTC 
(rev 65)
@@ -43,7 +43,7 @@
        <publishDate format="dd MMM yyyy" position="left"/>
        <body>
                <head>
-                       <piwik siteId="1" 
baseUrl="sourceforge.net/apps/piwik/mvn-infix/"/>
+                       <piwik siteId="4" 
baseUrl="sourceforge.net/apps/piwik/mvn-infix/"/>
                        <privacy 
href="http://mvn-infix.sourceforge.net/privacy.html"/>
                        <meta name="keywords" 
content="maven,plugin,plug-in,mindtree,maven2,maven3,mindtree ltd,NSIS,NSIS 
maven,Nullsoft Install System"/>
                        <google-cse cseId="001821074997410371686:oik3n7lzyvg" 
style="google.loader.themes.MINIMALIST" type="google-hosted"/>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
mvn-Infix-commits mailing list
mvn-Infix-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mvn-infix-commits

Reply via email to