Skip to content

Commit

Permalink
Removes the --print-converted-sources option because having the JDT A…
Browse files Browse the repository at this point in the history
…ST record the modifications is costly.

	Change on 2014/07/16 by kstanger <kstanger@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=71256378
  • Loading branch information
tomball committed Jul 25, 2014
1 parent 884db73 commit 58960ca
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 34 deletions.
3 changes: 0 additions & 3 deletions doc/man/j2objc.1
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ Substitute a specified prefix for a package name.
.BI \-\-prefixes " file "
Specify a properties file with prefix definitions.
.TP
\fB\-\-print\-converted\-sources\fR
Print input source files after initial conversion
.TP
.BI \-\-strip\-gwt\-incompatible
Removes methods that are marked with a GwtIncompatible
annotation, unless its value is known to be compatible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class Options {
private static File outputDirectory = new File(".");
private static boolean usePackageDirectories = true;
private static String implementationSuffix = ".m";
private static boolean printConvertedSources = false;
private static boolean ignoreMissingImports = false;
private static MemoryManagementOption memoryManagementOption = null;
private static boolean emitLineDirectives = false;
Expand Down Expand Up @@ -199,8 +198,6 @@ public static String[] load(String[] args) throws IOException {
} else {
usage("unsupported language: " + s);
}
} else if (arg.equals("--print-converted-sources")) {
printConvertedSources = true;
} else if (arg.equals("--ignore-missing-imports")) {
ignoreMissingImports = true;
} else if (arg.equals("-use-reference-counting")) {
Expand Down Expand Up @@ -430,10 +427,6 @@ public static String getImplementationFileSuffix() {
return implementationSuffix;
}

public static boolean printConvertedSources() {
return printConvertedSources;
}

public static boolean ignoreMissingImports() {
return ignoreMissingImports;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ protected void processUnit(String path, String source, CompilationUnit unit, Tim
processedFiles.add(relativePath);
seenFiles.add(relativePath);

// Needed for saving converted sources.
unit.recordModifications();
applyMutations(unit, ticker);
ticker.tick("Tree mutations");

Expand All @@ -128,10 +126,6 @@ protected void processUnit(String path, String source, CompilationUnit unit, Tim
return;
}

if (Options.printConvertedSources()) {
saveConvertedSource(path, source, unit);
}

logger.finest("writing output file(s) to " + Options.getOutputDirectory().getAbsolutePath());

generateObjectiveCSource(path, source, unit, ticker);
Expand Down Expand Up @@ -396,23 +390,6 @@ private File findFile(String path, String sourcePath) {
return null;
}

private void saveConvertedSource(String filename, String source, CompilationUnit unit) {
try {
Document doc = new Document(source);
TextEdit edit = unit.rewrite(doc, null);
edit.apply(doc);
File outputFile = new File(Options.getOutputDirectory(), filename);
outputFile.getParentFile().mkdirs();
Files.write(doc.get(), outputFile, Options.getCharset());
} catch (MalformedTreeException e) {
throw new AssertionError(e);
} catch (BadLocationException e) {
throw new AssertionError(e);
} catch (IOException e) {
ErrorUtil.error(e.getMessage());
}
}

private static void loadMappingFiles() {
for (String resourceName : Options.getMappingFiles()) {
Properties mappings = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Other options:\n\
-pluginoptions <options> Comma separated key=value pairs passed to all plugins.\n\
--prefix <package=prefix> Substitute a specified prefix for a package name.\n\
--prefixes <file> Specify a properties file with prefix definitions.\n\
--print-converted-sources Print input source files after initial conversion.\n\
--strip-gwt-incompatible Removes methods that are marked with a GwtIncompatible\
\n annotation, unless its value is known to be compatible.\n\
--strip-reflection Do not generate metadata needed for Java reflection.\n\
Expand Down

0 comments on commit 58960ca

Please sign in to comment.