def TCPathVar = "path.variable.teamcitydistribution" def TCPathVarServer = "teamcity.path.variable.teamcitydistribution" def teamCityDir = ''; [TCPathVar, TCPathVarServer].each { if (project.hasProperty(it)) { teamCityDir = project.getProperties()[it]; } } def tmp = System.getProperty(TCPathVarServer); if (tmp != null) { teamCityDir = tmp; } tmp = System.getenv(TCPathVarServer); if (tmp != null) { teamCityDir = tmp; } if (!new File(teamCityDir).isDirectory()) { throw new StopExecutionException("Failed to find TeamCity home at ${teamCityDir}"); } teamCityLib = fileTree(teamCityDir + "/webapps/ROOT/WEB-INF/lib").matching { include 'annotations.jar' include 'openapi.jar' include 'util.jar' include 'jdom.jar' } annotationsJar = fileTree(teamCityDir + "/webapps/ROOT/WEB-INF/lib").matching { include 'annotations.jar' } log4j = fileTree(teamCityDir + "/webapps/ROOT/WEB-INF/lib").matching { include 'log4j*.jar' } agentApi = fileTree(teamCityDir + "/devPackage").matching { include 'agent-api.jar' } agentInternalApi = fileTree(teamCityDir + "/buildAgent/lib").matching { include 'agent.jar' } serverApi = fileTree(teamCityDir + "/devPackage").matching { include 'server-api.jar' } serverInternal = fileTree(teamCityDir + "/webapps/ROOT/WEB-INF/lib").matching { include 'server.jar' } commonApi = fileTree(teamCityDir + "/devPackage").matching { include 'common-api.jar' } commonImpl = fileTree(teamCityDir + "/webapps/ROOT/WEB-INF/lib").matching { include 'common-impl.jar' } serverLibs = fileTree(teamCityDir + "/webapps/ROOT/WEB-INF/lib").matching { include 'spring*.jar' include 'commons-logging*.jar' } + fileTree(teamCityDir + "/lib").matching { include 'servlet*.jar' } testNG = fileTree("lib/testng").matching { include '*.jar' } jmock = fileTree("lib/jmock").matching { include '*.jar' } jmock_old = fileTree('lib/jmock-1.2').matching { include '*.jar' }