Package apps
This commit is contained in:
30
build.gradle
30
build.gradle
@@ -11,6 +11,7 @@ allprojects {
|
|||||||
ext.jar_suffix = 'fat'
|
ext.jar_suffix = 'fat'
|
||||||
ext.ex_options= ''
|
ext.ex_options= ''
|
||||||
ext.deploy_type= 'java'
|
ext.deploy_type= 'java'
|
||||||
|
ext.readonly = true
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
@@ -87,6 +88,7 @@ subprojects {
|
|||||||
def jar_suffix = project.ext.jar_suffix.toString()
|
def jar_suffix = project.ext.jar_suffix.toString()
|
||||||
def ex_options = project.ext.ex_options
|
def ex_options = project.ext.ex_options
|
||||||
def deploy_type = project.ext.deploy_type
|
def deploy_type = project.ext.deploy_type
|
||||||
|
def readonly = project.ext.readonly
|
||||||
def package_name = project.name
|
def package_name = project.name
|
||||||
def app_path = '/opt/' + package_name + "/" + app_version
|
def app_path = '/opt/' + package_name + "/" + app_version
|
||||||
def jar_file_name = app_name + "-" + app_version + ".jar";
|
def jar_file_name = app_name + "-" + app_version + ".jar";
|
||||||
@@ -97,7 +99,9 @@ subprojects {
|
|||||||
def sys_bin ='/usr/local/bin/'
|
def sys_bin ='/usr/local/bin/'
|
||||||
def sys_lib ='/usr/local/lib/'
|
def sys_lib ='/usr/local/lib/'
|
||||||
def bin_file_name = "${app_name}-${app_version}"
|
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) {
|
project.tasks.register("rpm", Rpm) {
|
||||||
doFirst {
|
doFirst {
|
||||||
@@ -133,22 +137,28 @@ subprojects {
|
|||||||
directory(app_path, 755)
|
directory(app_path, 755)
|
||||||
directory(app_path + '/lib', 755)
|
directory(app_path + '/lib', 755)
|
||||||
directory(app_path + '/bin', 755)
|
directory(app_path + '/bin', 755)
|
||||||
|
|
||||||
into app_path
|
into app_path
|
||||||
|
|
||||||
if (deploy_type=='java'){
|
if (deploy_type=='java'){
|
||||||
from ('src/main/java') {
|
from ('src/main/java') {
|
||||||
include java_file_name
|
include java_file_name
|
||||||
into 'lib'
|
into 'lib'
|
||||||
fileMode 0644
|
fileMode file_mode
|
||||||
}
|
}
|
||||||
} else if (deploy_type=='jar'){
|
} else if (deploy_type=='jar'){
|
||||||
from ('build/libs') {
|
from ('build/libs') {
|
||||||
include jar_file_name
|
include jar_file_name
|
||||||
into 'lib'
|
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') {
|
from('scripts') {
|
||||||
into 'bin'
|
into 'bin'
|
||||||
@@ -156,12 +166,16 @@ subprojects {
|
|||||||
rename { String fileName ->
|
rename { String fileName ->
|
||||||
fileName == "app_startup" ? bin_file_name : fileName
|
fileName == "app_startup" ? bin_file_name : fileName
|
||||||
}
|
}
|
||||||
|
rename { String fileName ->
|
||||||
|
fileName == "app_editor" ? editor : fileName
|
||||||
|
}
|
||||||
expand([
|
expand([
|
||||||
"app_name": app_name,
|
"app_name": app_name,
|
||||||
"app_version": app_version,
|
"app_version": app_version,
|
||||||
"jar_file": jar_file_path,
|
"jar_file": jar_file_path,
|
||||||
"fat_jar_file": fat_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
|
"ex_options" :ex_options
|
||||||
])
|
])
|
||||||
fileMode 0755
|
fileMode 0755
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
description = 'correlation'
|
description = 'correlation'
|
||||||
ext.mainClass = hasProperty('mainClass') ? mainClass : 'ch.psi.pshell.workbench.App'
|
ext.mainClass = hasProperty('mainClass') ? mainClass : 'ch.psi.pshell.workbench.App'
|
||||||
ext.title = 'Correlation'
|
ext.title = 'Correlation'
|
||||||
ext.desc = 'Correlation'
|
ext.desc = 'Correlation' //The plugin class
|
||||||
|
ext.readonly = true
|
||||||
ext.deploy_type= 'pkg'
|
ext.deploy_type= 'pkg'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -17,3 +18,4 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createDefaultTasks(project)
|
createDefaultTasks(project)
|
||||||
|
|
||||||
|
|||||||
3
correlation/gradle.properties
Normal file
3
correlation/gradle.properties
Normal 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"
|
||||||
11
correlation/scripts/app_editor
Normal file
11
correlation/scripts/app_editor
Normal 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} \
|
||||||
|
"\$@"
|
||||||
7
correlation/scripts/app_startup
Normal file
7
correlation/scripts/app_startup
Normal 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} "\$@"
|
||||||
|
|
||||||
@@ -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
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#Wed May 31 12:25:22 CEST 2023
|
#Tue Aug 19 09:56:32 CEST 2025
|
||||||
|
analizeHeader=false
|
||||||
byteBufferAllocator=false
|
byteBufferAllocator=false
|
||||||
disableCompression=false
|
disableCompression=false
|
||||||
dropIncomplete=false
|
dropIncomplete=false
|
||||||
|
|||||||
Reference in New Issue
Block a user