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 { |
James E. King III | 98f379e | 2019-01-22 09:22:04 -0500 | [diff] [blame] | 23 | mavenCentral() |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 24 | google() |
| 25 | jcenter() |
| 26 | gradlePluginPortal() |
| 27 | } |
| 28 | |
| 29 | dependencies { |
James E. King III | 98f379e | 2019-01-22 09:22:04 -0500 | [diff] [blame] | 30 | classpath 'com.bmuschko:gradle-clover-plugin:2.2.1' |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 31 | } |
| 32 | } |
| 33 | |
| 34 | plugins { |
| 35 | id 'java' |
| 36 | id 'maven' |
| 37 | id 'signing' |
James E. King III | 98f379e | 2019-01-22 09:22:04 -0500 | [diff] [blame] | 38 | id 'com.github.johnrengelman.shadow' version '4.0.4' |
D. Can Celasun | 76fa8c9 | 2019-10-18 15:15:45 +0100 | [diff] [blame^] | 39 | id "com.github.spotbugs" version "2.0.0" |
| 40 | } |
| 41 | |
| 42 | ext { |
| 43 | // https://github.com/spotbugs/spotbugs-gradle-plugin/issues/32#issuecomment-409951172 |
| 44 | SpotBugsTask = com.github.spotbugs.SpotBugsTask |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | description = 'Apache Thrift Java Library' |
| 48 | |
| 49 | defaultTasks 'build' |
| 50 | |
| 51 | // Version components for this project |
| 52 | group = property('thrift.groupid') |
| 53 | |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 54 | if (Boolean.parseBoolean(project.release)) { |
James E. King III | 98f379e | 2019-01-22 09:22:04 -0500 | [diff] [blame] | 55 | version = property('thrift.version') |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 56 | } else { |
James E. King III | 98f379e | 2019-01-22 09:22:04 -0500 | [diff] [blame] | 57 | version = property('thrift.version') + '-SNAPSHOT' |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | // Keeping the rest of the build logic in functional named scripts for clarity |
| 61 | apply from: 'gradle/environment.gradle' |
| 62 | apply from: 'gradle/sourceConfiguration.gradle' |
| 63 | apply from: 'gradle/additionalArtifacts.gradle' |
| 64 | apply from: 'gradle/generateTestThrift.gradle' |
| 65 | apply from: 'gradle/unitTests.gradle' |
| 66 | apply from: 'gradle/cloverCoverage.gradle' |
| 67 | apply from: 'gradle/functionalTests.gradle' |
| 68 | apply from: 'gradle/publishing.gradle' |
| 69 | apply from: 'gradle/codeQualityChecks.gradle' |