blob: 726d7b7f67efb08260bf240513db6b2e66ab58f8 [file] [log] [blame]
Alex Volanis7004a612018-01-24 10:30:13 -05001/*
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
21buildscript {
Christopher Tubbsebfa7712021-02-04 14:13:24 -050022 // strictly enforce the minimum version of Java required to build and fail fast
23 if (JavaVersion.current() < JavaVersion.VERSION_1_8) {
24 throw new GradleException("The java version used is ${JavaVersion.current()}, but must be at least ${JavaVersion.VERSION_1_8}")
25 }
26
Alex Volanis7004a612018-01-24 10:30:13 -050027 repositories {
James E. King III98f379e2019-01-22 09:22:04 -050028 mavenCentral()
Alex Volanis7004a612018-01-24 10:30:13 -050029 google()
Alex Volanis7004a612018-01-24 10:30:13 -050030 gradlePluginPortal()
31 }
32
33 dependencies {
James E. King III98f379e2019-01-22 09:22:04 -050034 classpath 'com.bmuschko:gradle-clover-plugin:2.2.1'
Alex Volanis7004a612018-01-24 10:30:13 -050035 }
36}
37
38plugins {
Jiayu Liueac51032022-03-11 04:55:13 +010039 id 'java-library'
Alex Volanis7004a612018-01-24 10:30:13 -050040 id 'maven'
41 id 'signing'
James E. King III98f379e2019-01-22 09:22:04 -050042 id 'com.github.johnrengelman.shadow' version '4.0.4'
Jiayu Liu649dcfd2022-02-21 23:18:50 +080043 id "com.github.spotbugs" version "4.7.1"
Jiayu Liu53ec0822022-05-06 12:56:42 +080044 id "com.diffplug.spotless" version "6.4.2"
Alex Volanis7004a612018-01-24 10:30:13 -050045}
46
47description = 'Apache Thrift Java Library'
48
49defaultTasks 'build'
50
51// Version components for this project
52group = property('thrift.groupid')
53
Alex Volanis7004a612018-01-24 10:30:13 -050054if (Boolean.parseBoolean(project.release)) {
James E. King III98f379e2019-01-22 09:22:04 -050055 version = property('thrift.version')
Alex Volanis7004a612018-01-24 10:30:13 -050056} else {
James E. King III98f379e2019-01-22 09:22:04 -050057 version = property('thrift.version') + '-SNAPSHOT'
Alex Volanis7004a612018-01-24 10:30:13 -050058}
59
60// Keeping the rest of the build logic in functional named scripts for clarity
61apply from: 'gradle/environment.gradle'
62apply from: 'gradle/sourceConfiguration.gradle'
63apply from: 'gradle/additionalArtifacts.gradle'
64apply from: 'gradle/generateTestThrift.gradle'
65apply from: 'gradle/unitTests.gradle'
66apply from: 'gradle/cloverCoverage.gradle'
67apply from: 'gradle/functionalTests.gradle'
68apply from: 'gradle/publishing.gradle'
69apply from: 'gradle/codeQualityChecks.gradle'