Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /antelope/, /antelope/src/ise/antelope/common/, /antelope/src/ise/antelope/plugin/

antelope
Discussion topic

Back to topic list

CVS update: /antelope/, /antelope/src/ise/antelope/common/, /antelope/src/ise/antelope/plugin/

Author danson
Full name Dale Anson
Date 2004-06-06 04:09:56 PDT
Message User: danson
Date: 04/06/06 04:09:56

Modified:
 /antelope/
  build-app.xml
 /antelope/src/ise/an​telope/common/
  AntUtils.java, AntelopePanel.java, version.txt
 /antelope/src/ise/an​telope/plugin/
  AntelopeOptions.java, AntelopePlugin.java

Log:
 Commit for version 3.1.8.
 
 Issue number:
 Obtained from:
 Submitted by:
 Reviewed by:

File Changes:

Directory: /antelope/
=====================

File [changed]: build-app.xml
Url: http://antelope.tigr​is.org/source/browse​/antelope/build-app.​xml?r1=1.16&r2=1​.17
Delta lines: +0 -4
-------------------
--- build-app.xml 24 May 2004 13:03:07 -0000 1.16
+++ build-app.xml 6 Jun 2004 11:09:55 -0000 1.17
@@ -293,8 +293,4 @@
         <mkdir dir="${dist.dir}"/>
         <property name="init.done" value="true"/>
     </target>
-
- <target name="test" description="test">
- <antcall target="whoop-de-doo"/>
- </target>
 </project>

Directory: /antelope/src/ise/an​telope/common/
====================​====================​=====

File [changed]: AntUtils.java
Url: http://antelope.tigr​is.org/source/browse​/antelope/src/ise/an​telope/common/AntUti​ls.java?r1=1.1&r​2=1.2
Delta lines: +114 -34
----------------------
--- AntUtils.java 8 May 2004 03:17:23 -0000 1.1
+++ AntUtils.java 6 Jun 2004 11:09:56 -0000 1.2
@@ -1,8 +1,10 @@
 package ise.antelope.common;
 
+import java.io.*;
 import java.util.regex.*;
+import ise.library.Os;
 
-public class AntUtils {
+public class AntUtils implements Constants {
     private static double ant_version = 0;
 
     /**
@@ -37,5 +39,83 @@
             return 1.40;
         return 1.50;
     }
+
+ /**
+ * Returns ANT_HOME as defined by an OS environment variable or System
+ * property. System property is checked first, so it takes precedence, that is,
+ * it can be added on the command line to override an environment setting.
+ * <p>
+ * Changed to for ANT_HOME first in Antelope's preferences, then System,
+ * then environment.
+ *
+ * @return ANT_HOME or null if not found in preferences, System, or environment.
+ */
+ public static String getAntHome() {
+ String ant_home = null;
+ try {
+ // third, check stored settings
+ ant_home = PREFS.get( ANT_HOME, null );
+ if ( ant_home != null ) {
+ File ant_dir = new File( ant_home );
+ if ( ant_dir.exists() ) {
+ return ant_home;
+ }
+ }
+ // first, check System properties
+ ant_home = System.getProperty( "ANT_HOME" );
+ if ( ant_home != null ) {
+ File ant_dir = new File( ant_home );
+ if ( ant_dir.exists() ) {
+ PREFS.put( ANT_HOME, ant_home );
+ return ant_home;
+ }
+ }
+
+ // second, check environment
+ ant_home = Os.getEnvironmentValue( "ANT_HOME" );
+ if ( ant_home != null ) {
+ File ant_dir = new File( ant_home );
+ if ( ant_dir.exists() ) {
+ PREFS.put( ANT_HOME, ant_home );
+ return ant_home;
+ }
+ }
+ }
+ catch ( Exception e ) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * @return a path containing directories that ant jars are loaded from
+ */
+ public static String getAntLibDirs() {
+ StringBuffer sb = new StringBuffer();
+ File ant_lib = new File( getAntHome(), "lib" );
+ if ( ant_lib.exists() && ant_lib.isDirectory() ) {
+ String[] jars = ant_lib.list( new FilenameFilter() {
+ public boolean accept( File dir, String name ) {
+ return name.endsWith( ".jar" );
+ }
+ }
+ );
+ if ( jars.length > 0 )
+ sb.append( ant_lib.getAbsolutePath() );
+ }
+
+ ant_lib = new File( System.getProperty( "user.home" ) + ".ant", "lib" );
+ if ( ant_lib.exists() && ant_lib.isDirectory() ) {
+ String[] jars = ant_lib.list( new FilenameFilter() {
+ public boolean accept( File dir, String name ) {
+ return name.endsWith( ".jar" );
+ }
+ }
+ );
+ if ( jars.length > 0 )
+ sb.append( File.pathSeparator ).append( ant_lib.getAbsolutePath() );
+ }
+ return sb.length() > 0 ? sb.toString() : null;
+ }
 
 }

File [changed]: AntelopePanel.java
Url: http://antelope.tigr​is.org/source/browse​/antelope/src/ise/an​telope/common/Antelo​pePanel.java?r1=1.16​&r2=1.17
Delta lines: +9 -4
-------------------
--- AntelopePanel.java 30 May 2004 01:42:02 -0000 1.16
+++ AntelopePanel.java 6 Jun 2004 11:09:56 -0000 1.17
@@ -1,4 +1,4 @@
-// $Id: AntelopePanel.java,v 1.16 2004/05/30 01:42:02 danson Exp $
+// $Id: AntelopePanel.java,v 1.17 2004/06/06 11:09:56 danson Exp $
 /*
  * Based on the Apache Software License, Version 1.1
  *
@@ -68,7 +68,7 @@
  * progress.
  *
  * @author Dale Anson, danson at germane-software dot com
- * @version $Revision: 1.16 $
+ * @version $Revision: 1.17 $
  * @created July 23, 2002
  */
 public class AntelopePanel extends JPanel implements Constants {
@@ -1241,9 +1241,14 @@
 
          p.setUserProperty( "ant.file", build_file.getAbsolutePath() );
          p.setProperty( "ant.version", Main.getAntVersion() );
- String ant_home = System.getProperty("ant.home");
- if (ant_home != null)
+ //String ant_home = System.getProperty("ant.home");
+ String ant_home = AntUtils.getAntHome();
+ if (ant_home != null){
              p.setProperty("ant.home", ant_home);
+ }
+ String ant_lib_dirs = AntUtils.getAntLibDirs();
+ if (ant_lib_dirs != null)
+ p.setProperty("ant.l​ibrary.dir", ant_lib_dirs);
          ProjectHelper.configureProject( p, build_file );
 
          // add ant.jar to the classpath

File [changed]: version.txt
Url: http://antelope.tigr​is.org/source/browse​/antelope/src/ise/an​telope/common/versio​n.txt?r1=1.31&r2​=1.32
Delta lines: +1 -1
-------------------
--- version.txt 30 May 2004 14:20:52 -0000 1.31
+++ version.txt 6 Jun 2004 11:09:56 -0000 1.32
@@ -1,2 +1,2 @@
 VERSION=3.1.8
-DATE=May 29 2004
\ No newline at end of file
+DATE=June 6 2004
\ No newline at end of file

Directory: /antelope/src/ise/an​telope/plugin/
====================​====================​=====

File [changed]: AntelopeOptions.java
Url: http://antelope.tigr​is.org/source/browse​/antelope/src/ise/an​telope/plugin/Antelo​peOptions.java?r1=1.​3&r2=1.4
Delta lines: +3 -13
--------------------
--- AntelopeOptions.java 8 May 2004 02:42:56 -0000 1.3
+++ AntelopeOptions.java 6 Jun 2004 11:09:56 -0000 1.4
@@ -9,6 +9,7 @@
 import org.gjt.sp.jedit.jEdit;
 import org.gjt.sp.jedit.View;
 import ise.library.KappaLayout;
+import ise.antelope.common.AntUtils;
 import ise.antelope.common.Constants;
 import ise.antelope.common.​OptionSettings;
 
@@ -34,7 +35,7 @@
 
       final JTextField ant_home_field = new JTextField( 25 );
       ant_home_field.setEditable( false );
- ant_home_field.setText( getAntHome() );
+ ant_home_field.setText( AntUtils.getAntHome() );
 
       JButton choose_btn = new JButton( "Choose..." );
 
@@ -45,7 +46,7 @@
 
       choose_btn.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent ae ) {
- String ant_home = getAntHome();
+ String ant_home = AntUtils.getAntHome();
                   if ( ant_home.equals( "" ) ) {
                      ant_home = System.getProperty( "user.home" );
                   }
@@ -85,17 +86,6 @@
                }
             }
                                   );
- }
-
- private String getAntHome() {
- String ant_home = PREFS.get( ANT_HOME, null );
- if ( ant_home != null ) {
- File ant_dir = new File( ant_home );
- if ( ant_dir.exists() ) {
- return ant_home;
- }
- }
- return "";
    }
 
    public void save() {}

File [changed]: AntelopePlugin.java
Url: http://antelope.tigr​is.org/source/browse​/antelope/src/ise/an​telope/plugin/Antelo​pePlugin.java?r1=1.1​0&r2=1.11
Delta lines: +5 -51
--------------------
--- AntelopePlugin.java 30 May 2004 01:42:02 -0000 1.10
+++ AntelopePlugin.java 6 Jun 2004 11:09:56 -0000 1.11
@@ -1,4 +1,4 @@
-// $Id: AntelopePlugin.java,v 1.10 2004/05/30 01:42:02 danson Exp $
+// $Id: AntelopePlugin.java,v 1.11 2004/06/06 11:09:56 danson Exp $
 /*
 * Based on the Apache Software License, Version 1.1
 *
@@ -57,6 +57,7 @@
 import console.*;
 import errorlist.*;
 import ise.antelope.common.​AntelopePanel;
+import ise.antelope.common.AntUtils;
 import ise.antelope.common.Constants;
 import ise.library.Os;
 import org.gjt.sp.jedit.*;
@@ -72,7 +73,7 @@
 /**
  * This is the AntelopePlugin.
  *
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
  */
 public class AntelopePlugin extends EBPlugin implements Constants {
    /**
@@ -460,7 +461,7 @@
       }
 
       // next check stored settings, System and environment
- String ant_home = getAntHome();
+ String ant_home = AntUtils.getAntHome();
       if ( ant_home == null ) {
          // check if ant.jar was loaded by jEdit
          String ant_jar = getAntJarLocation();
@@ -486,6 +487,7 @@
       }
       // got Ant home, store it in a system property
       System.setProperty("ant.home", ant_home);
+ System.setProperty("​ant.library.dir", ant_home + File.separator + "lib");
 
       // put all jars from ANT_HOME into line-separated string
       File lib_dir = new File( ant_home, "lib" );
@@ -633,54 +635,6 @@
          }
       }
       return cl;
- }
-
-
- /**
- * Returns ANT_HOME as defined by an OS environment variable or System
- * property. System property is checked first, so it takes precedence, that is,
- * it can be added on the command line to override an environment setting.
- * <p>
- * Changed to for ANT_HOME first in Antelope's preferences, then System,
- * then environment.
- *
- * @return ANT_HOME or null if not found in preferences, System, or environment.
- */
- protected static String getAntHome() {
- String ant_home = null;
- try {
- // third, check stored settings
- ant_home = PREFS.get( ANT_HOME, null );
- if ( ant_home != null ) {
- File ant_dir = new File( ant_home );
- if ( ant_dir.exists() ) {
- return ant_home;
- }
- }
- // first, check System properties
- ant_home = System.getProperty( "ANT_HOME" );
- if ( ant_home != null ) {
- File ant_dir = new File( ant_home );
- if ( ant_dir.exists() ) {
- PREFS.put( ANT_HOME, ant_home );
- return ant_home;
- }
- }
-
- // second, check environment
- ant_home = Os.getEnvironmentValue( "ANT_HOME" );
- if ( ant_home != null ) {
- File ant_dir = new File( ant_home );
- if ( ant_dir.exists() ) {
- PREFS.put( ANT_HOME, ant_home );
- return ant_home;
- }
- }
- }
- catch ( Exception e ) {
- e.printStackTrace();
- }
- return null;
    }
 
    /**




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@ante​lope.tigris.org
For additional commands, e-mail: cvs-help at antelope dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /antelope/, /antelope/src/ise/antelope/common/, /antelope/src/ise/antelope/plugin/ danson Dale Anson 2004-06-06 04:09:56 PDT
Messages per page: