directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r372639 - in /directory/trunks/apacheds/standalone/installers/plugin/src/main: java/org/apache/directory/server/standalone/installers/inno/ resources/org/apache/directory/server/standalone/installers/inno/
Date Thu, 26 Jan 2006 22:51:56 GMT
Author: akarasulu
Date: Thu Jan 26 14:51:52 2006
New Revision: 372639

URL: http://svn.apache.org/viewcvs?rev=372639&view=rev
Log:
some finishing touches to the inno installer before I test it out on windows

Modified:
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoTarget.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/inno/install.iss

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java?rev=372639&r1=372638&r2=372639&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java
Thu Jan 26 14:51:52 2006
@@ -21,23 +21,21 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.util.List;
 import java.util.Properties;
 
 import org.apache.directory.server.standalone.installers.MojoCommand;
 import org.apache.directory.server.standalone.installers.MojoHelperUtils;
 import org.apache.directory.server.standalone.installers.ServiceInstallersMojo;
 
+import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Exec;
-import org.apache.tools.ant.taskdefs.ExecTask;
 import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
 import org.apache.tools.ant.taskdefs.Touch;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.Commandline.Argument;
+
 import org.codehaus.plexus.util.Os;
 
 
@@ -66,7 +64,6 @@
         this.log = mymojo.getLog();
         File imagesDir = target.getLayout().getBaseDirectory().getParentFile();
         innoConfigurationFile = new File( imagesDir, target.getId() + ".iss" );
-        initializeFiltering();
     }
     
     
@@ -82,6 +79,8 @@
      */
     public void execute() throws MojoExecutionException, MojoFailureException
     {
+        initializeFiltering();
+
         // -------------------------------------------------------------------
         // Step 1 & 4: do some error checking first for compiler and OS
         // -------------------------------------------------------------------
@@ -155,20 +154,25 @@
         task.setCommandline( cmd );
         task.setSpawn( true );
         task.setWorkingDirectory( target.getLayout().getBaseDirectory() );
-        int retval = 0;
         try
         {
-            retval = task.execute();
+            task.execute();
         }
         catch ( IOException e )
         {
             throw new MojoFailureException( "Failed while trying to execute " + innoCompiler.getAbsolutePath()

                 + ": " + e.getMessage() );
         }
+        
+        if ( task.getExitValue() != 0 )
+        {
+            throw new MojoFailureException( innoCompiler.getAbsolutePath() 
+                + " execution resulted in a non-zero exit value: " + task.getExitValue()
);
+        }
     }
 
 
-    private void initializeFiltering() 
+    private void initializeFiltering() throws MojoFailureException 
     {
         filterProperties.putAll( mymojo.getProject().getProperties() );
         filterProperties.put( "app" , mymojo.getApplicationName() );
@@ -181,10 +185,9 @@
         {
             filterProperties.put( "app.version", mymojo.getApplicationVersion() );
         }
-        
-        if ( mymojo.getApplicationDescription() != null )
+        else
         {
-            filterProperties.put( "app.init.message", mymojo.getApplicationDescription()
);
+            filterProperties.put( "app.version", "1.0" );
         }
 
         // -------------------------------------------------------------------
@@ -196,6 +199,10 @@
         filterProperties.put( "app.url" , target.getApplicationUrl() );
         filterProperties.put( "app.java.version" , target.getApplicationJavaVersion() );
         filterProperties.put( "app.license" , target.getLayout().getLicenseFile().getPath()
);
+        filterProperties.put( "app.license.name" , target.getLayout().getLicenseFile().getName()
);
+        filterProperties.put( "app.company.name" , target.getCompanyName() );
+        filterProperties.put( "app.description" , mymojo.getApplicationDescription() ); 
+        filterProperties.put( "app.copyright.year", target.getCopyrightYear() );
 
         if ( ! target.getLayout().getReadmeFile().exists() )
         {
@@ -203,9 +210,31 @@
         }
         filterProperties.put( "app.readme" , target.getLayout().getReadmeFile().getPath()
);
         filterProperties.put( "app.icon" , target.getLayout().getLogoIconFile().getPath()
);
+        filterProperties.put( "app.icon.name" , target.getLayout().getLogoIconFile().getName()
);
         filterProperties.put( "image.basedir", target.getLayout().getBaseDirectory().getPath()
);
+        filterProperties.put( "app.lib.jars", getApplicationLibraryJars() );
     }
     
+    
+    private String getApplicationLibraryJars() throws MojoFailureException
+    {
+        StringBuffer buf = new StringBuffer();
+        List artifacts = target.getLibArtifacts();
+        
+        for ( int ii = 0; ii > artifacts.size(); ii++ )
+        {
+            // "Source: {#SourceBase}\lib\${artifact.file.name}; DestDir: {app}; DestName:
${app.file.name}"
+            buf.append( "Source: {#SourceBase}\\lib\\" );
+            File artifact = ( ( Artifact ) artifacts.get( ii ) ).getFile();
+            buf.append( artifact.getName() );
+            buf.append( "; DestDir: {app}; DestName: " );
+            buf.append( artifact.getName() );
+            buf.append( "\n" );
+        }
+        
+        return buf.toString();
+    }
+
     
     static void touchFile( File file )
     {

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoTarget.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoTarget.java?rev=372639&r1=372638&r2=372639&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoTarget.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoTarget.java
Thu Jan 26 14:51:52 2006
@@ -17,6 +17,7 @@
 package org.apache.directory.server.standalone.installers.inno;
 
 import java.io.File;
+import java.util.Calendar;
 
 import org.apache.directory.server.standalone.installers.Target;
 
@@ -31,7 +32,17 @@
 {
     private File innoCompiler = new File( "C:\\Program Files\\Inno Setup 5\\ISCC.exe" );
     private File innoConfigurationFile;
+    private String companyName = "Apache Software Foundation";
+    private String copyrightYear;
 
+    
+    public InnoTarget()
+    {
+       Calendar cal = Calendar.getInstance();
+       cal.setTimeInMillis( System.currentTimeMillis() );
+       setCopyrightYear( String.valueOf( cal.get( Calendar.YEAR ) ) );
+    }
+    
 
     public void setInnoCompiler(File innoCompiler)
     {
@@ -54,5 +65,29 @@
     public File getInnoConfigurationFile()
     {
         return innoConfigurationFile;
+    }
+
+
+    public void setCompanyName(String innoCompanyName)
+    {
+        this.companyName = innoCompanyName;
+    }
+
+
+    public String getCompanyName()
+    {
+        return companyName;
+    }
+
+
+    public void setCopyrightYear(String innoCopyrightYear)
+    {
+        this.copyrightYear = innoCopyrightYear;
+    }
+
+
+    public String getCopyrightYear()
+    {
+        return copyrightYear;
     }
 }

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/inno/install.iss
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/inno/install.iss?rev=372639&r1=372638&r2=372639&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/inno/install.iss
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/inno/install.iss
Thu Jan 26 14:51:52 2006
@@ -24,10 +24,10 @@
 DefaultDirName={pf}\${app}
 DefaultGroupName={#MyAppName}
 
-LicenseFile={#SourceBase}\${app.license}
+LicenseFile={#SourceBase}\${app.license.name}
 OutputDir=${installer.output.directory}
 OutputBaseFilename=${app}-${version}-setup
-SetupIconFile={#SourceBase}\${app.icon}
+SetupIconFile={#SourceBase}\${app.icon.name}
 Compression=lzma
 SolidCompression=true
 VersionInfoVersion={#MyAppVersion}



Mime
View raw message