diff --git a/.github/workflows/java-continuous-integration.yml b/.github/workflows/java-continuous-integration.yml index 1b83694f81..f99ed017fb 100644 --- a/.github/workflows/java-continuous-integration.yml +++ b/.github/workflows/java-continuous-integration.yml @@ -37,3 +37,9 @@ jobs: with: build-root-directory: java arguments: build + - name: Smoke test jar in client environment + uses: gradle/gradle-build-action@v2 + with: + build-root-directory: java/smoketest + arguments: run + gradle-executable: java/gradlew diff --git a/Dockerfile.dev b/Dockerfile.dev index b5577aaf53..2de39654fb 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -4,6 +4,7 @@ RUN mkdir /workspace && \ apt update && \ apt install git -y && \ apt install protobuf-compiler -y && \ + apt install cmake -y && \ pip install pytest && \ pip install pytest-cov && \ pip install jupyterlab && \ diff --git a/java/.bumpversion.cfg b/java/.bumpversion.cfg index 9bcad43e41..7976ed13af 100644 --- a/java/.bumpversion.cfg +++ b/java/.bumpversion.cfg @@ -14,3 +14,4 @@ values = rc [bumpversion:file:build.gradle.kts] +[bumpversion:file:smoketest/build.gradle] diff --git a/java/cli/build.gradle.kts b/java/cli/build.gradle.kts index 0afc9563f9..96db087528 100644 --- a/java/cli/build.gradle.kts +++ b/java/cli/build.gradle.kts @@ -40,12 +40,12 @@ dependencies { implementation("info.picocli:picocli:4.2.0") // lombok support - compileOnly("org.projectlombok:lombok:1.18.12") - annotationProcessor("org.projectlombok:lombok:1.18.12") + compileOnly("org.projectlombok:lombok:1.18.20") + annotationProcessor("org.projectlombok:lombok:1.18.20") annotationProcessor("info.picocli:picocli:4.2.0") - testCompileOnly("org.projectlombok:lombok:1.18.12") - testAnnotationProcessor("org.projectlombok:lombok:1.18.12") + testCompileOnly("org.projectlombok:lombok:1.18.20") + testAnnotationProcessor("org.projectlombok:lombok:1.18.20") // testng testImplementation("org.testng:testng:6.8") diff --git a/java/core/build.gradle.kts b/java/core/build.gradle.kts index a523fadb17..f6c109ee90 100644 --- a/java/core/build.gradle.kts +++ b/java/core/build.gradle.kts @@ -44,10 +44,10 @@ dependencies { api("com.google.code.findbugs:jsr305:3.0.2") // lombok support - compileOnly("org.projectlombok:lombok:1.18.12") - annotationProcessor("org.projectlombok:lombok:1.18.12") - testCompileOnly("org.projectlombok:lombok:1.18.12") - testAnnotationProcessor("org.projectlombok:lombok:1.18.12") + compileOnly("org.projectlombok:lombok:1.18.20") + annotationProcessor("org.projectlombok:lombok:1.18.20") + testCompileOnly("org.projectlombok:lombok:1.18.20") + testAnnotationProcessor("org.projectlombok:lombok:1.18.20") // testng testImplementation("org.testng:testng:6.8") diff --git a/java/gradle/wrapper/gradle-wrapper.properties b/java/gradle/wrapper/gradle-wrapper.properties index a4b4429748..2e6e5897b5 100644 --- a/java/gradle/wrapper/gradle-wrapper.properties +++ b/java/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java/gradlew.bat b/java/gradlew.bat index 62bd9b9cce..9109989e3c 100644 --- a/java/gradlew.bat +++ b/java/gradlew.bat @@ -1,103 +1,103 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/java/smoketest/build.gradle b/java/smoketest/build.gradle new file mode 100644 index 0000000000..d35b6fcd27 --- /dev/null +++ b/java/smoketest/build.gradle @@ -0,0 +1,27 @@ + +apply plugin: 'java' +apply plugin: 'application' + +mainClassName = 'SmokeTest' + +repositories { + flatDir { + dirs '../build/libs', '../cli/build/libs', '../core/build/libs' + } + mavenCentral() +} + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +dependencies { + implementation "ai.whylabs:core:0.1.7-b2" + + implementation "org.apache.datasketches:datasketches-java:1.3.0-incubating" + implementation "com.google.protobuf:protobuf-java:3.13.0" + + // lombok support + compileOnly("org.projectlombok:lombok:1.18.20") + annotationProcessor("org.projectlombok:lombok:1.18.20") + annotationProcessor("info.picocli:picocli:4.2.0") +} diff --git a/java/smoketest/settings.gradle b/java/smoketest/settings.gradle new file mode 100644 index 0000000000..e69de29bb2 diff --git a/java/smoketest/src/main/java/smoketest/SmokeTest.java b/java/smoketest/src/main/java/smoketest/SmokeTest.java new file mode 100644 index 0000000000..45f5cbfe4d --- /dev/null +++ b/java/smoketest/src/main/java/smoketest/SmokeTest.java @@ -0,0 +1,12 @@ +import com.whylogs.core.DatasetProfile; +import com.whylogs.core.statistics.NumberTracker; +import com.whylogs.core.message.NumbersMessage; +import java.time.Instant; + +public class SmokeTest { + public static void main(String[] args) { + DatasetProfile dsp = new DatasetProfile("test", Instant.now()); + NumberTracker tracker = new NumberTracker(); + NumbersMessage.Builder protobuf = tracker.toProtobuf(); + } +} diff --git a/java/spark/build.gradle.kts b/java/spark/build.gradle.kts index 7051d65ba7..84e1eeedf7 100644 --- a/java/spark/build.gradle.kts +++ b/java/spark/build.gradle.kts @@ -3,7 +3,7 @@ plugins { `java-library` signing `maven-publish` - id("com.github.maiflai.scalatest") version "0.26" + id("com.github.maiflai.scalatest") version "0.31" } repositories { @@ -27,6 +27,10 @@ tasks.jar { archiveBaseName.set(artifactBaseName) } +tasks.withType { + duplicatesStrategy = DuplicatesStrategy.INCLUDE +} + fun scalaPackage(groupId: String, name: String, version: String) = "$groupId:${name}_$scalaVersion:$version" @@ -82,10 +86,10 @@ dependencies { implementation("com.squareup.okhttp3:okhttp:4.9.1") // lombok support - compileOnly("org.projectlombok:lombok:1.18.12") - annotationProcessor("org.projectlombok:lombok:1.18.12") - testCompileOnly("org.projectlombok:lombok:1.18.12") - testAnnotationProcessor("org.projectlombok:lombok:1.18.12") + compileOnly("org.projectlombok:lombok:1.18.20") + annotationProcessor("org.projectlombok:lombok:1.18.20") + testCompileOnly("org.projectlombok:lombok:1.18.20") + testAnnotationProcessor("org.projectlombok:lombok:1.18.20") // testng testImplementation("org.testng:testng:6.8")