mirror of https://github.com/acidanthera/audk.git
fix logfile.close(), trim \n
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1490 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
02c768ee72
commit
99b0f0e6b2
|
@ -184,10 +184,6 @@ public final class Common {
|
||||||
Common.string2file(operation(Common.file2string(src)), des);
|
Common.string2file(operation(Common.file2string(src)), des);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract String operation(String wholeline);
|
public abstract String operation(String wholeline);
|
||||||
|
|
||||||
public abstract boolean recognize(String filename);
|
public abstract boolean recognize(String filename);
|
||||||
|
|
|
@ -63,7 +63,7 @@ public final class Critic {
|
||||||
templine.append(line + "\n");
|
templine.append(line + "\n");
|
||||||
} else if (line.matches("\\*\\*\\/")) {
|
} else if (line.matches("\\*\\*\\/")) {
|
||||||
incomment = false;
|
incomment = false;
|
||||||
templine.append(line + "\n");
|
templine.append("\n" + line + "\n");
|
||||||
} else if (incomment) {
|
} else if (incomment) {
|
||||||
if (line.contains("Routine Description:")) {
|
if (line.contains("Routine Description:")) {
|
||||||
description = true;
|
description = true;
|
||||||
|
@ -73,10 +73,12 @@ public final class Critic {
|
||||||
description = false;
|
description = false;
|
||||||
arguments = true;
|
arguments = true;
|
||||||
returns = false;
|
returns = false;
|
||||||
|
templine.append("\n");
|
||||||
} else if (line.contains("Returns:")) {
|
} else if (line.contains("Returns:")) {
|
||||||
description = false;
|
description = false;
|
||||||
arguments = false;
|
arguments = false;
|
||||||
returns = true;
|
returns = true;
|
||||||
|
templine.append("\n");
|
||||||
} else if (description) {
|
} else if (description) {
|
||||||
if (line.trim().length() != 0) {
|
if (line.trim().length() != 0) {
|
||||||
templine.append(" " + line.trim() + "\n");
|
templine.append(" " + line.trim() + "\n");
|
||||||
|
@ -88,12 +90,13 @@ public final class Critic {
|
||||||
templine.append(" @param " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n");
|
templine.append(" @param " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n");
|
||||||
} else if (inequation && line.trim().length() == 0) {
|
} else if (inequation && line.trim().length() == 0) {
|
||||||
inequation = false;
|
inequation = false;
|
||||||
templine.append(line + "\n");
|
|
||||||
} else if (inequation && line.trim().length() != 0) {
|
} else if (inequation && line.trim().length() != 0) {
|
||||||
templine.append("#%#%" + line + "\n");
|
templine.append("#%#%" + line + "\n");
|
||||||
} else {
|
} else {
|
||||||
|
if (line.trim().length() != 0) {
|
||||||
templine.append(" " + line.trim() + "\n");
|
templine.append(" " + line.trim() + "\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (returns) {
|
} else if (returns) {
|
||||||
mtrcommentequation = ptncommentequation.matcher(line);
|
mtrcommentequation = ptncommentequation.matcher(line);
|
||||||
if (mtrcommentequation.find()) {
|
if (mtrcommentequation.find()) {
|
||||||
|
@ -101,13 +104,10 @@ public final class Critic {
|
||||||
templine.append(" @retval " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n");
|
templine.append(" @retval " + mtrcommentequation.group(1) + " " + mtrcommentequation.group(2) + "\n");
|
||||||
} else if (inequation && line.trim().length() == 0) {
|
} else if (inequation && line.trim().length() == 0) {
|
||||||
inequation = false;
|
inequation = false;
|
||||||
templine.append(line + "\n");
|
|
||||||
} else if (inequation && line.trim().length() != 0) {
|
} else if (inequation && line.trim().length() != 0) {
|
||||||
templine.append("#%#%" + line + "\n");
|
templine.append("#%#%" + line + "\n");
|
||||||
} else {
|
} else {
|
||||||
if (line.trim().length() == 0) {
|
if (line.trim().length() != 0) {
|
||||||
templine.append(" " + line.trim() + "\n");
|
|
||||||
} else {
|
|
||||||
templine.append(" @return " + line.trim() + "\n");
|
templine.append(" @return " + line.trim() + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
|
||||||
logfile = new PrintWriter(new BufferedWriter(new FileWriter(startpath.replaceAll(Common.strseparate, "$1") + File.separator + "migration.log")));
|
logfile = new PrintWriter(new BufferedWriter(new FileWriter(startpath.replaceAll(Common.strseparate, "$1") + File.separator + "migration.log")));
|
||||||
MigrationTool.startMigrateAll(startpath);
|
MigrationTool.startMigrateAll(startpath);
|
||||||
logfile.flush();
|
logfile.flush();
|
||||||
|
logfile.close();
|
||||||
} catch (Exception en) {
|
} catch (Exception en) {
|
||||||
println(en.getMessage());
|
println(en.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,6 +241,7 @@ public final class SourceFileReplacer implements Common.ForDoAll {
|
||||||
}
|
}
|
||||||
//---------------------------------------inner classes---------------------------------------//
|
//---------------------------------------inner classes---------------------------------------//
|
||||||
|
|
||||||
|
//-------------------------------------process functions-------------------------------------//
|
||||||
private static final String addincludefile(String wholeline, String hfile) {
|
private static final String addincludefile(String wholeline, String hfile) {
|
||||||
return wholeline.replaceFirst("(\\*/\\s)", "$1\n#include " + hfile + "\n");
|
return wholeline.replaceFirst("(\\*/\\s)", "$1\n#include " + hfile + "\n");
|
||||||
}
|
}
|
||||||
|
@ -315,6 +316,7 @@ public final class SourceFileReplacer implements Common.ForDoAll {
|
||||||
mi.localmodulesources.add("R8Lib.h");
|
mi.localmodulesources.add("R8Lib.h");
|
||||||
mi.localmodulesources.add("R8Lib.c");
|
mi.localmodulesources.add("R8Lib.c");
|
||||||
}
|
}
|
||||||
|
//-------------------------------------process functions-------------------------------------//
|
||||||
|
|
||||||
//-----------------------------------ForDoAll-----------------------------------//
|
//-----------------------------------ForDoAll-----------------------------------//
|
||||||
public void run(String filepath) throws Exception {
|
public void run(String filepath) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue