Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame^] | 1 | /* |
| 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 |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 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 |
| 17 | * under the License. |
| 18 | */ |
| 19 | |
| 20 | // Using the legacy plugin classpath for Clover so it can be loaded optionally |
| 21 | buildscript { |
| 22 | repositories { |
| 23 | google() |
| 24 | jcenter() |
| 25 | gradlePluginPortal() |
| 26 | } |
| 27 | |
| 28 | dependencies { |
| 29 | classpath 'com.bmuschko:gradle-clover-plugin:2.2.0' |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | plugins { |
| 34 | id 'java' |
| 35 | id 'maven' |
| 36 | id 'signing' |
| 37 | id 'com.github.johnrengelman.shadow' version '2.0.2' |
| 38 | } |
| 39 | |
| 40 | description = 'Apache Thrift Java Library' |
| 41 | |
| 42 | defaultTasks 'build' |
| 43 | |
| 44 | // Version components for this project |
| 45 | group = property('thrift.groupid') |
| 46 | |
| 47 | // Drop the -dev suffix, we use the SNAPSHOT suffix for non-release versions |
| 48 | def parsedVersion = property('thrift.version').toString().replace('-dev', '') |
| 49 | if (Boolean.parseBoolean(project.release)) { |
| 50 | version = parsedVersion |
| 51 | } else { |
| 52 | version = parsedVersion + '-SNAPSHOT' |
| 53 | } |
| 54 | |
| 55 | // Keeping the rest of the build logic in functional named scripts for clarity |
| 56 | apply from: 'gradle/environment.gradle' |
| 57 | apply from: 'gradle/sourceConfiguration.gradle' |
| 58 | apply from: 'gradle/additionalArtifacts.gradle' |
| 59 | apply from: 'gradle/generateTestThrift.gradle' |
| 60 | apply from: 'gradle/unitTests.gradle' |
| 61 | apply from: 'gradle/cloverCoverage.gradle' |
| 62 | apply from: 'gradle/functionalTests.gradle' |
| 63 | apply from: 'gradle/publishing.gradle' |
| 64 | apply from: 'gradle/codeQualityChecks.gradle' |