Changeset 6811


Ignore:
Timestamp:
08/18/10 14:18:36 (9 years ago)
Author:
curtis
Message:

Better layout for static resources.

Location:
branches/maven/projects/jar2lib/src/main
Files:
2 added
1 edited
2 copied
3 moved

Legend:

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

    r6809 r6811  
    5050 */ 
    5151public class Jar2Lib { 
     52 
     53  // -- Constants -- 
     54 
     55  private static final String RESOURCE_PREFIX = "project-files/"; 
    5256 
    5357  // -- Fields -- 
     
    221225    final File outputDir = new File(outputPath); 
    222226    log("--> Copying resources"); 
    223     final List<String> jaceResources = findResources("jace/"); 
    224     for (String resource : jaceResources) copyResource(resource, outputDir); 
    225     copyResource("jace.h", includeDir); 
     227    final List<String> projectResources = findResources(RESOURCE_PREFIX); 
     228    for (String resource : projectResources) { 
     229      final String outPath = resource.substring(RESOURCE_PREFIX.length()); 
     230      if (outPath.equals("")) continue; // skip base folder 
     231      copyResource(resource, outPath, outputDir); 
     232    } 
    226233  } 
    227234 
     
    353360 
    354361  /** Copies the given resource to the specified output directory. */ 
    355   private void copyResource(String resource, File baseDir) 
     362  private void copyResource(String resource, String outPath, File baseDir) 
    356363    throws IOException 
    357364  { 
    358     log(resource); 
    359     final File outputFile = new File(baseDir, resource); 
     365    log(outPath); 
     366    final File outputFile = new File(baseDir, outPath); 
    360367    final File outputDir = outputFile.getParentFile(); 
    361368    if (!outputDir.exists()) outputDir.mkdirs(); 
Note: See TracChangeset for help on using the changeset viewer.