Skip to content

Commit

Permalink
Update gradle and plugin versions, java 14->17 (#600)
Browse files Browse the repository at this point in the history
* Update gradle and plugin versions, java 14->17

* Review feedback
  • Loading branch information
aprudhomme authored Oct 18, 2023
1 parent 235e2b2 commit c5270cf
Show file tree
Hide file tree
Showing 57 changed files with 499 additions and 433 deletions.
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
FROM azul/zulu-openjdk-debian:14
FROM debian:12

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && \
apt-get install -y wget gnupg2 software-properties-common

RUN wget -O- https://apt.corretto.aws/corretto.key | apt-key add -
RUN add-apt-repository -y 'deb https://apt.corretto.aws stable main'
# For some reason, needs to be run again for the repo to be usable
RUN add-apt-repository -y 'deb https://apt.corretto.aws stable main'
RUN apt-get update && \
apt-get install -y java-17-amazon-corretto-jdk

RUN mkdir /usr/app/
COPY . /user/app/
WORKDIR /user/app/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In the home directory.
./gradlew clean installDist test
```

Note: This code has been tested on *Java14*
Note: This code has been tested on *Java17*


# Run gRPC Server
Expand Down
38 changes: 21 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {
id 'idea'
id 'maven-publish'
id 'signing'
id "com.diffplug.gradle.spotless" version "4.3.0"
id "com.diffplug.spotless" version "6.22.0"
id 'java-library'
id 'jacoco'
// Build docs locally by running "site" command
id 'kr.motd.sphinx' version '2.10.0'
id 'kr.motd.sphinx' version '2.10.1'
}

repositories {
Expand All @@ -20,8 +20,10 @@ repositories {
mavenCentral()
}

sourceCompatibility = 1.14
targetCompatibility = 1.14
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

allprojects {
version = '1.0.0-SNAPSHOT'
Expand All @@ -47,7 +49,7 @@ def spatial4jVersion = '0.7'
def s3mockVersion = '0.2.5'
def commonsCompressVersion = '1.21'
def awsJavaSdkVersion = '1.11.695'
def guicedeeVersion = '1.1.1.3-jre14'
def guicedeeVersion = '1.2.2.1-jre17'
def prometheusClientVersion = '0.8.0'
def fastutilVersion = '8.5.6'

Expand Down Expand Up @@ -117,32 +119,32 @@ dependencies {
startScripts.enabled = false

task luceneServer(type: CreateStartScripts) {
mainClassName = 'com.yelp.nrtsearch.server.grpc.LuceneServer'
mainClass = 'com.yelp.nrtsearch.server.grpc.LuceneServer'
applicationName = 'lucene-server'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp-app')
classpath = startScripts.classpath
// Add additional dependencies, e.g. custom loggers
classpath += files('$APP_HOME/additional_libs')
}

task luceneServerClient(type: CreateStartScripts) {
mainClassName = 'com.yelp.nrtsearch.server.cli.LuceneClientCommand'
mainClass = 'com.yelp.nrtsearch.server.cli.LuceneClientCommand'
applicationName = 'lucene-client'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp-app')
classpath = startScripts.classpath
}

task backupRestoreTool(type: CreateStartScripts) {
mainClassName = 'com.yelp.nrtsearch.server.cli.BackupRestoreCommand'
mainClass = 'com.yelp.nrtsearch.server.cli.BackupRestoreCommand'
applicationName = 'backup-restore'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp-app')
classpath = startScripts.classpath
}

task nrtUtils(type: CreateStartScripts) {
mainClassName = 'com.yelp.nrtsearch.tools.nrt_utils.NrtUtilsCommand'
mainClass = 'com.yelp.nrtsearch.tools.nrt_utils.NrtUtilsCommand'
applicationName = 'nrt_utils'
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp-app')
classpath = startScripts.classpath
}

Expand All @@ -165,6 +167,8 @@ task buildGrpcGateway(dependsOn: installDist, type: Exec) {
//e.g. default is to exclude perfTests: ./gradlew test
test {
finalizedBy 'spotlessJavaCheck'
// Used by LuceneServerConfigurationTest
environment(Map.of('CUSTOM_HOST', 'my_custom_host', 'VAR1', 'v1', 'VAR2', 'v2', 'VAR3', 'v3'))
if (project.hasProperty('longRunningTestsOnly')) {
include '**/IncrementalDataCleanupCommandTest.class'
} else {
Expand All @@ -189,7 +193,7 @@ test {

jacocoTestReport {
reports {
csv.enabled true
csv.required = true
}
}

Expand All @@ -198,17 +202,17 @@ task javadocs(type: Javadoc) {
}

task javadocsJar(type: Jar) {
classifier('javadoc')
archiveClassifier = 'javadoc'
from javadocs.destinationDir
}

task sourcesJar(type: Jar) {
classifier('sources')
archiveClassifier = 'sources'
from sourceSets.main.java.srcDirs
}

task testsJar(type: Jar) {
classifier('tests')
archiveClassifier = 'tests'
from sourceSets.test.output
}

Expand Down
15 changes: 9 additions & 6 deletions clientlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ plugins {
// Provide convenience executables for trying out the examples.
id 'application'
// ASSUMES GRADLE 2.12 OR HIGHER. Use plugin version 0.7.5 with earlier gradle versions
id 'com.google.protobuf' version '0.8.12'
id 'com.google.protobuf' version '0.9.4'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
// Publish clientlib to maven central
id 'maven-publish'
id 'signing'
id "com.diffplug.gradle.spotless"
id "com.diffplug.spotless"
id 'java-library'
}

Expand All @@ -20,8 +20,10 @@ repositories {
mavenCentral()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
startScripts.enabled = false

// groupId, artifactId and version for the generated pom
Expand Down Expand Up @@ -88,12 +90,12 @@ task javadocs(type: Javadoc) {
}

task javadocsJar(type: Jar) {
classifier('javadoc')
archiveClassifier = 'javadoc'
from javadocs.destinationDir
}

task sourcesJar(type: Jar) {
classifier('sources')
archiveClassifier = 'sources'
from sourceSets.main.java.srcDirs
}

Expand Down Expand Up @@ -183,6 +185,7 @@ publishing {

spotless {
java {
targetExclude "build/**/*.java"
licenseHeaderFile '../license_header'
removeUnusedImports()
endWithNewline()
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ In the home directory, one can build nrtSearch locally like this:
./gradlew clean installDist test
Note: This code has been tested on *Java14*.
Note: This code has been tested on *Java17*.

Run gRPC Server
---------------------------
Expand Down
8 changes: 5 additions & 3 deletions example-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.diffplug.gradle.spotless' version '4.3.0'
id 'com.diffplug.spotless' version '6.22.0'
id 'distribution'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
Expand All @@ -14,8 +14,10 @@ repositories {
mavenCentral()
}

sourceCompatibility = 1.17
targetCompatibility = 1.17
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

group 'com.yelp.nrtsearch.plugins'
version '0.0.1'
Expand Down
Binary file modified example-plugin/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion example-plugin/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c5270cf

Please sign in to comment.