diff --git a/build.gradle b/build.gradle index d69b6aa..d79cc4f 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,7 @@ allprojects { ext.jar_suffix = 'fat' ext.ex_options= '' ext.deploy_type= 'java' + ext.readonly = true repositories { mavenLocal() @@ -87,6 +88,7 @@ subprojects { def jar_suffix = project.ext.jar_suffix.toString() def ex_options = project.ext.ex_options def deploy_type = project.ext.deploy_type + def readonly = project.ext.readonly def package_name = project.name def app_path = '/opt/' + package_name + "/" + app_version def jar_file_name = app_name + "-" + app_version + ".jar"; @@ -97,7 +99,9 @@ subprojects { def sys_bin ='/usr/local/bin/' def sys_lib ='/usr/local/lib/' def bin_file_name = "${app_name}-${app_version}" - def java_file_name = main_class + ".java" + def java_file_name = (deploy_type=='pkg') ? app_description + ".java" : main_class + ".java" + def editor = bin_file_name + "-editor" + def file_mode = readonly ? 0644: 0777 project.tasks.register("rpm", Rpm) { doFirst { @@ -133,22 +137,28 @@ subprojects { directory(app_path, 755) directory(app_path + '/lib', 755) directory(app_path + '/bin', 755) - - into app_path + + into app_path if (deploy_type=='java'){ from ('src/main/java') { include java_file_name into 'lib' - fileMode 0644 - } + fileMode file_mode + } } else if (deploy_type=='jar'){ from ('build/libs') { include jar_file_name into 'lib' - fileMode 0644 + fileMode file_mode } - } + } else if (deploy_type=='pkg'){ + from ('src/main/pkg'){ + into 'lib' + fileMode file_mode + exclude '**/*.class' + } + } from('scripts') { into 'bin' @@ -156,12 +166,16 @@ subprojects { rename { String fileName -> fileName == "app_startup" ? bin_file_name : fileName } + rename { String fileName -> + fileName == "app_editor" ? editor : fileName + } expand([ "app_name": app_name, "app_version": app_version, "jar_file": jar_file_path, "fat_jar_file": fat_jar_file_path, - "java_file": app_path + '/lib/' + main_class + ".java", + "java_file": (deploy_type=='pkg') ? java_file_name : app_path + '/lib/' + java_file_name, + "pkg_folder": app_path + '/lib', "ex_options" :ex_options ]) fileMode 0755 diff --git a/correlation/build.gradle b/correlation/build.gradle index 44d4692..a489dbc 100644 --- a/correlation/build.gradle +++ b/correlation/build.gradle @@ -1,7 +1,8 @@ description = 'correlation' ext.mainClass = hasProperty('mainClass') ? mainClass : 'ch.psi.pshell.workbench.App' ext.title = 'Correlation' -ext.desc = 'Correlation' +ext.desc = 'Correlation' //The plugin class +ext.readonly = true ext.deploy_type= 'pkg' dependencies { @@ -17,3 +18,4 @@ sourceSets { } createDefaultTasks(project) + diff --git a/correlation/gradle.properties b/correlation/gradle.properties new file mode 100644 index 0000000..a934e31 --- /dev/null +++ b/correlation/gradle.properties @@ -0,0 +1,3 @@ +action.custom-1=rpm +action.custom-1.args=--configure-on-demand -w -x check -x test rpm +action.debug.args=debug --args="-b -d -l -k -g -q -statusbar -size=1000x700 -console_log=SEVERE -m ./src/main/pkg -laf=dark -pipeline_server localhost:8889 -camera_server localhost:8888 -epics_config ch.psi.jcae.ContextFactory.addressList=localhost:54321" diff --git a/correlation/scripts/app_editor b/correlation/scripts/app_editor new file mode 100644 index 0000000..b0c230c --- /dev/null +++ b/correlation/scripts/app_editor @@ -0,0 +1,11 @@ +#!/bin/sh +APP_ARGS_NAME=\$(echo "APP_${app_name}" | tr '[:lower:]' '[:upper:]')_ARGS +APP_ARGS_NAME=\${APP_ARGS_NAME//-/_} + +exec pshell-workbench -b -l -g -nbcf \${!APP_ARGS_NAME} \ + -plgp ${pkg_folder}/plugins \ + -scpt ${pkg_folder}/script \ + -devp ${pkg_folder}/devices \ + -pool ${pkg_folder}/config/devices.properties \ + -p ${java_file} \ + "\$@" \ No newline at end of file diff --git a/correlation/scripts/app_startup b/correlation/scripts/app_startup new file mode 100644 index 0000000..c44965a --- /dev/null +++ b/correlation/scripts/app_startup @@ -0,0 +1,7 @@ +#!/bin/sh +APP_ARGS_NAME=\$(echo "APP_${app_name}" | tr '[:lower:]' '[:upper:]')_ARGS +APP_ARGS_NAME=\${APP_ARGS_NAME//-/_} + +# Run the package with all passed arguments +exec pshell-workbench -b -d -l -k -g -q -statusbar -size=1000x700 -console_log=SEVERE -m ${pkg_folder} \${!APP_ARGS_NAME} "\$@" + diff --git a/correlation/src/main/pkg/config/jcae.properties b/correlation/src/main/pkg/config/jcae.properties deleted file mode 100755 index 3c929d9..0000000 --- a/correlation/src/main/pkg/config/jcae.properties +++ /dev/null @@ -1,12 +0,0 @@ -#Mon Feb 22 20:35:07 CET 2021 -ch.psi.jcae.ContextFactory.addressList= -ch.psi.jcae.ContextFactory.serverPort= -ch.psi.jcae.ContextFactory.maxArrayBytes=50000000 -ch.psi.jcae.ChannelFactory.retries=1 -ch.psi.jcae.ChannelFactory.timeout=1000 -ch.psi.jcae.impl.DefaultChannelService.retries=1 -ch.psi.jcae.impl.DefaultChannelService.timeout=1000 -ch.psi.jcae.ContextFactory.autoAddressList=true -ch.psi.jcae.ContextFactory.useShellVariables=true -ch.psi.jcae.ContextFactory.addLocalBroadcastInterfaces=false -ch.psi.jcae.ContextFactory.maxSendArrayBytes=1000000 diff --git a/correlation/src/main/pkg/devices/dispatcher.properties b/correlation/src/main/pkg/devices/dispatcher.properties index db3e719..4297144 100755 --- a/correlation/src/main/pkg/devices/dispatcher.properties +++ b/correlation/src/main/pkg/devices/dispatcher.properties @@ -1,4 +1,5 @@ -#Wed May 31 12:25:22 CEST 2023 +#Tue Aug 19 09:56:32 CEST 2025 +analizeHeader=false byteBufferAllocator=false disableCompression=false dropIncomplete=false