Closed phildow closed 4 years ago
And I was just reading that although you can't publish the same package from two modules you can publish subpackages, since the names are independent of one another, so we might be able to do:
tensoriocore
ai.doc.tensorio.core
TIOData
...
tensoriotflite
ai.doc.tensorio.tflite
TIOTFLiteModel
TIOTFLiteData
tensoriotensorflow
ai.doc.tensorio.tensorflow
TIOTensorFlowModel
...
Which is nice. I'm going to create a test project and see if I can actually get this working, since I'd like to have this structure in place prior to the 1.0 tag
Oh man, even better I can keep the module names super simple since they are namespaced to the project, and then I'll update the individual filenames to drop the TIO prefix, so we end up with:
core
ai.doc.tensorio.core
Data
...
tflite
ai.doc.tensorio.tflite
Model
Data
tensorflow
ai.doc.tensorio.tensorflow
Model
Oh yeah. That's it. And then gradle imports are:
implementation 'com.github.doc-ai:tensorio-android:tflite:0.9.6'
@RohanJahagirdar ^^^^ Multimodule project, how to
Check it out @RohanJahagirdar
See https://jitpack.io/docs/BUILDING/#multi-module-projects
Right now we have a module
tensorio
exporting the packageai.doc.tensorio
with a number of subpackages, including theTIOTFLiteData
andTIOTFLiteModel
subpackages.The structure looks like:
This is currently imported into a project using Jitpack as follows:
Right now the exported package assumes we're using a TF Lite backend, but we'd like to support multiple backends for tensor/io in a modular manner, including specifically a full TensorFlow backend. How can we do that?
The first thought is to continue to contain everything in a single module and organize multiple backends into subpackages, so:
But with this structure there is no way to only import say only the tflite code and exclude the tensorflow code, or vice versa, since they are subpackages underneath the single root package exported by the module, and Jitpack imports the whole module.
In fact we can't even move the packages to the root level for the same reason, i.e.:
But if I understand Jitpacks documentation at Multi-module Projects correctly then we can have the single repository export multiple modules and then target those modules separately in gradle. The structure now looks like:
We would have to be sure that we can explicitly define dependencies among the modules, but then we can target them in gradle with: