/* * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ def TCPathVar = "path.variable.teamcitydistribution" dependencies { if (project.hasProperty(TCPathVar)) { def teamCityDir = project.getProperties()[TCPathVar] teamCityLib = fileTree(teamCityDir + "/webapps/ROOT/WEB-INF/lib").matching { include 'annotations.jar' include 'openapi.jar' include 'util.jar' include 'trove4j.jar' } devPackage = fileTree(teamCityDir + "/devPackage").matching { include 'agent-api.jar' include 'common-api.jar' include 'server-api.jar' include 'tests/tests-support.jar' } agentCore = zipTree(teamCityDir + "/webapps/ROOT/update/buildAgent.zip").matching { include 'lib/agent.jar' } commonApi = fileTree(teamCityDir + "/devPackage").matching { include 'common-api.jar' } agentRuntime = zipTree(teamCityDir + "/webapps/ROOT/update/buildAgent.zip").matching { include 'lib/*.jar' } } else { throw new StopExecutionException("""TeamCity distribution not available. Please, set path to valid TeamCity distribution in gradle.properties file.""") } } allprojects { tcVersion="6.0-SNAPSHOT" apply plugin: 'java' } subprojects { repositories { mavenRepo(name: "sonatype-public", urls: "https://oss.sonatype.org/content/groups/public/"); mavenCentral() } dependencies { compile 'log4j:log4j:1.2.16' testCompile 'org.jmock:jmock:2.5.1' testCompile 'org.testng:testng:5.14' } clean { delete "target" } } project (':gradle-runner-agent') { configurations { integTestClasspath { extendsFrom testRuntime } } dependencies { compile project(':gradle-runner-common') compile devPackage compile teamCityLib compile agentRuntime integTestClasspath agentRuntime integTestClasspath 'org.jmock:jmock:2.5.1' integTestClasspath 'org.testng:testng:5.14' integTestClasspath commonApi } } project (':gradle-runner-server') { dependencies { compile project(':gradle-runner-common') compile devPackage compile teamCityLib } } def gradlePluginDist = new File(distsDir, 'gradle-runner') task initDistrDestinations << { gradleServer = new File(gradlePluginDist, 'server') gradleServer.mkdirs() copy { from project(':gradle-runner-server').libsDir from project(':gradle-runner-common').libsDir into gradleServer } copy { from projectDir include 'teamcity-plugin.xml' into gradlePluginDist } } task zipAgent(type: Zip, dependsOn: ['initDistrDestinations', ':gradle-runner-agent:dist']) { from project(':gradle-runner-agent').distsDir include 'gradle-runner/**' archiveName ='gradle-runner.zip' destinationDir = new File(gradlePluginDist, 'agent') } task zipPlugin(type: Zip, dependsOn: ['initDistrDestinations', 'zipAgent']) { from gradlePluginDist archiveName='gradle-runner.zip' } task dist(dependsOn: [ 'zipPlugin' ]) { description = 'Create Gradle Runner plugin package for TeamCity' } task wrapper(type: Wrapper) { gradleVersion = '1.8' jarPath = 'wrapper' }