I have found that by having a settings.gradle of:
def coberturaPluginHome = new File ( System.properties.'user.home' +
'/lib/Java/gradleCoberturaPlugin' )
def jarDirectory = new File ( coberturaPluginHome , 'jar' )
def libDirectory = new File ( coberturaPluginHome , 'lib' )
def pluginJar = jarDirectory.listFiles ( [ accept : { File dir , String
name -> ( name =~ '\\.jar$' ).find ( ) } ] as FilenameFilter ) as List
def dependenciesJars = libDirectory.listFiles ( [ accept : { File dir ,
String name -> ( name =~ '\\.jar$' ).find ( ) } ] as FilenameFilter ) as List
def getVersionNumberOfJar ( list , root ) {
def jarName = list.find { File file -> ( file.name =~ ( root +
'-[0-9].*.jar$' ) ).find ( ) }
def matcher = jarName =~ ( '.*' + root + /-(.*)\.jar/ )
return matcher ? matcher[0][1] : null
}
def makeDependencyPattern ( list , root ) {
':' + root + ':' + getVersionNumberOfJar ( list , root )
}
addFlatDirResolver ( 'CoberturaPlugin' , jarDirectory )
dependencies ( makeDependencyPattern ( pluginJar ,
'gradle-cobertura-plugin' ) )
addFlatDirResolver ( 'CoberturaPluginDependencies' , libDirectory )
dependencies ( [
makeDependencyPattern ( dependenciesJars , 'log4j' ) ,
makeDependencyPattern ( dependenciesJars ,
'jakarta-oro' ) ,
makeDependencyPattern ( dependenciesJars , 'cobertura'
) ,
] )
The Cobertura Plugin starts. So I think the basic Gradle stuff is now
done. However things are still not working, but I think this is a
Cobertura Plugin issue -- or possible a weird classpath issue:
|> gradle -DuseCobertura=true test -C rebuild
:init
:resources
:compile
:testResources
:testCompile
:cbInstrument
##teamcity[progressMessage 'Code Coverage Instrumention ...']
Build failed with an exception.
Run with -s or -d option to get more details. Run with -f option to get
the full (very verbose) stacktrace.
Build file
'/home/users/russel/Repositories/Bazaar/Masters/ADS/build.gradle'
Execution failed for task ':cbInstrument'.
Cause: Found interface org.gradle.api.plugins.Convention, but class was
expected
BUILD FAILED
Total time: 4.789 secs
So which version of Gradle has this type as a class and which as an
interface?
--
Russel.
============================================================
Dr Russel Winder Partner
Concertant LLP t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road, f: +44 8700 516 084 voip:
sip:[email protected]
London SW11 1EN, UK. m: +44 7770 465 077 xmpp: [email protected]
signature.asc
Description: This is a digitally signed message part
