JavaTestsResource.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 25 Jan 2013 00:15:51 +0000
branchrefactoring-classpath
changeset 2000 13a10b73aa83
parent 1876 482ad5ebe5da
child 2050 c77d58b7076b
permissions -rw-r--r--
Closing branch refactoring-classpath

"
 COPYRIGHT (c) 1996-2011 by Claus Gittinger

 New code and modifications done at SWING Research Group [1]:

 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
                            SWING Research Group, Czech Technical University in Prague

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.

 [1] Code written at SWING Research Group contains a signature
     of one of the above copright owners. For exact set of such code,
     see the differences between this version and version stx:libjava
     as of 1.9.2010
"
"{ Package: 'stx:libjava' }"

JavaAntProjectResource subclass:#JavaTestsResource
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Java-Tests'
!

!JavaTestsResource class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1996-2011 by Claus Gittinger

 New code and modifications done at SWING Research Group [1]:

 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
                            SWING Research Group, Czech Technical University in Prague

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.

 [1] Code written at SWING Research Group contains a signature
     of one of the above copright owners. For exact set of such code,
     see the differences between this version and version stx:libjava
     as of 1.9.2010

"
! !

!JavaTestsResource class methodsFor:'accessing'!

classpath
    |cp|

    cp := OrderedCollection new.
    self antProjectDir 
        directoryContentsDo:[:dir | 
            (self shouldIncludeProject: dir) ifTrue:[
                cp := cp , (self classpathFor:dir)
            ]].
    ^ cp

    "
        JavaTestsResource classpath"

    "Created: / 07-05-2011 / 18:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 28-03-2012 / 12:28:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

classpathFor:testProject 
    |cp dir|

    cp := OrderedCollection new.
    dir := self antProjectDir / testProject.
    dir isDirectory 
        ifTrue:
            [ (dir / 'bin') exists ifTrue:[ cp add:(dir / 'bin') asString ].
            (dir / 'lib') exists 
                ifTrue:
                    [ cp addAll:((dir / 'lib') directoryContentsAsFilenames 
                                select:[:jar | jar suffix = 'jar' ]) ] ].
    ^ cp

    "
        JavaTestsResource testsClasspath"

    "Created: / 11-06-2011 / 15:58:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

classpathForLibjava
    ^ self classpathFor:'libjava'

    "
        JavaTestsResource classpathForLibjava
    "

    "Created: / 21-06-2011 / 17:34:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

classpathForMauve
    ^ self classpathFor:'libjava-mauve'

    "
        JavaTestsResource classpathForMauve
    "

    "Created: / 11-06-2011 / 15:59:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

properties

    ^{
        { 'dir.libs' . (JavaLibraries directory / 'libs') pathName }
    }

    "Created: / 02-09-2011 / 09:37:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

resources

    ^Array with: JavaLibrariesResource

    "Created: / 02-09-2011 / 09:13:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

shouldIncludeProject: testProject

    ^ (testProject ~= 'libjava-mauve')

    "Created: / 10-03-2012 / 11:03:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaTestsResource class methodsFor:'accessing - ant project'!

antProjectDir
    | base |

    base := (Smalltalk getPackageDirectoryForPackage: #'stx:libjava').
    base isNil ifTrue:[ ^ nil ].
    ^ base / 'tests'

    "
        JavaTestsResource antProjectDir
    "

    "Created: / 18-07-2011 / 18:15:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (comment): / 16-11-2012 / 00:21:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaTestsResource class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ '§Id§'
! !