ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic DefaultRmicAdapter.java
Date Wed, 10 Apr 2002 08:35:02 GMT
bodewig     02/04/10 01:35:01

  Modified:    src/main/org/apache/tools/ant/taskdefs MatchingTask.java
                        Rmic.java
               src/main/org/apache/tools/ant/taskdefs/rmic
                        DefaultRmicAdapter.java
  Log:
  Really move the generated java files in rmic.
  
  PR: 5781
  
  Fixed some minor stuff in DefaultRmicAdapter while I was at it.
  
  Revision  Changes    Path
  1.20      +1 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java
  
  Index: MatchingTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- MatchingTask.java	10 Apr 2002 00:19:54 -0000	1.19
  +++ MatchingTask.java	10 Apr 2002 08:35:01 -0000	1.20
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.32      +14 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Rmic.java
  
  Index: Rmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Rmic.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Rmic.java	19 Mar 2002 22:21:34 -0000	1.31
  +++ Rmic.java	10 Apr 2002 08:35:01 -0000	1.32
  @@ -440,9 +440,22 @@
               adapter.getMapper().mapFileName(classFileName);
   
           for (int i=0; i<generatedFiles.length; i++) {
  +            if (!generatedFiles[i].endsWith(".class")) {
  +                // don't know how to handle that - a IDL file doesn't
  +                // have a corresponding Java source for example.
  +                continue;
  +            }
  +            
               String sourceFileName = 
  -                classFileName.substring(0, classFileName.length()-6) + ".java";
  +                generatedFiles[i].substring(0, classFileName.length()-6) 
  +                + ".java";
  +
               File oldFile = new File(baseDir, sourceFileName);
  +            if (!oldFile.exists()) {
  +                // no source file generated, nothing to move
  +                continue;
  +            }
  +
               File newFile = new File(sourceBaseFile, sourceFileName);
               try {
                   project.copyFile(oldFile, newFile, filtering);
  
  
  
  1.14      +17 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
  
  Index: DefaultRmicAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultRmicAdapter.java	20 Jan 2002 20:45:56 -0000	1.13
  +++ DefaultRmicAdapter.java	10 Apr 2002 08:35:01 -0000	1.14
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -263,7 +263,19 @@
       private final static Random rand = new Random();
   
       /**
  -     * Mapper that possibly returns two file names, *_Stub and *_Skel.
  +     * Mapper that may return up to two file names.
  +     *
  +     * <ul>
  +     *   <li>for JRMP it will return *_Stub (and *_Skel if JDK 1.1 is
  +     *     used)</li>
  +     *
  +     *   <li>for IDL it will return a random name, causing <rmic> to
  +     *     always recompile.</li>
  +     *
  +     *   <li>for IIOP it will return _*_Stub for interfaces and _*_Tie
  +     *     for non-interfaces (and determine the interface and create
  +     *     _*_Stub from that).</p>
  +     * </ul>
        */
       private class RmicFileNameMapper implements FileNameMapper {
   
  @@ -288,7 +300,9 @@
                   return null;
               }
   
  -            String base = name.substring(0, name.indexOf(".class"));
  +            // we know that name.endsWith(".class")
  +            String base = name.substring(0, name.length()-6);
  +
               String classname = base.replace(File.separatorChar, '.');
               if (attributes.getVerify() &&
                   !attributes.isValidRmiRemote(classname)) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message