dialogos-project / dialogos

The DialogOS dialog system.
https://www.dialogos.app
GNU General Public License v3.0
20 stars 7 forks source link

Install self-developed plugins into DialogOS #114

Closed alexanderkoller closed 5 years ago

alexanderkoller commented 5 years ago

We need to figure out how to compile a plugin and then insert into an installation of DialogOS that was installed by the install4j installer. Copying the plugin's Jar files into the plugins folder of the installation does not seem to be sufficient.

This is urgent and important. One can gradlew run a version of DialogOS with a newly developed plugin from the command line, but this limits the user to using only that plugin and none of the others.

@akoehn , do you have time to look into this? I think you're most familiar with the installer.

timobaumann commented 5 years ago

this works flawlessly for me (install without nxt support, later copy nxt to plugins/ and nxt support is there; same for ROS).

the linux start script (created by install4j) includes

for i in `ls "$app_home/lib" 2> /dev/null | egrep "\.(jar|zip)$"`
do
  add_class_path "$app_home/lib/$i"
done
for i in `ls "$app_home/plugins" 2> /dev/null | egrep "\.(jar|zip)$"`
do
  add_class_path "$app_home/plugins/$i"
done

so I'm surprised it does not work as intended. You can debug whether it's on the classpath by putting an "echo" in front of the call in the script and checking whether it's on there.

Please make sure your jar contains the file META-INF/services/com.clt.dialogos.plugin.Plugin and that one contains a line which references your plugin class.

as a workaround: other plugins can be used if they are added as gradle dependencies of the plugin you're developing.

alexanderkoller commented 5 years ago

You are absolutely right. The key is to copy the Jar file(s) for the plugin into the plugins directory under the DialogOS installation directly. My mistake was to make another subdirectory next to Sphinx, Sqlite, etc. and put the Jar files there.

I have updated the plugins developer distribution accordingly.