FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed part of bug 3081009: HJ compiler puts classes in wrong dir. · hispangle/drjava@5a2208c · GitHub

Repository navigation

Commit 5a2208c

Browse files
mgricken
committed
Fixed part of bug 3081009: HJ compiler puts classes in wrong dir.
git-svn-id: file:///tmp/test-svn/trunk@5401 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent 0d34688 commit 5a2208c

8 files changed

Lines changed: 33 additions & 15 deletions

File tree

‎drjava/lib/platform.jar‎

248 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

‎misc/drjava-hj/input/hj.jar‎

0 Bytes
Binary file not shown.

‎misc/drjava-hj/input/hjc.jar‎

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

‎platform/src-hj/edu/rice/cs/drjava/model/compiler/HjCompiler.java‎

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -263,26 +263,44 @@ public java.util.List<? extends DJError> compile(java.util.List<? extends File>
263263
}
264264
if (s.length()>0) { s = s.substring(1); }
265265

266-
String [] testCommand = new String[11];
267-
testCommand[0] = "-hj";
268-
testCommand[1] = "-info";
269-
testCommand[2] = "-sp";
270-
testCommand[4] = "-cp";
271-
testCommand[5] = s;
272-
testCommand[6] = "-d";
273-
testCommand[8] = "-w";
274-
testCommand[9] = "-pp";
266+
// System.out.println("-------------------------------------");
267+
// System.out.println("-------------------------------------");
268+
// System.out.println("files = "+files);
269+
// System.out.println("sourcePath = "+sourcePath);
270+
// System.out.println("-------------------------------------");
271+
ArrayList<String> testCommand = new ArrayList<String>();
272+
testCommand.add("-hj");
273+
testCommand.add("-info");
274+
testCommand.add("-sp");
275+
int spIndex = testCommand.size();
276+
testCommand.add("<sp filled in here>");
277+
testCommand.add("-cp");
278+
testCommand.add(s);
279+
testCommand.add("-d");
280+
int destIndex = testCommand.size();
281+
if (destination != null) {
282+
testCommand.add(destination.getAbsolutePath());
283+
}
284+
else {
285+
testCommand.add("<dest dir filled in here>");
286+
}
287+
testCommand.add("-w");
288+
testCommand.add("-pp");
289+
int sourceFileIndex = testCommand.size();
290+
testCommand.add("<source file filled in here>");
275291

276292
for(File next: files) {
277-
testCommand[3] = next.getParentFile().getAbsolutePath();
278-
testCommand[7] = next.getParentFile().getAbsolutePath();
279-
testCommand[10] = next.getName();
293+
testCommand.set(spIndex, next.getParentFile().getAbsolutePath());
294+
if (destination == null) {
295+
testCommand.set(destIndex, next.getParentFile().getAbsolutePath());
296+
}
297+
testCommand.set(sourceFileIndex, next.getName());
280298

281-
// for(String cmd: testCommand) System.out.print(" "+cmd);
282-
// System.out.println();
299+
// for(String cmd: testCommand) System.out.print(" "+cmd);
300+
// System.out.println();
283301

284302
try {
285-
soot.Main.mainEntry(testCommand);
303+
soot.Main.mainEntry(testCommand.toArray(new String[testCommand.size()]));
286304
}
287305
catch(Exception e) {
288306
e.printStackTrace();

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL