Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8dc971e

Browse files
author
jossonsmith
committed
Merge with /trunk for *.j2x support over cross project references
1 parentbc2e49c commit8dc971e

File tree

6 files changed

+48
-12
lines changed

6 files changed

+48
-12
lines changed

‎src/net/sf/j2s/ui/classpath/CompositeResources.java‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
packagenet.sf.j2s.ui.classpath;
22

33
importjava.io.File;
4+
importjava.io.FileFilter;
45
importjava.io.FileInputStream;
56
importjava.io.FileNotFoundException;
67
importjava.io.IOException;
@@ -257,6 +258,25 @@ public String toJ2XString() {
257258
if (resources ==null) {
258259
this.load();
259260
}
261+
if (thisinstanceofProjectResources) {
262+
ProjectResourcespr = (ProjectResources)this;
263+
FilebinFolder =newFile(pr.getAbsoluteFolder(),this.binRelativePath);
264+
File[]files =binFolder.listFiles(newFileFilter() {
265+
publicbooleanaccept(Filepathname) {
266+
if (pathname.isFile() &&pathname.getName().endsWith(".j2x")) {
267+
returntrue;
268+
}
269+
returnfalse;
270+
}
271+
});
272+
if (files !=null &&files.length !=0) {
273+
for (inti =0;i <files.length;i++) {
274+
buf.append(files[i].getAbsolutePath());
275+
buf.append(',');
276+
}
277+
returnbuf.toString();
278+
}
279+
}
260280
for (Iteratoriter =resources.iterator();iter.hasNext();) {
261281
Resourceres = (Resource)iter.next();
262282
if (!J2SCyclicProjectUtils.visit(res)) {
@@ -290,6 +310,33 @@ public String existedClassesString() {
290310
if (resources ==null) {
291311
this.load();
292312
}
313+
if (thisinstanceofProjectResources) {
314+
ProjectResourcespr = (ProjectResources)this;
315+
FilebinFolder =newFile(pr.getAbsoluteFolder(),this.binRelativePath);
316+
File[]files =binFolder.listFiles(newFileFilter() {
317+
publicbooleanaccept(Filepathname) {
318+
if (pathname.isFile() &&pathname.getName().endsWith(".j2x")) {
319+
returntrue;
320+
}
321+
returnfalse;
322+
}
323+
});
324+
if (files !=null &&files.length !=0) {// should always one *.j2x file
325+
Propertiesprop =newProperties();
326+
try {
327+
prop.load(newFileInputStream(files[0]));
328+
}catch (FileNotFoundExceptione) {
329+
e.printStackTrace();
330+
}catch (IOExceptione) {
331+
e.printStackTrace();
332+
}
333+
Stringpkg =prop.getProperty("package.prefix");
334+
FilepkgFile =newFile(files[0].getParentFile(),pkg.replace('.','/') +"/package.js");
335+
if (pkgFile.exists()) {
336+
returnbuf.toString();
337+
}
338+
}
339+
}
293340
buf.append('[');
294341
try {
295342
buf.append(newFile(getAbsoluteFolder(),binRelativePath).getCanonicalPath());

‎src/net/sf/j2s/ui/classpath/IRuntimeClasspathEntry.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
importorg.eclipse.core.resources.IResource;
15-
importorg.eclipse.core.runtime.CoreException;
1615
importorg.eclipse.core.runtime.IPath;
1716
importorg.eclipse.jdt.core.IClasspathEntry;
1817
importorg.eclipse.jdt.core.IJavaProject;

‎src/net/sf/j2s/ui/classpath/ProjectResources.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
packagenet.sf.j2s.ui.classpath;
22

33
importjava.io.File;
4-
importjava.util.Iterator;
54

65

76
publicclassProjectResourcesextendsCompositeResources {

‎src/net/sf/j2s/ui/classpath/Resource.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
importorg.eclipse.jdt.core.IJavaModel;
1212
importorg.eclipse.jdt.core.IJavaProject;
1313
importorg.eclipse.jdt.core.JavaCore;
14-
importorg.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
1514

1615
publicclassResourceimplementsIRuntimeClasspathEntry {
1716
privateResourceparent;

‎src/net/sf/j2s/ui/launching/J2SLaunchingUtil.java‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -623,18 +623,12 @@ private static String generateHTML(ILaunchConfiguration configuration,
623623
buf.append(j2sLibPath);
624624
buf.append("\", true);\r\n");
625625
}
626-
if (j2xStr.indexOf("\"junit\"") == -1) {
627-
buf.append("ClazzLoader.packageClasspath (\"junit\",\"");
628-
buf.append(j2sLibPath);
629-
buf.append("\", true);\r\n");
630-
}
631626
buf.append(j2xStr);
632627

633628
buf.append("ClazzLoader.setPrimaryFolder (\"");
634629
buf.append(relativePath);
635630
buf.append("\");\r\n");
636631

637-
638632
J2SCyclicProjectUtils.emptyTracks();
639633
buf.append(generateClasspathIgnoredClasses(configuration,mainType,workingDir));
640634

‎src/net/sf/j2s/ui/launching/J2SUnitLaunchingUtil.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ private static String generateHTML(ILaunchConfiguration configuration,
627627
buf.append("\", true);\r\n");
628628
}
629629
buf.append(j2xStr);
630-
630+
631631
buf.append("ClazzLoader.setPrimaryFolder (\"");
632632
buf.append(relativePath);
633633
buf.append("\");\r\n");
@@ -638,8 +638,6 @@ private static String generateHTML(ILaunchConfiguration configuration,
638638
J2SCyclicProjectUtils.emptyTracks();
639639
buf.append(generateClasspathExistedClasses(configuration,mainType,workingDir));
640640

641-
//String args = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null);
642-
643641
//String args = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null);
644642
buf.append("ClazzLoader.loadClass (\"junit.textui.TestRunner\", function () {\r\n");
645643
buf.append("ClazzLoader.loadClass (\"" +mainType +"\", function () {\r\n");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp