- JavaLibraries
changed:
#addToClassPath
#addToClassPath:
- Java
added:5 methods
changed:
#addToPath:path:origin:
#addToPath:path:origin:name:
#classPathFromPackages
#sourcePathFromPackages
- extensions
...
--- a/src/Java.st Tue Aug 21 21:53:56 2012 +0000
+++ b/src/Java.st Wed Aug 22 05:59:20 2012 +0000
@@ -185,6 +185,18 @@
"Modified: / 27-07-2012 / 12:06:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+addToClassPath:pathOrCollection name: name
+ ^self addToClassPath:pathOrCollection name: name origin: JavaPathElement originUser
+
+ "Created: / 22-08-2012 / 06:25:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addToClassPath:pathOrCollection name: name origin: origin
+ ^ self addToPath:ClassPath path:pathOrCollection origin: origin name: name
+
+ "Created: / 22-08-2012 / 06:27:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
addToClassPath:pathOrCollection origin: origin
^ self addToPath:ClassPath path:pathOrCollection origin: origin
@@ -211,29 +223,46 @@
"Created: / 07-08-2011 / 14:01:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-addToPath:cp filesMatching:pattern in:path origin: origin
+addToPath:cp filesMatching:pattern in:path origin: origin name: namePrefix
|dir|
dir := path asFilename.
dir exists ifFalse:[ ^ self ].
dir directoryContents do:[:fname |
(fname matches:pattern) ifTrue:[
- |p|
+ | f p nm |
- p := (dir / fname) pathName.
- self addToPath: cp pathElement:(JavaPathElement new: p origin: origin).
+ p := (f := dir / fname) pathName.
+ namePrefix notNil ifTrue:[
+ nm := namePrefix , ' - ' , f baseName
+ ] ifFalse:[
+ nm := f baseName.
+ ].
+ self addToPath: cp pathElement:(JavaPathElement new: p origin: origin name: nm).
]
].
- "Created: / 27-07-2012 / 12:19:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 22-08-2012 / 06:33:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
addToPath:cp path:pathOrCollection origin: origin
+ ^self addToPath:cp path:pathOrCollection origin: origin name: nil
+
+ "Created: / 27-07-2012 / 12:04:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addToPath:cp path:pathOrCollection origin: origin name: name
|path|
(pathOrCollection isSequenceable and:[pathOrCollection isCharacters not]) ifTrue:[
pathOrCollection do:[:each |
- self addToPath:cp path: each origin: origin
+ | nm |
+
+ nm := name.
+ (name notNil and:[(name includesAny: '?*') not]) ifTrue:[
+ nm := name , ' - ' , each asFilename baseName.
+ ].
+ self addToPath:cp path: each origin: origin name: nm.
].
^ self.
].
@@ -244,33 +273,8 @@
addToPath:cp
filesMatching:path baseName
in:path directoryName
- origin: origin.
- ] ifFalse:[
- "Single path"
- self addToPath: cp pathElement:(JavaPathElement new: pathOrCollection asString origin: origin).
-
- ]
-
- "Created: / 27-07-2012 / 12:04:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addToPath:cp path:pathOrCollection origin: origin name: name
- |path|
-
- (pathOrCollection isSequenceable and:[pathOrCollection isCharacters not]) ifTrue:[
- pathOrCollection do:[:each |
- self addToPath:cp path: each origin: origin
- ].
- ^ self.
- ].
- path := pathOrCollection asFilename.
- (pathOrCollection asString includes:$*) ifTrue:[
- "Glob-style pattern, expand..."
- self
- addToPath:cp
- filesMatching:path baseName
- in:path directoryName
- origin: origin.
+ origin: origin
+ name: name.
] ifFalse:[
"Single path"
self addToPath: cp pathElement:(JavaPathElement new: pathOrCollection asString origin: origin name: name).
@@ -305,12 +309,25 @@
"Modified: / 27-07-2012 / 12:02:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+addToSourcePath:pathOrCollection name: name
+
+ self addToSourcePath:pathOrCollection origin: JavaPathElement originUser name: name
+
+ "Created: / 22-08-2012 / 06:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
addToSourcePath:pathOrCollection origin: origin
self addToPath: SourceDirectories path: pathOrCollection origin: origin
"Created: / 27-07-2012 / 11:49:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+addToSourcePath:pathOrCollection origin: origin name: name
+ self addToPath: SourceDirectories path: pathOrCollection origin: origin name: name
+
+ "Created: / 22-08-2012 / 06:27:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
cacheDirectory
CacheDirectory ifNil:[
@@ -378,7 +395,7 @@
ClassPathPackages isNil ifTrue:[
ClassPathPackages := OrderedCollection new.
ProjectDefinition allSubclassesDo:[:pkg|
- self addToPath: ClassPathPackages path: pkg javaClassPath origin: JavaPathElement originPackage
+ self addToPath: ClassPathPackages path: pkg javaClassPath origin: JavaPathElement originPackage name: pkg package
].
].
^ClassPathPackages
@@ -571,7 +588,7 @@
SourceDirectoriesPackages isNil ifTrue:[
SourceDirectoriesPackages := OrderedCollection new.
ProjectDefinition allSubclassesDo:[:pkg|
- self addToPath: SourceDirectoriesPackages path: pkg javaSourcePath origin: JavaPathElement originPackage
+ self addToPath: SourceDirectoriesPackages path: pkg javaSourcePath origin: JavaPathElement originPackage name: pkg package
].
].
^SourceDirectoriesPackages.
--- a/src/JavaLibraries.st Tue Aug 21 21:53:56 2012 +0000
+++ b/src/JavaLibraries.st Wed Aug 22 05:59:20 2012 +0000
@@ -125,12 +125,12 @@
(dir := self directory / 'libs') exists ifFalse: [ self update ].
dir recursiveDirectoryContentsAsFilenames do: [ :file |
- file suffix = 'jar' ifTrue: [ Java addToClassPath: file pathName ]
+ file suffix = 'jar' ifTrue: [ Java addToClassPath: file pathName name: 'stx:libjava - libraries - ' , file baseName ]
].
(dir := self directory / 'libs-src') exists ifTrue:[
dir recursiveDirectoryContentsAsFilenames do: [ :file |
- file suffix = 'jar' ifTrue: [ Java addToSourcePath: file pathName ]
+ file suffix = 'jar' ifTrue: [ Java addToSourcePath: file pathName name: 'stx:libjava - libraries - ' , file baseName ]
]
].
@@ -143,7 +143,7 @@
"Created: / 02-09-2011 / 09:24:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 03-11-2011 / 12:51:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
- "Modified: / 20-08-2012 / 19:30:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 22-08-2012 / 06:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
addToClassPath: jarname
@@ -153,9 +153,11 @@
(dir := self directory) exists
ifFalse:[self update].
- (jar := dir / jarname) exists
- ifTrue: [Java addToClassPath: jar pathName]
- ifFalse:[self error:'Library ' , jarname , ' not found in ', dir pathName].
+ (jar := dir / jarname) exists ifTrue: [
+ Java addToClassPath: jar pathName name: 'stx:libjava libraries'
+ ] ifFalse:[
+ self error:'Library ' , jarname , ' not found in ', dir pathName
+ ].
"
JavaLibraries addToClassPath:'junit4.jar'.
--- a/src/libjava.rc Tue Aug 21 21:53:56 2012 +0000
+++ b/src/libjava.rc Wed Aug 22 05:59:20 2012 +0000
@@ -3,7 +3,7 @@
// automagically generated from the projectDefinition: stx_libjava.
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 6,2,1972,1972
+ FILEVERSION 6,2,1994,1994
PRODUCTVERSION 6,2,3,1
#if (__BORLANDC__)
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
BEGIN
VALUE "CompanyName", "eXept Software AG\0"
VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
- VALUE "FileVersion", "6.2.1972.1972\0"
+ VALUE "FileVersion", "6.2.1994.1994\0"
VALUE "InternalName", "stx:libjava\0"
VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\nCopyright Jan Vrany, Jan Kurs and Marcel Hlopko\b SWING Research Group, Czech Technical University In Prague\0"
VALUE "ProductName", "Smalltalk/X\0"
VALUE "ProductVersion", "6.2.3.1\0"
- VALUE "ProductDate", "Tue, 21 Aug 2012 17:53:36 GMT\0"
+ VALUE "ProductDate", "Wed, 22 Aug 2012 05:52:45 GMT\0"
END
END