diff --git a/dataforge-gui/gui-workspace/build.gradle b/dataforge-gui/gui-workspace/build.gradle index 5edc60e..dc89ad8 100644 --- a/dataforge-gui/gui-workspace/build.gradle +++ b/dataforge-gui/gui-workspace/build.gradle @@ -16,15 +16,10 @@ plugins{ id "application" - id "com.github.johnrengelman.shadow" version "2.0.4" } + apply plugin: 'kotlin' -if (!hasProperty('mainClass')) { - ext.mainClass = 'hep.dataforge.plots.demo.DemoApp'//"inr.numass.viewer.test.TestApp" -} - -mainClassName = mainClass description = "A gui for workspace creation and manipulation" @@ -32,5 +27,9 @@ dependencies { compile project(':dataforge-gui') } +application{ + mainClassName = "hep.dataforge.plots.demo.DemoApp" +} + diff --git a/dataforge-plots/plots-viewer/build.gradle b/dataforge-plots/plots-viewer/build.gradle index 591aba2..4c25fe2 100644 --- a/dataforge-plots/plots-viewer/build.gradle +++ b/dataforge-plots/plots-viewer/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'com.github.johnrengelman.shadow' version '2.0.1' + id "com.github.johnrengelman.shadow" version "7.0.0" id 'application' } @@ -7,11 +7,9 @@ apply plugin: "kotlin" description = 'dataforge-plots-viewer' -if (!hasProperty('mainClass')) { - ext.mainClass = 'hep.dataforge.plots.viewer.ViewerApp' +application{ + mainClassName("hep.dataforge.plots.viewer.ViewerApp") } -mainClassName = mainClass - compileKotlin { kotlinOptions { @@ -20,12 +18,6 @@ compileKotlin { } } -kotlin { - experimental { - coroutines "enable" - } -} - dependencies { compile project(':dataforge-plots:plots-jfc') compile project(':dataforge-gui') diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index cc4fdc2..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6ce793f..0f80bbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 2fe81a7..4f906e0 100644 --- a/gradlew +++ b/gradlew @@ -82,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -129,6 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 9618d8d..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ 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" @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -51,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -61,28 +64,14 @@ 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% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/grind/grind-terminal/build.gradle b/grind/grind-terminal/build.gradle index 9ffcc3d..6ecde71 100644 --- a/grind/grind-terminal/build.gradle +++ b/grind/grind-terminal/build.gradle @@ -1,13 +1,10 @@ -buildscript { - repositories { jcenter() } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:2+' - } +plugins { + id 'groovy' + id 'application' + id "com.github.johnrengelman.shadow" version "7.0.0" } -apply plugin: 'groovy' -apply plugin: "application" -apply plugin: 'com.github.johnrengelman.shadow' + //apply plugin: 'org.openjfx.javafxplugin' // //javafx { @@ -15,10 +12,6 @@ apply plugin: 'com.github.johnrengelman.shadow' //} -if (!hasProperty('mainClass')) { - ext.mainClass = 'hep.dataforge.grind.terminal.RunGrindShell' -} -mainClassName = mainClass description = 'The grind plugin for dataforge framework' @@ -32,7 +25,7 @@ dependencies { } task shell(dependsOn: classes, type: JavaExec) { - main mainClass + main "hep.dataforge.grind.terminal.RunGrindShell" // jvmArgs ['-Djansi.passthrough=true'] standardInput = System.in standardOutput = System.out @@ -50,4 +43,8 @@ task dumbShell(dependsOn: classes, type: JavaExec) { classpath = sourceSets.main.runtimeClasspath description "Start a Grind shell with default context in dumb terminal" group "dataforge" +} + +application{ + mainClassName("hep.dataforge.grind.terminal.RunGrindShell") } \ No newline at end of file diff --git a/numass-control/cryotemp/build.gradle b/numass-control/cryotemp/build.gradle index 5eeae11..ce91400 100644 --- a/numass-control/cryotemp/build.gradle +++ b/numass-control/cryotemp/build.gradle @@ -1,10 +1,7 @@ apply plugin: 'application' apply plugin: 'kotlin' -if (!hasProperty('mainClass')) { - ext.mainClass = 'inr.numass.control.cryotemp.PKT8App' -} -mainClassName = mainClass + version = "0.2.0"; @@ -14,8 +11,12 @@ dependencies { compile project(':numass-control') } +application{ + mainClassName("inr.numass.control.cryotemp.PKT8App") +} + task testDevice(dependsOn: classes, type: JavaExec) { - main mainClass + main "inr.numass.control.cryotemp.PKT8App" args = ["--config.resource=config-debug/devices.xml"] classpath = sourceSets.main.runtimeClasspath description = "Start application in debug mode with default virtual port" diff --git a/numass-control/vac/build.gradle b/numass-control/vac/build.gradle index b946744..a36cf0e 100644 --- a/numass-control/vac/build.gradle +++ b/numass-control/vac/build.gradle @@ -2,17 +2,16 @@ apply plugin: 'application' version = "0.6.0" -if (!hasProperty('mainClass')) { - ext.mainClass = 'inr.numass.control.readvac.ReadVac' -} -mainClassName = mainClass - dependencies { compile project(':numass-control') } +application{ + mainClassName("inr.numass.control.readvac.ReadVac") +} + task testDevice(dependsOn: classes, type: JavaExec) { - main mainClass + main "inr.numass.control.readvac.ReadVac" args = ["--config.resource=config-test/devices.xml"] classpath = sourceSets.main.runtimeClasspath description "Start application in debug mode with default virtual port" diff --git a/numass-core/numass-data-proto/build.gradle.kts b/numass-core/numass-data-proto/build.gradle.kts index 03f95fd..8f9bbdc 100644 --- a/numass-core/numass-data-proto/build.gradle.kts +++ b/numass-core/numass-data-proto/build.gradle.kts @@ -5,7 +5,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { idea kotlin("jvm") - id("com.google.protobuf") version "0.8.8" + id("com.google.protobuf") version "0.8.16" } @@ -14,7 +14,7 @@ repositories { } dependencies { - implementation("com.google.protobuf:protobuf-java:3.6.1") + implementation("com.google.protobuf:protobuf-java:3.17.1") api(project(":numass-core:numass-data-api")) api(project(":dataforge-storage")) } @@ -36,7 +36,7 @@ protobuf { // Configure the protoc executable protoc { // Download from repositories - artifact = "com.google.protobuf:protoc:3.6.1" + artifact = "com.google.protobuf:protoc:3.17.1" } generatedFilesBaseDir = "$projectDir/gen" } diff --git a/numass-core/numass-signal-processing/src/test/kotlin/inr/numass/data/ChernovProcessorTest.kt b/numass-core/numass-signal-processing/src/test/kotlin/inr/numass/data/ChernovProcessorTest.kt index 6facc5a..15d8ad6 100644 --- a/numass-core/numass-signal-processing/src/test/kotlin/inr/numass/data/ChernovProcessorTest.kt +++ b/numass-core/numass-signal-processing/src/test/kotlin/inr/numass/data/ChernovProcessorTest.kt @@ -12,7 +12,7 @@ class ChernovProcessorTest { val events = mapOf(10.0 to 1.0, 16.0 to 0.5) val buffer = ShortArray(40) { i -> - events.entries.sumByDouble { (pos, amp) -> amp * gaussian.value(pos - i.toDouble()) }.toShort() + events.entries.sumByDouble { (pos, amp) -> amp * gaussian.value(pos - i.toDouble()) }.toInt().toShort() } @Test diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/models/ResolutionDemo.kt b/numass-main/src/main/kotlin/inr/numass/scripts/models/ResolutionDemo.kt index 0495bbe..7ea847a 100644 --- a/numass-main/src/main/kotlin/inr/numass/scripts/models/ResolutionDemo.kt +++ b/numass-main/src/main/kotlin/inr/numass/scripts/models/ResolutionDemo.kt @@ -18,7 +18,6 @@ fun main() { Global.output = FXOutputManager() - val params = ParamSet().apply { setPar("N", 8e5, 6.0, 0.0, Double.POSITIVE_INFINITY) setPar("bkg", 2.0, 0.03)