List of usage examples for org.eclipse.jdt.core.compiler BuildContext getContents
public char[] getContents()
From source file:org.eclipse.swt.tools.builders.Check64CompilationParticipant.java
License:Open Source License
@Override public void buildStarting(BuildContext[] files, boolean isBatch) { if (sources == null) sources = new HashSet<String>(); // long time = System.currentTimeMillis(); for (int i = 0; i < files.length; i++) { BuildContext context = files[i]; IFile file = context.getFile();/*ww w . ja v a 2 s. com*/ IProject project = file.getProject(); Path path = new Path(buildDir + file.getProjectRelativePath().toPortableString()); IFile newFile = project.getFile(path); sources.add(newFile.getLocation().toPortableString()); try { if (newFile.exists()) { newFile.delete(true, null); } create(newFile.getParent()); char[] source = context.getContents(); replace(source); newFile.create(new ByteArrayInputStream(new String(source).getBytes()), true, null); } catch (CoreException e) { e.printStackTrace(); } } // System.out.println("copying time=" + (System.currentTimeMillis() - time)); }