diff options
author | hche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-10-16 06:23:19 +0000 |
---|---|---|
committer | hche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-10-16 06:23:19 +0000 |
commit | 0915a2ce53036927430be71ed234ed94e057c571 (patch) | |
tree | 1b5fbccb4885e0edef580ccca2c4bc7688db2091 /Tools | |
parent | 5776c5c045abf935cbfd3e1e7b4c2ae0a2a419e2 (diff) | |
download | edk2-platforms-0915a2ce53036927430be71ed234ed94e057c571.tar.xz |
1. Fix EDKT330 Source files in sub-directories are not added to MSA correctly
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1752 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
2 files changed, 8 insertions, 3 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java index 33dc521eda..b29bfe8a7e 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java @@ -230,10 +230,10 @@ public class Tools { //
// remove file separator of rear
//
- if (path.indexOf(DataType.DOS_FILE_SEPARATOR) == path.length() - DataType.DOS_FILE_SEPARATOR.length()) {
+ if (path.length() > 0 && path.indexOf(DataType.DOS_FILE_SEPARATOR) == path.length() - DataType.DOS_FILE_SEPARATOR.length()) {
path = path.substring(0, path.length() - DataType.DOS_FILE_SEPARATOR.length());
}
- if (path.indexOf(DataType.UNIX_FILE_SEPARATOR) == path.length() - DataType.UNIX_FILE_SEPARATOR.length()) {
+ if (path.length() > 0 && path.indexOf(DataType.UNIX_FILE_SEPARATOR) == path.length() - DataType.UNIX_FILE_SEPARATOR.length()) {
path = path.substring(0, path.length() - DataType.DOS_FILE_SEPARATOR.length());
}
//
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java index 6ca65fa04e..d7df17eeb6 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java @@ -526,7 +526,12 @@ public class SourceFilesDlg extends IDialog { File f[] = fc.getSelectedFiles();
String s = "";
for (int index = 0; index < f.length; index++) {
- s = s + f[index].getName() + ";";
+ String relativePath = "";
+ relativePath = Tools.getRelativePath(Tools.getFilePathOnly(f[index].getPath()), Tools.getFilePathOnly(msaFileName));
+ if (!Tools.isEmpty(relativePath)) {
+ relativePath = relativePath + DataType.UNIX_FILE_SEPARATOR;
+ }
+ s = s + relativePath + f[index].getName() + ";";
}
this.jTextFieldFileName.setText(s);
}
|