Closed rnett closed 3 years ago
There should be no issues. You may use system properties in your integration class and add dependencies/imports/whatever based on them
Nice. Two further questions:
Sorry for delay, I have been vacationing 🌴
%use
magic in your library init code. For JSON descriptor:
{ "init": ["%use someOtherLib"] }
For new-way integration:
onLoaded {
execute("%use someOtherLib")
}
No worries, this isn't urgent. I should clarify 1: I'm trying to depend on another module in the same project, so for example if you use @DependsOn("my.lib:a:0.2.0"
I want to depend on my.lib:b:0.2.0
. If I understand the %use
magics right, they would use the configured version from the kernel (which is generally the latest), which wouldn't work if the user was depending on an old version initially.
After looking through the code, it does not seem easily possible.
What I'd do in your case.
:a
:
implementation(":b")
:a
and :b
@DependsOn("my.lib:a:0.2.0")
in notebook should work as you expectIf it is not applicable, please clarify a bit more)
Yeah, unfortunately this is combined with the artifact depending on the OS, so it's more like I need to depend on my.lib:b:jar:$os:0.2.0
. I think adding a resource file with the current version is as good as I'm going to be able to get, which works well enough.
For reference this is what I'm doing currently.
Yes, resource file with the version should be the way
I'm closing this issue because solution exists and it's hard to invent something better
I'm looking at adding integration for tensorflow. There is a large native dependency, and while I can just depend on the all-platforms bundle, I would like to depend on only the current platform's (or error if it's not supported). Presumably the way to do this would be via a
LibraryDefinitionProducer
, but as far as I can see there is no way to get the platform. Will there be issues if I use the current JVM's methods (i.e.System.getProperty("os.name")
in myLibraryDefinitionProducer
)?