feat: add extensible registry interface and integrate into config and meta-config registries#560
Conversation
… meta-config registries
solonovamax
left a comment
There was a problem hiding this comment.
should the concept of extending a registry maybe be abstracted a bit, so it can be extended both via system properties, but also by different providers? (config file, env variable, cli param, etc.)
| var file = path.toFile(); | ||
| return file.isDirectory() || file.getName().endsWith(".zip"); |
There was a problem hiding this comment.
use the NIO Files api
with the files api, it allows it to easy be able to handle, for example, paths inside zip files (if we ever do support that) or something
| parseValidPaths(System.getProperty(basePropertyName + ".searchPath")), | ||
| Stream.of(baseSearchPath) | ||
| ); | ||
|
|
||
| Stream<Path> extraPath = parseValidPaths(System.getProperty(basePropertyName + ".extraPath")); |
There was a problem hiding this comment.
do we need both extra path & search path, or would only one be sufficient?
| * <br> | ||
| * These system properties are formatted like UNIX-style paths, with each path separated by a colon (':') character. | ||
| */ | ||
| public interface CliExtensibleRegistry { |
There was a problem hiding this comment.
I feel like the name "cli extensible registry" could definitely be workshopped a bit, but that's a personal nitpick
| var file = path.toFile(); | ||
| return file.isDirectory() || file.getName().endsWith(".zip"); |
| String basePropertyName = "terra.registry." + getRegistryName(); | ||
|
|
||
| Stream<Path> searchPath = Stream.concat( | ||
| parseValidPaths(System.getProperty(basePropertyName + ".searchPath")), |
There was a problem hiding this comment.
personally I am partial to using kebab case for something like this rather than camel case, but this is a personal nitpick and it's honestly fine either way
Pull Request
Description
As discussed via discord: Provides a way to extend the "search radius" of the pack and metapack registres using 4 system properties documented in the code below
Changelog
Checklist
Mandatory checks
ver/prefix)or is a branch that is intended to be merged into a version branch.
CONTRIBUTING.mddocument in the root of the git repository.
Types of changes
Compatibility
Documentation
Testing
Licensing
release it under GPLv3.
released under GPLv3 or a compatible license.
This does not build
This does not build due to missing stuff in the 1.21.11 branch.
Minestom part published
https://mvn.everbuild.org/#/public/com/dfsek/terra/minestom/7.0.0-BETA+b49b38f24