JNAerator { protected static Map<String, URL> getRuntimeFiles(JNAeratorConfig.Runtime runtime, boolean needsObjCRuntime) throws IOException { ClassLoader classLoader = JNAerator.class.getClassLoader(); Map<String, URL> ret = new LinkedHashMap<String, URL>(); String listingFile = runtime.runtimeFilesListFileName; if (listingFile == null) { return ret; } List<String> files = new ArrayList<String>(); for (String s : listingFile.split(",")) { files.addAll(ReadText.readLines(classLoader.getResourceAsStream(s.trim()))); } if (files == null) { throw new FileNotFoundException("Warning: Could not find JNAerator listing file '" + listingFile + "' : JNAerated files will need JNAerator in the path to execute."); } for (String file : files) { if (file.startsWith("Archive: ")) { continue; } if (file.startsWith("META-INF/")) { continue; } if (!needsObjCRuntime) { if (file.contains("rococoa")) { continue; } } URL url = classLoader.getResource(file); if (url == null) { if (file.matches("com/sun/jna/[^/]+/(lib\\w+\\.(jnilib|so)|\\w+\\.dll)")) { System.out.println("JNA library missing : " + file); continue; } if (file.matches("com/ochafik/lang/jnaerator/runtime/scala/.*\\.part")) { System.out.println("Scala code missing : " + file); continue; } if (file.toLowerCase().contains("android")) { continue; } throw new FileNotFoundException(file); } ret.put(file, url); } return ret; } JNAerator(JNAeratorConfig config); static String[] getJNAeratorArgsFromPref(); static void main(String[] argsArray); static void main(final JNAerator jnaerator, String[] argsArray); PrintWriter getSourceWriter(ClassOutputter outputter, String path); void jnaerate(final Feedback feedback); void parseLibSymbols(SourceFiles sourceFiles, Result result); static File getDir(String name); static File getDir(); SourceFiles parseSources(Feedback feedback, TypeConversion typeConverter); void addFile(File file, List<File> out); Result createResult(final ClassOutputter outputter, Feedback feedback); static ObjCppParser newParser(String s); void jnaerationCore(SourceFiles sourceFiles, Result result); static final String JNAERATOR_URL; static String DONATE_URL; static String ABOUT_JNAERATOR_URL; static String ABOUT_ROCOCOA_URL; static String ABOUT_BRIDJ_URL; static String ABOUT_JNA_URL; }
@Test public void testFilesLists() throws IOException { for (JNAeratorConfig.Runtime runtime : JNAeratorConfig.Runtime.values()) { JNAerator.getRuntimeFiles(runtime, false); } }