JavaRelease.st
branchdevelopment
changeset 1949 a83c0afe06a4
parent 1927 007031278841
child 1951 4759acf61df0
child 1952 eec8d42f53c9
--- a/JavaRelease.st	Fri Jan 11 18:32:33 2013 +0000
+++ b/JavaRelease.st	Sat Jan 12 16:42:57 2013 +0000
@@ -22,7 +22,7 @@
 
 Object subclass:#JavaRelease
 	instanceVariableNames:'javaHome classPath sourcePath classes bootClassPathClasses
-		extDirsClasses'
+		extDirsClasses bundle'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Languages-Java-Support'
@@ -254,6 +254,32 @@
     "Modified: / 08-01-2013 / 12:20:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+codeBundle
+    "Return a code bundle representing this Java release
+     (JDK)"
+
+    | src_zip |
+
+    bundle isNil ifTrue:[
+        bundle := JavaCodeBundle new.
+        bundle name: self name.
+        src_zip := self sourcePath detect:[:p|p baseName = 'src.zip'].
+
+        self classPath do:[:p|
+            | lib |
+
+            lib := JavaCodeLibrary new.
+            lib name: p baseName.
+            lib source: src_zip.
+
+            bundle add: lib.
+        ].
+    ].
+    ^bundle
+
+    "Created: / 12-01-2013 / 15:50:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 javaExtDirs
 
     "Returns a default value of java.ext.dirs property"
@@ -601,12 +627,13 @@
 searchForClassPath
 
     | jreHome jdkHome |
+    bundle := nil.
     classPath := OrderedCollection new.
     jreHome := self jreHome asFilename.
     jdkHome := self javaHome asFilename.
     jreHome isNil ifTrue:[ ^ #() ].
     "Ensure, that rt.jar is first"
-    classPath add: (JavaPathElement newFromRelease:(jreHome / 'lib' / 'rt.jar') asString).
+    classPath add: (jreHome / 'lib' / 'rt.jar') pathName.
 
     self searchForClassPathIn: jreHome / 'lib' .
     self searchForClassPathIn: jreHome / 'lib' / 'modules'.
@@ -624,7 +651,7 @@
     "
 
     "Created: / 27-10-2010 / 21:15:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 15-12-2012 / 01:05:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 12-01-2013 / 15:55:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 searchForClassPathIn: dir 
@@ -633,13 +660,13 @@
         :file | 
         " this is to make sure that rt.jar is always first --v     "
         (file suffix = 'jar' and: [ file baseName ~= 'rt.jar' ]) ifTrue: [
-            classPath add: (JavaPathElement newFromRelease:file asString)
+            classPath add: file pathName.
         ]
     ]
 
     "Created: / 27-10-2010 / 21:38:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 02-11-2011 / 17:49:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-    "Modified: / 27-07-2012 / 11:45:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 12-01-2013 / 15:55:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 searchForJavaHome
@@ -687,10 +714,11 @@
     | java_home src_zip |
 
     sourcePath := OrderedCollection new.
+    bundle := nil.
     java_home := self javaHome.
     java_home notNil ifTrue:[
         src_zip := self javaHome asFilename / 'src.zip'.
-        src_zip exists ifTrue:[sourcePath add: (JavaPathElement newFromRelease:src_zip asString)].
+        src_zip exists ifTrue:[sourcePath add: src_zip pathName].
     ].
 
     "
@@ -698,7 +726,7 @@
     "
 
     "Created: / 27-10-2010 / 21:15:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 15-12-2012 / 14:57:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 12-01-2013 / 15:55:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaRelease methodsFor:'validating'!
@@ -1006,7 +1034,7 @@
 
     java_homes do:[ :java_home |
         src_zip := java_home asFilename directory / 'src.zip'.
-        src_zip exists ifTrue:[sourcePath add: (JavaPathElement newFromRelease:src_zip asString)].
+        src_zip exists ifTrue:[sourcePath add: src_zip pathName].
     ].
 
     "
@@ -1014,7 +1042,7 @@
     "
 
     "Created: / 03-09-2012 / 18:38:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 09-01-2013 / 17:09:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 12-01-2013 / 15:56:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaRelease::OpenJDK7 class methodsFor:'documentation'!