use icon indicating copy to clipboard operation
use copied to clipboard

Configurable directories for plugins and extensions

Open h-man2 opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. USE is applied in different contexts, e.g., unit tests, integration tests. But these environments differ, but need to be aligned to some fixed assumtions by USE:

  1. Hardcoded path for OCL extensions (/oclextensions)
  2. Hardcoded path for plugins (lib/plugins) This makes each switch of context for USE hard, since the environment must be aligned to these assumptions. For example, the integrationtests for the shell require to start USE without any warnings in the shell. Therefore, the module use-core must contain the empty folder lib/plugins (see [ShellIT.java]),

Describe the solution you'd like Both hardcoded paths should be changeable at startup. Maybe using a startup argument.

Describe alternatives you've considered Using properties file, but this again requires a fixed file location.

Additional context Excerpt from ShellIT:

[...]
private List<String> runUSE(Path useFile, Path cmdFile) {
ProcessBuilder pb = new ProcessBuilder(
                javaBinary.toString(),
                "-Duser.country=US",
                "-Duser.language=en",
                "-jar",
                useJar.get().toString(),
                "-nogui",
                "-nr",
                "-t",
                "-oclAnyCollectionsChecks:E",
                "-extendedTypeSystemChecks:E",
                /* This is currently an unstable workaround
                   USE determines the plugin and the extensions to OCL by fixed paths.
                   For now, the use-core module contains the directories including the extensions
                   and an empty plugins folder.
                   The folder is located: use/use-core/target/classes
                   Therefore, this is used as the USE home
                 */
                "-H=" + useJar.get().getParent().resolve("../../use-core/target/classes").toString(),
                useFile.getFileName().toString(),
                cmdFile.getFileName().toString());
[...]

h-man2 avatar Oct 01 '21 10:10 h-man2