private void parsedActualFile(File file, boolean retainAsTarget) throws Exception { String lib = currentLibrary; String fn = file.getName(); String lfn = fn.toLowerCase(); if (!lfn.matches(".*?\\.(c|cpp|h|hpp|hxx|m)")) { throw new CommandLineException("File '" + file + "' does not seem to be a C, C++ or Objective-C source file, nor a dynamic library, nor a *.jnaerator file."); } if (lib == null) { String name = fn; int i = name.indexOf('.'); if (i >= 0) { name = name.substring(0, i).trim(); } if (name.length() > 0) { lib = name; } System.out.println("Warning: no -library option for file '" + fn + "', using \"" + lib + "\"."); } config.addSourceFile(file, lib, !file.isFile(), retainAsTarget, true); }
public void addFramework(String framework) throws IOException { File file = JNAeratorConfigUtils.getFrameworkDirectory(framework, preprocessorConfig.frameworksPath); frameworks.add(framework); File headers = new File(file, "Headers"); if (headers.exists()) { preprocessorConfig.implicitIncludes.add(headers.getAbsolutePath()); File mainHeader = new File(headers, framework + ".h"); if (mainHeader.exists()) { addSourceFile(mainHeader, framework, true, true, false); } else { addSourceFile(headers, framework, true, true, false); } } else { new IOException("No Headers subdirectory in framework '" + framework + "' found here : " + file).printStackTrace(); } File naturalDir = new File(file, "Resources/BridgeSupport"); File f; f = new File(naturalDir, framework + ".bridgesupport"); if (!f.exists()) { f = new File(naturalDir, framework + "Full.bridgesupport"); } if (f.exists()) { bridgeSupportFiles.add(f); } }
private void parsedActualFile(File file, boolean retainAsTarget) throws Exception { String lib = currentLibrary; String fn = file.getName(); String lfn = fn.toLowerCase(); if (!lfn.matches(".*?\\.(c|cpp|h|hpp|hxx|m)")) { throw new CommandLineException("File '" + file + "' does not seem to be a C, C++ or Objective-C source file, nor a dynamic library, nor a *.jnaerator file."); } if (lib == null) { String name = fn; int i = name.indexOf('.'); if (i >= 0) { name = name.substring(0, i).trim(); } if (name.length() > 0) { lib = name; } System.out.println("Warning: no -library option for file '" + fn + "', using \"" + lib + "\"."); } config.addSourceFile(file, lib, !file.isFile(), retainAsTarget, true); }
public void addFramework(String framework) throws IOException { File file = JNAeratorConfigUtils.getFrameworkDirectory(framework, preprocessorConfig.frameworksPath); frameworks.add(framework); File headers = new File(file, "Headers"); if (headers.exists()) { preprocessorConfig.implicitIncludes.add(headers.getAbsolutePath()); File mainHeader = new File(headers, framework + ".h"); if (mainHeader.exists()) { addSourceFile(mainHeader, framework, true, true, false); } else { addSourceFile(headers, framework, true, true, false); } } else { new IOException("No Headers subdirectory in framework '" + framework + "' found here : " + file).printStackTrace(); } File naturalDir = new File(file, "Resources/BridgeSupport"); File f; f = new File(naturalDir, framework + ".bridgesupport"); if (!f.exists()) { f = new File(naturalDir, framework + "Full.bridgesupport"); } if (f.exists()) { bridgeSupportFiles.add(f); } }
if (fs != null) { for (File f : fs) { addSourceFile(f, library, true, retainAsTarget, indexSourceFilesByLibrary);
if (fs != null) { for (File f : fs) { addSourceFile(f, library, true, retainAsTarget, indexSourceFilesByLibrary);
static String preprocess(File source) throws IOException, LexerException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft SDKs\\Windows\\v7.0A\\Include"); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft Visual Studio 10.0\\VC\\include"); //config.preprocessorConfig.includeStrings.add(source); config.addSourceFile(source, null, false, true, true); Result result = new Result(config, null, null); String pre = PreprocessorUtils.preprocessSources(config, Collections.EMPTY_LIST, false, result.typeConverter, null); return pre; }
static String preprocess(File source) throws IOException, LexerException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft SDKs\\Windows\\v7.0A\\Include"); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft Visual Studio 10.0\\VC\\include"); //config.preprocessorConfig.includeStrings.add(source); config.addSourceFile(source, null, false, true, true); Result result = new Result(config, null, null); String pre = PreprocessorUtils.preprocessSources(config, Collections.EMPTY_LIST, false, result.typeConverter, null); return pre; }
file = file.getCanonicalFile(); System.out.println(file + "\n\t-> " + libraryFile); config.addSourceFile(file, libraryFile, false, true, true);
file = file.getCanonicalFile(); System.out.println(file + "\n\t-> " + libraryFile); config.addSourceFile(file, libraryFile, false, true, true);
javaOutDir.mkdirs(); config.outputDir = javaOutDir; config.addSourceFile(file, null, false, true, true); config.addRootDir(root);