src/JavaLibraries.st
author hlopkmar
Thu, 03 Nov 2011 11:50:57 +0000
branchjk_new_structure
changeset 1078 614cf5325969
parent 996 966508736ab7
child 1152 040cba55a7d2
permissions -rw-r--r--
tomcat junit test is running (not passing:)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     1
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     5
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     7
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     8
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
     9
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    10
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    12
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    13
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    14
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    15
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    17
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    19
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    20
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    21
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    23
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    24
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    25
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    26
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    27
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    28
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    29
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    38
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    40
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    41
"
754
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    43
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    44
Object subclass:#JavaLibraries
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:''
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    46
	classVariableNames:''
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Support'
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    49
!
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    50
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    51
!JavaLibraries class methodsFor:'documentation'!
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    52
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    53
copyright
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    54
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    58
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    60
 license:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    61
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    62
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    63
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    65
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    66
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    67
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    68
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    70
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    72
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    73
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    74
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    76
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    77
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    78
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    79
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    80
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    81
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    82
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    91
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    93
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    94
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    95
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 758
diff changeset
    96
! !
754
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
    97
756
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
    98
!JavaLibraries class methodsFor:'accessing'!
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
    99
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   100
directory
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   101
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   102
    ^Java cacheDirectory / 'libs'
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   103
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   104
    "
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   105
        JavaLibraries directory   
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   106
    "
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   107
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   108
    "Created: / 08-04-2011 / 16:27:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   109
!
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   110
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   111
url
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   112
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 756
diff changeset
   113
    ^(Smalltalk at:#stx_libjava) svnRepositoryUrlBase , '/libs'
756
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   114
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   115
    "Created: / 08-04-2011 / 16:32:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   116
! !
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   117
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   118
!JavaLibraries class methodsFor:'private'!
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   119
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   120
checkoutDirectory
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   121
968
vranyj1
parents: 877
diff changeset
   122
"/    OperatingSystem getNetworkAddresses size < 2 
vranyj1
parents: 877
diff changeset
   123
"/        ifTrue:
vranyj1
parents: 877
diff changeset
   124
"/           [self error: 'No network connection!!'. ^self].
756
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   125
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   126
    (OperatingSystem
996
966508736ab7 Fixes in command syntax for Windows
vranyj1
parents: 991
diff changeset
   127
        executeCommand:('svn co "%1" "%2"' bindWith: self url with: self directory asString))
756
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   128
        ifFalse:
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   129
            [self error: 'Cannot checkout libraries!!'. ^self].
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   130
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   131
    "Created: / 08-04-2011 / 16:38:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   132
!
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   133
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   134
updateDirectory
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   135
991
20a187230ceb Fixes for Windows - does not compile yet
vranyj1
parents: 970
diff changeset
   136
"/    OperatingSystem getNetworkAddresses size < 2 
20a187230ceb Fixes for Windows - does not compile yet
vranyj1
parents: 970
diff changeset
   137
"/        ifTrue:
20a187230ceb Fixes for Windows - does not compile yet
vranyj1
parents: 970
diff changeset
   138
"/            [^self].
756
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   139
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   140
    (OperatingSystem
996
966508736ab7 Fixes in command syntax for Windows
vranyj1
parents: 991
diff changeset
   141
        executeCommand:('svn update "%1" "%2"' bindWith: self url with: self directory asString))
756
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   142
        ifFalse:
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   143
            [self error: 'Cannot update libraries!!'. ^self].
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   144
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   145
    "Created: / 08-04-2011 / 16:38:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   146
! !
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   147
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   148
!JavaLibraries class methodsFor:'utilities'!
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   149
970
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   150
addToClassPath
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   151
    | dir |
1078
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 996
diff changeset
   152
    (dir := self directory) exists ifFalse: [ self update ].
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 996
diff changeset
   153
    dir recursiveDirectoryContentsAsFilenames do: [
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 996
diff changeset
   154
        :file | 
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 996
diff changeset
   155
        file suffix = 'jar' ifTrue: [ Java addToClassPath: file pathName ]
970
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   156
    ]
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   157
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   158
    "
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   159
        JavaLibraries addToClassPath.
1078
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 996
diff changeset
   160
        Java classPath"
970
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   161
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   162
    "Created: / 02-09-2011 / 09:24:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1078
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 996
diff changeset
   163
    "Modified: / 03-11-2011 / 12:51:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
970
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   164
!
cb62284d4145 Fixes for Windows
vranyj1
parents: 968
diff changeset
   165
756
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   166
addToClassPath: jarname
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   167
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   168
    | dir jar |
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   169
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   170
    (dir := self directory) exists 
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   171
        ifFalse:[self update].
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   172
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   173
    (jar := dir / jarname) exists 
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   174
        ifTrue: [Java addToClassPath: jar pathName]
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   175
        ifFalse:[self error:'Library ' , jarname , ' not found in ', dir pathName].
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   176
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   177
    "
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   178
        JavaLibraries addToClassPath:'junit4.jar'.
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   179
        Java classPath
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   180
    "
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   181
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   182
    "Created: / 08-04-2011 / 16:49:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   183
!
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   184
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   185
flush
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   186
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   187
    self directory recursiveRemove
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   188
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   189
    "Created: / 08-04-2011 / 16:27:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   190
!
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   191
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   192
update
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   193
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   194
    | dir |
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   195
    dir := self directory.
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   196
    dir exists 
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   197
        ifTrue: [self updateDirectory]
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   198
        ifFalse:[self checkoutDirectory]
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   199
968
vranyj1
parents: 877
diff changeset
   200
    "
vranyj1
parents: 877
diff changeset
   201
        JavaLibraries update
vranyj1
parents: 877
diff changeset
   202
    "
vranyj1
parents: 877
diff changeset
   203
756
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   204
    "Created: / 08-04-2011 / 16:29:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   205
! !
dd9543675518 - JavaLibraries: on-demand downloading/updating
vranyj1
parents: 754
diff changeset
   206
754
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
   207
!JavaLibraries class methodsFor:'documentation'!
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
   208
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
   209
version_SVN
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
   210
    ^ '$Id$'
a3d9edeb7d73 - Java: added #cacheDirectory
vranyj1
parents:
diff changeset
   211
! !