Skip to content

Commit

Permalink
Upgrade to Gradle 6.6 (#420)
Browse files Browse the repository at this point in the history
* Upgrade gradle and apply new spotless formatting

* skip spotlessJavaCheck task

* fixes for gradle and bintray integration

* add ruby to build env
  • Loading branch information
jtnelson committed Aug 22, 2020
1 parent 0cb6a3a commit cbae285
Show file tree
Hide file tree
Showing 79 changed files with 1,395 additions and 1,074 deletions.
9 changes: 7 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
# year without being told, so it is a noop if it is run multiple times in
# the same year

version: 2
version: 2.1
orbs:
ruby: circleci/[email protected]
jobs:
build:
docker:
Expand All @@ -35,6 +37,9 @@ jobs:
- setup_remote_docker:
version: 17.09.0-ce
docker_layer_caching: true
- ruby/install:
version: '2.7'
- run: echo "Ruby 2.7 has been installed"
- run:
name: Get Sonatype Credentials
command: |
Expand All @@ -52,7 +57,7 @@ jobs:
name: Build and Publish
command: |
cd ~/$CIRCLE_PROJECT_REPONAME
./gradlew clean build installer uploadArchives bintrayUpload dockerize -x spotlessJava --no-daemon
./gradlew clean build installer uploadArchives bintrayUpload dockerize -x spotlessJava -x spotlessJavaCheck --no-daemon
- save_cache:
paths:
- ~/.gradle
Expand Down
25 changes: 8 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@
* limitations under the License.
*/

// To upgrade:
// 1. Take a backup of gradlew because there is custom logic there that must
// be preserved
// 2. Change gradleVersion here
// 3. Change the distributionUrl in gradle/wrapper/gradle-wrapper.properties
// 4. Run ./gradlew wrapper
task wrapper(type: Wrapper) {
gradleVersion = '3.0'
}

// The project version is controlled externally by the "version.sh" script.
def getVersion = { ->
def stdout = new ByteArrayOutputStream()
Expand Down Expand Up @@ -51,8 +41,8 @@ buildscript {
}
dependencies {
classpath 'net.nisgits.gradle:gradle-executable-jar-plugin:1.7.0'
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.6.0"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
classpath "com.diffplug.spotless:spotless-plugin-gradle:5.1.2"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.3"
}
}

Expand All @@ -69,7 +59,7 @@ subprojects {
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'com.diffplug.gradle.spotless'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'

Expand Down Expand Up @@ -176,6 +166,7 @@ subprojects {
importOrderFile rootProject.file('spotless.java.importerorder')
removeUnusedImports()
eclipse().configFile rootProject.file('spotless.java.eclipseformat.xml')
targetExclude 'src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java'
}
}

Expand All @@ -184,10 +175,10 @@ subprojects {
ext.title = "Concourse" // The project's vanity title
ext.description = "Default" // A short description about the project
afterEvaluate { project ->
if (ext.uploadEnabled && validateVersion(project.version)) { // Configure subprojects that should be uploaded
// to Maven
def mavenTitle = ext.title
def mavenDescription = ext.description
if (project.ext.uploadEnabled && validateVersion(project.version)) { // Configure subprojects that should be uploaded // to Maven
def mavenTitle = project.ext.title
def mavenDescription = project.ext.description
def mavenVersion = ext.mavenVersion

publishing {
publications {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ public Number average(String key, String ccl, Timestamp timestamp) {
public Number average(String key, Timestamp timestamp) {
return concourse.execute(() -> {
TObject result = timestamp.isString()
? concourse.$calculate().averageKeyTimestr(
key, timestamp.toString(), concourse.creds(),
? concourse.$calculate().averageKeyTimestr(key,
timestamp.toString(), concourse.creds(),
concourse.transaction(), concourse.environment())
: concourse.$calculate().averageKeyTime(key,
timestamp.getMicros(), concourse.creds(),
Expand Down Expand Up @@ -493,8 +493,8 @@ public long count(String key, String ccl, Timestamp timestamp) {
public long count(String key, Timestamp timestamp) {
return concourse.execute(() -> {
return timestamp.isString()
? concourse.$calculate().countKeyTimestr(
key, timestamp.toString(), concourse.creds(),
? concourse.$calculate().countKeyTimestr(key,
timestamp.toString(), concourse.creds(),
concourse.transaction(), concourse.environment())
: concourse.$calculate().countKeyTime(key,
timestamp.getMicros(), concourse.creds(),
Expand Down Expand Up @@ -725,8 +725,8 @@ public Number max(String key, String ccl, Timestamp timestamp) {
public Number max(String key, Timestamp timestamp) {
return concourse.execute(() -> {
TObject result = timestamp.isString()
? concourse.$calculate().maxKeyTimestr(
key, timestamp.toString(), concourse.creds(),
? concourse.$calculate().maxKeyTimestr(key,
timestamp.toString(), concourse.creds(),
concourse.transaction(), concourse.environment())
: concourse.$calculate().maxKeyTime(key,
timestamp.getMicros(), concourse.creds(),
Expand Down Expand Up @@ -958,8 +958,8 @@ public Number min(String key, String ccl, Timestamp timestamp) {
public Number min(String key, Timestamp timestamp) {
return concourse.execute(() -> {
TObject result = timestamp.isString()
? concourse.$calculate().minKeyTimestr(
key, timestamp.toString(), concourse.creds(),
? concourse.$calculate().minKeyTimestr(key,
timestamp.toString(), concourse.creds(),
concourse.transaction(), concourse.environment())
: concourse.$calculate().minKeyTime(key,
timestamp.getMicros(), concourse.creds(),
Expand Down Expand Up @@ -1191,8 +1191,8 @@ public Number sum(String key, String ccl, Timestamp timestamp) {
public Number sum(String key, Timestamp timestamp) {
return concourse.execute(() -> {
TObject result = timestamp.isString()
? concourse.$calculate().sumKeyTimestr(
key, timestamp.toString(), concourse.creds(),
? concourse.$calculate().sumKeyTimestr(key,
timestamp.toString(), concourse.creds(),
concourse.transaction(), concourse.environment())
: concourse.$calculate().sumKeyTime(key,
timestamp.getMicros(), concourse.creds(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
* @author Jeff Nelson
*/
@NotThreadSafe
public final class SortableColumn<V> extends ForwardingMap<Long, V>
implements Column<V>, Sortable<V> {
public final class SortableColumn<V> extends ForwardingMap<Long, V> implements
Column<V>,
Sortable<V> {

/**
* Ensure that the {@code data} is a {@link SortableColumn}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ public static <V> SortableTable<V> singleValued(
*
* @author Jeff Nelson
*/
static class ForwardingSortableTable<V> extends
ForwardingMap<Long, Map<String, V>> implements SortableTable<V> {
static class ForwardingSortableTable<V>
extends ForwardingMap<Long, Map<String, V>> implements
SortableTable<V> {

/**
* The delegate to which calls are forwarded. If {@link #sort(Sorter)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
*
* @author Jeff Nelson
*/
public abstract class DataColumn<F, T> extends AbstractMap<Long, T>
implements Column<T> {
public abstract class DataColumn<F, T> extends AbstractMap<Long, T> implements
Column<T> {

/**
* Return a {@link DataColumn} that contains multi-valued cells of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
* @author Jeff Nelson
*/
public final class DataIndex<T> extends AbstractMap<String, Map<T, Set<Long>>>
implements Index<T> {
implements
Index<T> {

/**
* Convert the {@link TObject} values in the {@code results} to their java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
*
* @author Jeff Nelson
*/
public class DataProjection<T> extends AbstractMap<T, Set<Long>>
implements Projection<T> {
public class DataProjection<T> extends AbstractMap<T, Set<Long>> implements
Projection<T> {

/**
* Convert the {@link TObject} values in the {@code results} to their java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
* @author Jeff Nelson
*/
@NotThreadSafe
public abstract class DataRow<F, T> extends AbstractMap<String, T>
implements Row<T> {
public abstract class DataRow<F, T> extends AbstractMap<String, T> implements
Row<T> {

/**
* Convert the {@link TObject} values in the {@code results} to their java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
*/
@NotThreadSafe
public abstract class DataTable<F, T> extends AbstractMap<Long, Map<String, T>>
implements Table<T> {
implements
Table<T> {

/**
* Return a {@link DataTable} that contains multi-valued cells of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
*
* @author Jeff Nelson
*/
public class OrderAtState extends BuildableOrderState
implements ShortcutThenByState, TransitionToOrderDirectionState {
public class OrderAtState extends BuildableOrderState implements
ShortcutThenByState,
TransitionToOrderDirectionState {

/**
* Construct a new instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
* The {@link OrderState} that expects the next token to be a sort order,
* timestamp or a new key to sort by.
*/
public class OrderByState extends BuildableOrderState
implements ShortcutThenByState, TransitionToOrderDirectionState {
public class OrderByState extends BuildableOrderState implements
ShortcutThenByState,
TransitionToOrderDirectionState {

/**
* Construct a new instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*
* @author Jeff Nelson
*/
public class OrderDirectionState extends BuildableOrderState
implements ShortcutThenByState {
public class OrderDirectionState extends BuildableOrderState implements
ShortcutThenByState {

/**
* Construct a new instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ private void readObject(java.io.ObjectInputStream in)
}
}

private static class AccessTokenStandardSchemeFactory
implements SchemeFactory {
private static class AccessTokenStandardSchemeFactory implements
SchemeFactory {
public AccessTokenStandardScheme getScheme() {
return new AccessTokenStandardScheme();
}
Expand Down Expand Up @@ -389,8 +389,8 @@ public void write(org.apache.thrift.protocol.TProtocol oprot,

}

private static class AccessTokenTupleSchemeFactory
implements SchemeFactory {
private static class AccessTokenTupleSchemeFactory implements
SchemeFactory {
public AccessTokenTupleScheme getScheme() {
return new AccessTokenTupleScheme();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,14 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
*
* @see ComplexTObjectType
*/
TYPE((short) 1, "type"), TSCALAR((short) 2, "tscalar"), TMAP((short) 3, "tmap"), TLIST((short) 4, "tlist"), TSET((short) 5, "tset"), TOBJECT((short) 6, "tobject"), TCRITERIA((short) 7, "tcriteria"), TBINARY((short) 8, "tbinary");
TYPE((short) 1, "type"),
TSCALAR((short) 2, "tscalar"),
TMAP((short) 3, "tmap"),
TLIST((short) 4, "tlist"),
TSET((short) 5, "tset"),
TOBJECT((short) 6, "tobject"),
TCRITERIA((short) 7, "tcriteria"),
TBINARY((short) 8, "tbinary");

private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

Expand Down Expand Up @@ -340,33 +347,30 @@ public String getFieldName() {
new org.apache.thrift.meta_data.StructMetaData(
org.apache.thrift.protocol.TType.STRUCT,
com.cinchapi.concourse.thrift.TObject.class)));
tmpMap.put(_Fields.TMAP,
new org.apache.thrift.meta_data.FieldMetaData("tmap",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(
org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRUCT,
"ComplexTObject"),
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRUCT,
"ComplexTObject"))));
tmpMap.put(_Fields.TLIST,
new org.apache.thrift.meta_data.FieldMetaData("tlist",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(
org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRUCT,
"ComplexTObject"))));
tmpMap.put(_Fields.TSET,
new org.apache.thrift.meta_data.FieldMetaData("tset",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.SetMetaData(
org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRUCT,
"ComplexTObject"))));
tmpMap.put(_Fields.TMAP, new org.apache.thrift.meta_data.FieldMetaData(
"tmap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(
org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRUCT,
"ComplexTObject"),
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRUCT,
"ComplexTObject"))));
tmpMap.put(_Fields.TLIST, new org.apache.thrift.meta_data.FieldMetaData(
"tlist", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(
org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRUCT,
"ComplexTObject"))));
tmpMap.put(_Fields.TSET, new org.apache.thrift.meta_data.FieldMetaData(
"tset", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.SetMetaData(
org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRUCT,
"ComplexTObject"))));
tmpMap.put(_Fields.TOBJECT,
new org.apache.thrift.meta_data.FieldMetaData("tobject",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
Expand Down Expand Up @@ -494,7 +498,8 @@ public ByteBuffer toByteBuffer() {
else if(type == ComplexTObjectType.LIST
|| type == ComplexTObjectType.SET) {
Collection<ComplexTObject> collection = type == ComplexTObjectType.LIST
? tlist : tset;
? tlist
: tset;
collection.forEach((item) -> {
try {
byte[] itemBytes = item.toByteBuffer().array();
Expand Down Expand Up @@ -1427,8 +1432,8 @@ private void readObject(java.io.ObjectInputStream in)
}
}

private static class ComplexTObjectStandardSchemeFactory
implements SchemeFactory {
private static class ComplexTObjectStandardSchemeFactory implements
SchemeFactory {
public ComplexTObjectStandardScheme getScheme() {
return new ComplexTObjectStandardScheme();
}
Expand Down Expand Up @@ -1676,8 +1681,8 @@ public void write(org.apache.thrift.protocol.TProtocol oprot,

}

private static class ComplexTObjectTupleSchemeFactory
implements SchemeFactory {
private static class ComplexTObjectTupleSchemeFactory implements
SchemeFactory {
public ComplexTObjectTupleScheme getScheme() {
return new ComplexTObjectTupleScheme();
}
Expand Down
Loading

0 comments on commit cbae285

Please sign in to comment.