Changeset 99
- Timestamp:
- 11/02/22 11:40:27 (2 years ago)
- Location:
- autotranslator
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
autotranslator/pom.xml
r98 r99 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>python-autotranslator</artifactId> 8 <version>2.1. 6</version>8 <version>2.1.5</version> 9 9 <packaging>jar</packaging> 10 10 … … 108 108 <type>jar</type> 109 109 <outputDirectory>downloads</outputDirectory> 110 <classifier>sources</classifier> 110 111 </artifactItem> 111 112 </artifactItems> … … 116 117 117 118 118 <plugin> 119 <plugin> 119 120 <groupId>org.apache.maven.plugins</groupId> 120 121 <artifactId>maven-compiler-plugin</artifactId> -
autotranslator/src/main/java/Try.java
r98 r99 1 import java.io.File; 2 import java.io.FileNotFoundException; 3 import java.io.FilenameFilter; 4 import java.nio.file.Path; 5 import java.nio.file.Paths; 6 import java.util.LinkedList; 7 import java.util.List; 8 9 import tudelft.utilities.j2p.PyModule; 10 import tudelft.utilities.j2p.PyProgram; 1 11 2 12 /** … … 6 16 public class Try { 7 17 18 private static final Path dir = Paths.get("downloads/geniusweb/issuevalue"); 19 20 public static void main(String[] args) throws FileNotFoundException { 21 File[] javafiles = dir.toFile().listFiles(new FilenameFilter() { 22 @Override 23 public boolean accept(File dir, String name) { 24 return name.endsWith(".java"); 25 } 26 }); 27 28 List<PyModule> modules = new LinkedList<>(); 29 for (File file : javafiles) { 30 // re-relativize as listFiles gives absolute paths 31 file = dir.relativize(file.toPath()).toFile(); 32 modules.add(PyModule.fromJavaFile(dir, file)); 33 } 34 35 PyProgram program = new PyProgram(modules); 36 System.out.println(program); 37 } 8 38 }
Note:
See TracChangeset
for help on using the changeset viewer.