Ignore:
Timestamp:
05/28/14 09:25:14 (10 years ago)
Author:
hkaulbersch
Message:

Added a method to get the whole path of generated files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/generator/EbnfGenerator.xtend

    r69 r70  
    2222import org.eclipse.xtext.generator.IFileSystemAccessExtension2 
    2323import org.eclipse.emf.common.util.URI; 
    24  
     24import org.eclipse.xtext.generator.IFileSystemAccessExtension 
     25import java.io.PrintWriter 
    2526/** 
    2627 * Generates code from your model files on save. 
     
    3132        //generation of the xsl-file 
    3233        override void doGenerate(Resource resource, IFileSystemAccess fsa) { 
     34                var String workspacePath =WorkspaceResolver.getWorkspace(); 
    3335                for (e : resource.allContents.toIterable.filter(EtsiBnf)) { 
    3436                        if (e.bnfEntry.size!=0) { 
     
    3638                                  
    3739                                 //generate pdf 
    38 //                               var uri = (fsa as IFileSystemAccessExtension2).getURI(e.name+".fo"); 
    39 //                               (fsa as IFileSystemAccessExtension2). 
    40 //                               
    41 //                               System.out.println(uri.hasAbsolutePath()); 
    42 //                               System.out.println(uri.path.substring(0,uri.path.length-3)); 
    43 //                               System.out.println(uri.file); 
     40                                 var uri = (fsa as IFileSystemAccessExtension2).getURI(e.name+".fo"); 
     41                                 var String fullUri = workspacePath+uri.path.substring(10,uri.path.length); 
     42                                System.out.println(workspacePath+uri.path.substring(10,uri.path.length)); 
     43                                var File file = new File(fullUri); 
     44                                System.out.println(file.exists); 
    4445//                               System.out.println(uri.toString()); 
    45 //                               var File file = new File(uri.path).absoluteFile; 
     46                                  
     47                                  
    4648//                               System.out.println(file.exists); 
    47 //                               var String aPath = file.absolutePath; 
    48 //                                
     49                                 
    4950//                               foToPdf.createPdfFromFo(file,aPath.substring(0,aPath.length-3)); 
    5051                        } 
Note: See TracChangeset for help on using the changeset viewer.