Package apps

This commit is contained in:
2025-08-19 18:03:21 +02:00
parent 9703240a4c
commit 6f72ea1692
7 changed files with 48 additions and 22 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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"

View File

@@ -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} \
"\$@"

View File

@@ -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} "\$@"

View File

@@ -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

View File

@@ -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