Changeset 7767 for trunk/projects


Ignore:
Timestamp:
09/15/11 14:56:14 (8 years ago)
Author:
hinerm
Message:

Added new method to J2L to fix jar paths

A new method was added as part of the J2L.execute()
execution flow to ensure it runs regardless of how
J2L is invoked.

The method converts all "
" to "/" in the jar
paths, making them platform safe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/jar2lib/src/main/java/loci/jar2lib/Jar2Lib.java

    r7764 r7767  
    198198      } 
    199199      else if (arg.startsWith("-")) die("Unknown flag: " + arg); 
    200       else libraryJars.add(arg.replace("\\\\", "/")); 
     200      else libraryJars.add(arg); 
    201201    } 
    202202    if (projectId == null || projectName == null || libraryJars.size() == 0) { 
     
    215215    generateSkeleton(); 
    216216    copySourceFiles(); 
     217    fixLibraryPaths(); 
    217218    generateHeaders(); 
    218219    generateProxies(); 
     
    223224 
    224225    log("--> Done"); 
     226  } 
     227 
     228 /** 
     229  * Converts "\\" to "/" in all library paths, making them platform safe for CMakeLists.txt files 
     230  */ 
     231  public void fixLibraryPaths() { 
     232    ArrayList<String> tmpArray = new ArrayList<String>(); 
     233 
     234    for(String libPath : libraryJars) { 
     235      tmpArray.add(libPath.replace("\\", "/")); 
     236    } 
     237    setLibraryJars(tmpArray); 
    225238  } 
    226239 
Note: See TracChangeset for help on using the changeset viewer.