2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
20 // Following Gradle best practices to keep build logic organized
22 // ----------------------------------------------------------------------------
23 // Installation subtasks, not used currently, we use "make install/fast"
24 task installDist(type: Copy, group: 'Install') {
25 description = "Copy Thrift JAR and dependencies into $installPath location"
27 destinationDir = file(installPath)
30 from configurations.compile
33 task installJavadoc(type: Copy, group: 'Install', dependsOn: javadoc) {
34 description = "Install Thrift JavaDoc into $installJavadocPath location"
36 destinationDir = file(installJavadocPath)
38 from javadoc.destinationDir
41 // This is not needed by Gradle builds but the remaining Ant builds seem to
42 // need access to the generated test classes for Thrift unit tests so we
43 // assist them to use it this way.
44 task copyDependencies(type: Copy, group: 'Build') {
45 description = 'Copy runtime dependencies in a common location for other Ant based projects'
46 project.assemble.dependsOn it
48 destinationDir = file("$buildDir/deps")
49 from configurations.testRuntime
50 // exclude some very specific unit test dependencies
51 exclude '**/junit*.jar', '**/mockito*.jar', '**/hamcrest*.jar'
54 // ----------------------------------------------------------------------------
55 // Allow this configuration to be shared between install and uploadArchives tasks
56 def configurePom(pom) {
59 description 'Thrift is a software framework for scalable cross-language services development.'
61 url 'http://thrift.apache.org'
64 url 'https://github.com/apache/thrift'
65 connection 'scm:git:https://github.com/apache/thrift.git'
66 developerConnection 'scm:git:git@github.com:apache/thrift.git'
71 name 'The Apache Software License, Version 2.0'
72 url "${project.license}"
80 name 'Apache Thrift Developers'
81 email 'dev@thrift.apache.org'
87 // Fixup the scope for servlet-api to be 'provided' instead of 'compile'
88 dependencies.find { dep -> dep.groupId == 'javax.servlet' && dep.artifactId == 'servlet-api' }.with {
96 repositories.mavenInstaller {
102 dependsOn test // make sure we run unit tests when publishing
103 repositories.mavenDeployer {
104 // signPom will silently do nothing when no signing information is provided
105 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
106 repository(url: project.mavenRepositoryUrl) {
107 if (project.hasProperty('mavenUser') && project.hasProperty('mavenPassword')) {
108 authentication(userName: mavenUser, password: mavenPassword)
115 // Signing configuration, optional, only when release and uploadArchives is activated
117 required { !version.endsWith("SNAPSHOT") && gradle.taskGraph.hasTask("uploadArchives") }
118 sign configurations.archives