Ignore:
Timestamp:
09/16/11 12:14:28 (8 years ago)
Author:
hinerm
Message:

Removed File usage from automation of CMakeLists.txt

The use of a File object in VelocityAutogen was forcing
all file separators to become platform specific.
Instead, an array of Strings is now passed in, and
the substring command is used on the velocity side
to parse out the file name.

Location:
trunk/projects/jar2lib/src/main
Files:
2 edited

Legend:

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

    r7709 r7773  
    134134    VelocityEngine ve = VelocityTools.createEngine(); 
    135135    VelocityContext context = VelocityTools.createContext(); 
    136      
    137     File[] libJars = new File[libraryJars.size()]; 
    138      
    139     for (int i = 0; i < libraryJars.size(); i++) 
    140     { 
    141         libJars[i] = new File(libraryJars.get(i)); 
    142     } 
    143136 
    144137    context.put("headerBlock", scriptHeader); 
     
    146139    context.put("projectName", projectName); 
    147140    context.put("sourceFiles", sourceFiles); 
    148     context.put("sourceJars", libJars); 
     141    context.put("sourceJars", libraryJars.toArray(new String[libraryJars.size()])); 
    149142    context.put("q", this); 
    150143 
  • trunk/projects/jar2lib/src/main/resources/CMakeLists.vm

    r7763 r7773  
    292292 
    293293#foreach ($jarFile in $sourceJars) 
    294 #set ($jarName = $jarFile.getName()) 
     294#set( $offset = $jarfile.lastIndexOf('/') + 1 ) 
     295#set ($jarName = $jarFile.substring($offset) ) 
    295296# copy ${jarName} 
    296297add_custom_command( 
Note: See TracChangeset for help on using the changeset viewer.