As title states. SPmanager refuses to list .groovy scripts, even when they have the proper XML headers.
I know that this is a plugin, but since it ships with core in the standard install, and groovy scripts seem to be the futuer of AOI scripting, thought that this deserved a core bug report.
SPManager seems to use file suffixes to filter for acceptable files, but a naive attempt to add .groovy to the accepted files has so far failed.
A search of the source code finds 12 different occurrences of ".bsh". Most likely we just need to go through and update all of them, but I haven't studied it carefully yet.
I didn't write this code, but I have been maintaining it for years.
There may be implications for both the client (Java code) and the server (C code).
I will have a look and see if I can easily:
a) include groovy scripts
b) make the code more generic so other types can be more easily added.
Cheers!
Nik
@Peter: I'm getting 11, are there a couple of versions out there?
@Nik: There is server code? I thought the repository was just a directory structure in the aoisp web space.
@Luke: If I recall correctly, SPManager supports both a native mode (scan remote directories), and a server-assisted mode (server scans local directories). The server-assisted mode was always much faster, so everyone kept it enabled (it was enabled by default, I think), and so I think the native mode may no longer work completely (I would have to test).
Anyway, in server-assisted mode, the server code reads the version.txt file, reads the XML header (embedded as a comment) in script files, and can open ZIP files to find the plugin XML file inside plugin JAR files.
I suspect the server would have to be updated to scan groovy scripts as well.
Both server and SPManager java plugin need to find metadata from the downloaded file:
- for a plugin JAR, the metadata is stored in an XML file inside the JAR;
- for a bash script, it is XML in a comment at the top of the file.
Some questions:
Q1: Where do the Groovy scripts store the AOI plugin XML metadata?
Q2: are groovy scripts packaged as text files only?
Q2.1 do we ship groovy scripts as compiled byte-code?
Q2.1.1 do we ship compiled groovy scripts as .JAR, .CLASS, or something else?
Cheers!
Nik
Q1: The ones I've seen so far have it right at the top, just like a beanshell script.
Q2: I believe so. Groovy packaged as bytecode would actually be a normal plugin, comiled to a jar, and so far we've only use groovy for scripts that are compiled at runtime.
example attached. (still needs tweaking, but should be functional enough to test)
And, just did a tiny little experiment. I can confirm that the java client-side scan does not work, even or plugins or .bsh scripts.
Have not really dug into why this is, and do not have access to the server-side code anyway, just wanted to add a bit of info.