Revision: 198 http://mindtreeinsight.svn.sourceforge.net/mindtreeinsight/?rev=198&view=rev Author: bindul Date: 2009-03-11 01:50:33 +0000 (Wed, 11 Mar 2009)
Log Message: ----------- FRQ-2014237: First step to running NSIS on linux. Next step setting it up on Linux. Additional parameter added to the plug-in: nsisExec to specify the executable. Added additional documentation. Modified Paths: -------------- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/changes/changes.xml releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/actions/MojoInfo.java releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/actions/NsisCompileAction.java releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/mojos/AbstractNsisMojo.java releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/mdo/nsisproj.mdo releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/resources/velocity/sections.vm releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/index.apt releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/todo.apt releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/usage.apt releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/site.xml Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/changes/changes.xml =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/changes/changes.xml 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/changes/changes.xml 2009-03-11 01:50:33 UTC (rev 198) @@ -35,6 +35,9 @@ <action type="add" date="2009-03-09" dev="bindul" issue="2676662" system="featureRequests"> Added change log to generated site </action> + <action type="add" date="2009-03-10" dev="bindul" issue="2014237" system="featureRequests"> + Added support to run the plug-in on Linux + </action> </release> <release version="0.1.0" date="2008-01-13" description="Initial release to support Insight"> </release> Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/actions/MojoInfo.java =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/actions/MojoInfo.java 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/actions/MojoInfo.java 2009-03-11 01:50:33 UTC (rev 198) @@ -1,5 +1,5 @@ /* - * $HeadURL: $ + * $HeadURL$ * * Copyright (c) 2007 MindTree Consulting Ltd. * @@ -32,7 +32,7 @@ * Interface used to pass plexus injected information to the actions. * * @author <a href="mailto:bindul_bhow...@mindtree.com">Bindul Bhowmik</a> - * @version $Revision: $ $Date: $ + * @version $Revision$ $Date$ */ public interface MojoInfo { @@ -71,4 +71,12 @@ * @return The project helper */ public MavenProjectHelper getProjectHelper(); + + /** + * Returns the NSIS Executable. This method allows users to use renamed + * <code>makensis</code> executables on their systems as well as to run + * the mojo on Linux. + * @return The nsis executable + */ + public String getNsisExecutable(); } Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/actions/NsisCompileAction.java =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/actions/NsisCompileAction.java 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/actions/NsisCompileAction.java 2009-03-11 01:50:33 UTC (rev 198) @@ -1,5 +1,5 @@ /* - * $HeadURL: $ + * $HeadURL$ * * Copyright (c) 2007 MindTree Consulting Ltd. * @@ -35,17 +35,12 @@ * Compiles the generated NSIS script. * * @author <a href="mailto:bindul_bhow...@mindtree.com">Bindul Bhowmik</a> - * @version $Revision: $ $Date: $ + * @version $Revision$ $Date$ * @plexus.component role="com.mindtree.techworks.insight.releng.mvn.nsis.actions.NsisAction" * role-hint="compile" */ public class NsisCompileAction implements NsisAction, NsisScriptConstants { - /** - * The make NSIS file - */ - private static final String MAKE_NSIS_FILE = "makensis.exe"; - /* (non-Javadoc) * @see com.mindtree.techworks.insight.releng.mvn.nsis.actions.NsisAction#execute(com.mindtree.techworks.insight.releng.mvn.nsis.actions.MojoInfo) */ @@ -106,20 +101,25 @@ */ private String getNsisExecutablePath(MojoInfo mojoInfo) throws NsisActionExecutionException { Log log = mojoInfo.getLog(); + String executable = mojoInfo.getNsisExecutable(); // Check if the NSIS Path is available, if so use it or throw error if (null != mojoInfo.getNsisPath()) { - File nsisExecPath = new File(mojoInfo.getNsisPath(), MAKE_NSIS_FILE); + File nsisExecPath = new File(mojoInfo.getNsisPath(), executable); if (!nsisExecPath.exists()) { - log.error("The NSIS executable is not available at the requested path. [" + mojoInfo.getNsisPath().getAbsolutePath() + "]"); - throw new NsisActionExecutionException("The NSIS executable is not available at the requested path. [" + mojoInfo.getNsisPath().getAbsolutePath() + "]"); + log.error("The NSIS executable [" + executable + "] is not " + + "available at the requested path. [" + + mojoInfo.getNsisPath().getAbsolutePath() + "]"); + throw new NsisActionExecutionException("The NSIS executable [" + + executable + "] is not available at the requested path. [" + + mojoInfo.getNsisPath().getAbsolutePath() + "]"); } return nsisExecPath.getAbsolutePath(); } // Hope the executable is on the path - return MAKE_NSIS_FILE; + return executable; } Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/mojos/AbstractNsisMojo.java =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/mojos/AbstractNsisMojo.java 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/java/com/mindtree/techworks/insight/releng/mvn/nsis/mojos/AbstractNsisMojo.java 2009-03-11 01:50:33 UTC (rev 198) @@ -1,5 +1,5 @@ /* - * $HeadURL: $ + * $HeadURL$ * * Copyright (c) 2007 MindTree Consulting Ltd. * @@ -38,7 +38,7 @@ * Abstract mojo to share common configuration * * @author <a href="mailto:bindul_bhow...@mindtree.com">Bindul Bhowmik</a> - * @version $Revision: $ $Date: $ + * @version $Revision$ $Date$ * */ public abstract class AbstractNsisMojo extends AbstractMojo implements MojoInfo { @@ -98,6 +98,18 @@ */ private File nsisPath; + /** + * The NSIS executable. On windows systems this is usually + * <code>makensis.exe</code>, and the parameter defaults to that value. This + * parameter allows the mojo to be run on *nix systems where the compiled + * NSIS filename may not have the <i>.exe</i> extension; the user can + * override the executable name. Even on a windows if someone has renamed + * the makensis file, this parameter can be used to pass that value. + * + * @parameter expression="${nsisExec}" default-value="makensis.exe" + */ + private String nsisExec; + /* (non-Javadoc) * @see org.apache.maven.plugin.Mojo#execute() */ @@ -172,4 +184,11 @@ public MavenProjectHelper getProjectHelper() { return projectHelper; } + + /* (non-Javadoc) + * @see com.mindtree.techworks.insight.releng.mvn.nsis.actions.MojoInfo#getNsisExecutable() + */ + public String getNsisExecutable() { + return nsisExec; + } } Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/mdo/nsisproj.mdo =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/mdo/nsisproj.mdo 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/mdo/nsisproj.mdo 2009-03-11 01:50:33 UTC (rev 198) @@ -1368,7 +1368,9 @@ <superClass>SetBase</superClass> <description> A dependencySet allows inclusion and exclusion of project - dependencies in the assembly. + dependencies in the assembly. Though includes and excludes are + supported when using dependency sets, note however that they + need to be specified as groupId:artifactId combination </description> <fields> <field> Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/resources/velocity/sections.vm =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/resources/velocity/sections.vm 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/main/resources/velocity/sections.vm 2009-03-11 01:50:33 UTC (rev 198) @@ -149,7 +149,8 @@ ; Uninstaller Delete "$nsisInstDir\uninst.exe" -#set($uninstPrefix = "$nsisInstDir\\") +#set($doubleBack = '\\') +#set($uninstPrefix = "$nsisInstDir$doubleBack") ## Go through the sections and delete the files #foreach($section in ${installerSections.sections}) Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/index.apt =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/index.apt 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/index.apt 2009-03-11 01:50:33 UTC (rev 198) @@ -46,7 +46,7 @@ * Stability - The current version of the plug-in is 0.1.0. Hence the features, configuration + The current version of the plug-in is 0.2.0. Hence the features, configuration and API of the plug-in are not frozen. Anything in the plug-in is subject to change at any time until version 1.0 is released. Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/todo.apt =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/todo.apt 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/todo.apt 2009-03-11 01:50:33 UTC (rev 198) @@ -23,6 +23,11 @@ * Add configuration to make artifact attachment optional * Make this part of the Maven Assembly plug-in + + * move to using the Maven + {{{http://maven.apache.org/shared/maven-common-artifact-filters/}Common Artifact Filters}} + and {{{http://maven.apache.org/shared/file-management/}File Management}} + modules in the future for better file, folder and artifact handling. Issue Tracking Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/usage.apt =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/usage.apt 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/apt/usage.apt 2009-03-11 01:50:33 UTC (rev 198) @@ -3,12 +3,12 @@ ------ Bindul Bhowmik ------ - $Date $ + $Date$ Usage The NSIS Plug-in is designed to participate in the package phase of the - build process. Once you configure the plugin, you may execute the plug-in + build process. Once you configure the plug-in, you may execute the plug-in by invoking ---- @@ -35,17 +35,17 @@ * pom.xml Configuration - The plugin needs to be defined in the pom.xml with the following required + The plug-in needs to be defined in the pom.xml with the following required configuration: ---- <project> - ... - <build> - ... - <plugins> - ... - <plugin> + ... + <build> + ... + <plugins> + ... + <plugin> <groupId>com.mindtree.techworks.insight.releng</groupId> <artifactId>maven-nsis-plugin</artifactId> <configuration> @@ -53,10 +53,10 @@ </configuration> </plugin> ... - </plugins> - ... - </build> - ... + </plugins> + ... + </build> + ... </project> ---- @@ -67,22 +67,66 @@ This plug-in requires NSIS to be installed on the system where the build is being executed. Once NSIS has been installed, there are multiple - ways in which the plug-in can get to the <makensis.exe> file requried. + ways in which the plug-in can get to the <nsis executable> file required. - * <<System Path>>: The directory containing the <makensis.exe> file can + * <<System Path>>: The directory containing the <nsis executable> file can be defined in the system path, and the plug-in can get to it. * <<pom.xml configuration>>: The plug-in configuration parameter {{{compile-mojo.html#nsisPath}nsisPath}} can be configured to point to - the directory containing the <makensis.exe> + the directory containing the <nsis executable>. - * <<Command line option OR System Variable>>: The variable <nsisPath> can + * <<pom.xml property>>: The plug-in configuration parameter + {{{compile-mojo.html#nsisPath}nsisPath}} can be configured as a property + in the <pom> of the project or a parent project. + + * <<Command line option OR System Variable>>: The variable <<<nsisPath>>> can be defined at runtime as a system variable or using the maven runtime option - as <-DnsisPath=/path/to/dir/containing/makensis.exe>. + as <-DnsisPath=/path/to/dir/containing/nsis/executable>. + + [] - Please note however that the NSIS Install directory is required only for the - {{{compile-mojo.html}compile}} goal. + <<<NOTE: The NSIS Install directory is required only for the + {{{compile-mojo.html}compile}} goal.>>> +** NSIS Executable + + The default NSIS executable on Windows is <makensis.exe>. Until version 0.1 + of the plug-in, this name was the only one used by the plug-in to invoke + NSIS. From maven-nsis-plugin version 0.2.0 this behavior has been changed, + and <makensis.exe> is now used as a default name for the NSIS executable. + Users may override the executable's name using the <<<nsisExec>>> parameter. + + As the <<<nsisPath>>> parameter, <<<nsisExec>>> may be specified in multiple + ways: + + * <<Default>>: When the parameter is not specified, it defaults to + <makensis.exe> + + * <<pom.xml configuration>>: The plug-in configuration parameter + {{{compile-mojo.html#nsisExec}nsisExec}} can be configured to specify the + name of the NSIS executable. + + * <<pom.xml property>>: The plug-in configuration parameter + {{{compile-mojo.html#nsisExec}nsisExec}} can be configured as a property + in the <pom> of the project or a parent project. + + * <<Command line option OR System Variable>>: The variable <<<nsisExec>>> can + be defined at runtime as a system variable or using the maven runtime option + as <-DnsisExec=name_of_nsis_executable>. + + [] + + An additional benefit of this parameter is that it allows using the + plug-in on a *nix machine + {{{http://sourceforge.net/tracker2/?func=detail&aid=2014237&group_id=212019&atid=1020095} Feature Request 2014237}}. + Though NSIS is designed to run on Windows machines only, it can be compiled + and run on Linux, see + {{http://www.xdevsoftware.com/blog/post/How-to-Install-the-Nullsoft-Installer---NSIS-on-Linux-.aspx}}. + + <<<NOTE: The NSIS executable name is required only for the + {{{compile-mojo.html}compile}} goal.>>> + * NSIS Project configuration The NSIS project configuration is used for information to generate @@ -94,10 +138,36 @@ configuration file used for insight UI is also available at {{insight-nsis-proj.html}}. +** Using dependency sets + + The plug-in currently uses the Maven + {{{http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-artifact/}Artifact}} + component for dependency resolution and filtering (includes and excludes). + To use the filters in the plug-in, the elements need to be specified as + <<<groupId:artifactId>>>s. So, if you want to exclude <<<artifact.jar>>> + from group <<<foo.bar>>>, you need to specify the exclusion as: + ++---------------------------------------------+ +<dependencySets> + <dependencySet> + <outputDirectory>lib</outputDirectory> + <excludes> + <exclude>foo.bar:artifact</exclude> + </excludes> + </dependencySet> +</dependencySets> ++---------------------------------------------+ + + We may move to using the Maven + {{{http://maven.apache.org/shared/maven-common-artifact-filters/}Common Artifact Filters}} + and {{{http://maven.apache.org/shared/file-management/}File Management}} + modules in the future for better file, folder and artifact handling. + <<<Note to self: open feature requests for these>>>. + Maven Repository Configuration - The NSIS plugin is currently not available at the Maven Central repository, - hence to get your maven build system to get the plugin, you may use the + The NSIS plug-in is currently not available at the Maven Central repository, + hence to get your maven build system to get the plug-in, you may use the temporary Insight Maven 2 repository at: * {{http://mindtreeinsight.svn.sourceforge.net/svnroot/mindtreeinsight/maven-repo/trunk/release/}} - For released versions Modified: releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/site.xml =================================================================== --- releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/site.xml 2009-03-10 04:22:47 UTC (rev 197) +++ releng/maven-nsis-plugin/branches/maven-nsis-plugin-0.2.0/src/site/site.xml 2009-03-11 01:50:33 UTC (rev 198) @@ -4,7 +4,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://mindtreeinsight.sourceforge.net/xsds/decoration-1.0.0.xsd" --> -<project name="NSIS Plugin"> +<project name="NSIS Plugin" 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/decoration-1.0.0.xsd"> <skin> <groupId>com.mindtree.techworks.insight.releng</groupId> <artifactId>maven-site-skin</artifactId> @@ -17,7 +19,7 @@ img="http://maven.apache.org/images/logos/maven-feather.png" /> </poweredBy> <bannerLeft> - <name>NSIS <br />Plugin</name> + <name>NSIS Plugin</name> <href>http://mindtreeinsight.sourceforge.net/releng/maven-nsis-plugin/index.html</href> </bannerLeft> <bannerRight> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ MindTreeInsight-commits mailing list MindTreeInsight-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mindtreeinsight-commits