summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-23 08:49:19 +0000
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-23 08:49:19 +0000
commitac62aa9ad84cd1883967ca9026ac95378507cf95 (patch)
tree2b6a704007f707ccb85443ac36e41e7efc294e9c /Tools
parentf78797d5b7d1501c108c8e2c3c8850e06129a209 (diff)
downloadedk2-platforms-ac62aa9ad84cd1883967ca9026ac95378507cf95.tar.xz
default outputpath
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1361 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/Common.java1
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/Critic.java3
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java7
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java19
4 files changed, 18 insertions, 12 deletions
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/Common.java b/Tools/Source/MigrationTools/org/tianocore/migration/Common.java
index 2fcd092315..44b25e7e12 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/Common.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/Common.java
@@ -22,6 +22,7 @@ public final class Common {
public static final int FILE = 1;
public static final int DIR = 2;
+ public static final String strseparate = "(.*)\\\\([^\\\\]*)";
public static final Pattern ptnseparate = Pattern.compile("(.*)\\\\([^\\\\]*)");
//-------------------------------------regex------------------------------------------//
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/Critic.java b/Tools/Source/MigrationTools/org/tianocore/migration/Critic.java
index 28bfd0884f..c737c31403 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/Critic.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/Critic.java
@@ -202,7 +202,8 @@ public final class Critic {
}
public static final void fireAt(String path) throws Exception {
- Common.toDoAll(Common.dirCopy_(path), Critic.class.getMethod("critic", String.class), null, null, Common.FILE);
+ //Common.toDoAll(Common.dirCopy_(path), Critic.class.getMethod("critic", String.class), null, null, Common.FILE);
+ Common.toDoAll(path, Critic.class.getMethod("critic", String.class), null, null, Common.FILE);
//Common.toDoAll(Common.dirCopy_(path), critic, Common.FILE);
System.out.println("Critic Done");
}
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java b/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
index 438625380e..83cf9b60d2 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
@@ -73,6 +73,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
defaultpathbox = new JCheckBox("Use Default Output Path", true);
defaultpathbox.addItemListener(this);
+ ModuleInfo.defaultoutput = true;
JPanel modulePanel = new JPanel();
modulePanel.add(moduleButton);
@@ -218,16 +219,14 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
} else if (e.getSource() == criticbox) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
ModuleInfo.doCritic = false;
- System.out.println("criticbox DESELECTED");
} else if (e.getStateChange() == ItemEvent.SELECTED) {
ModuleInfo.doCritic = true;
- System.out.println("criticbox SELECTED");
}
} else if (e.getSource() == defaultpathbox) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
- System.out.println("defaultpathbox DESELECTED");
+ ModuleInfo.defaultoutput = false;
} else if (e.getStateChange() == ItemEvent.SELECTED) {
- System.out.println("defaultpathbox SELECTED");
+ ModuleInfo.defaultoutput = true;
}
}
}
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java b/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
index 9e58ed914a..3e4c4cbae2 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
@@ -23,11 +23,15 @@ public class ModuleInfo {
ModuleInfo(String modulepath) throws Exception {
this.modulepath = modulepath;
- ModuleInfo.ui.println("Choose where to place the result");
- if ((outputpath = ModuleInfo.ui.getFilepath()) == null) {
- outputpath = modulepath;
+ if (ModuleInfo.defaultoutput) {
+ this.outputpath = this.modulepath.replaceAll(Common.strseparate, "$1");
+ } else {
+ ModuleInfo.ui.println("Choose where to place the result");
+ if ((outputpath = ModuleInfo.ui.getFilepath()) == null) {
+ outputpath = modulepath;
+ }
+ ModuleInfo.ui.println("Output to: " + outputpath);
}
- ModuleInfo.ui.println(outputpath);
}
public String modulepath = null;
@@ -67,7 +71,7 @@ public class ModuleInfo {
}
}
- private static final boolean isModule(String path) {
+ public static final boolean isModule(String path) {
String[] list = new File(path).list();
for (int i = 0 ; i < list.length ; i++) {
if (!new File(list[i]).isDirectory()) {
@@ -112,8 +116,8 @@ public class ModuleInfo {
ModuleInfo.ui.println("Errors Left : " + ModuleInfo.db.error);
ModuleInfo.ui.println("Complete!");
- ModuleInfo.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result");
- ModuleInfo.ui.println("Your logfile was placed here: " + mi.modulepath);
+ //ModuleInfo.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result");
+ //ModuleInfo.ui.println("Your logfile was placed here: " + mi.modulepath);
}
private static final void show(Set<String> hash, String show) {
@@ -140,6 +144,7 @@ public class ModuleInfo {
public static boolean printModuleInfo = false;
public static boolean doCritic = false;
+ public static boolean defaultoutput = false;
public static void main(String[] args) throws Exception {
ui = FirstPanel.init();