如何为 JAR 中的程序设置 ABL PROPATH?

How to set the ABL PROPATH for procedures in a JAR?

我有一个 Java (Groovy) CLI 应用程序,它也使用了一些 Progress ABL 代码。应用程序在构建 (gradle) 时被打包到可执行 JAR* 中以供分发。 r 代码(编译的 ABL 代码)包含在此 JAR 中。我已尝试通过多种不同的方式设置 PROPATH,但无法在 JAR 中找到 r 代码。即使应用程序本身 运行ning 来自 JAR 内部,是否必须先从存档中提取 r 代码才能使用它? 运行 从源代码目录构建的 JAR 工作正常,但我认为那只是因为源 .p 文件位于文件系统的相对路径中。我该怎么做?

是否有更好的方法将 r 代码与 JAR 打包在 tarball 中进行分发,而不是将 r 代码包含在 JAR 本身中?例如:

场景 1:

app.tar.gz
  -app.jar
    -Java/Groovy classes
    -Bundled dependencies
    -rcode/*.r

场景 2:

app.tar.gz
  -app.jar
    -Java/Groovy classes
    -Bundled dependencies
  -rcode/*.r

场景一导致了上面描述的PROPATH问题,但是场景二我没有测试过。

*即使用 $ java -jar app.jar 到 运行 构建的应用程序。我打算在 JAR 中包含一个启动 shell 脚本,以便于启动。 JAR main class 已编译 Java,根据输入参数,将 运行 需要的 ABL 程序之一。

Does the r-code have to be extracted from the archive before it can be used even though the application itself is running from inside the JAR?

简短的回答是肯定的,AVM 无法读取除 procedure library 之外的任何存档中的 ABL 代码(来源 and/or r 代码)。

Is a better approach to package the r-code with the JAR in a tarball for distribution instead of including the r-code in the JAR itself?

如果您使用过程库,则需要将 PL 显式添加到 PROPATH。如果您将 (r-) 代码部署在(比方说)一个 zip 文件中,您可以将其解压缩到 AVM 的工作目录中,一切都应该正常运行。这取决于 ABL 代码是什么运行,至于工作目录在哪里。

使用过程库(相对于“松散的”r 代码)还有其他好处,但我不确定它们在这里是否合适。