Android Studio - 创建子模块
我在 Android Studio 上创建了模块。我还想创建包含此模块(库)的不同模块(库)库。
例如,在 iOS 上,我使用 Pod Spec 执行此操作,如下所示。
spec.subspec 'FlowerSDK' do |fs|
fs.source_files = '**/SDK/Sources/FlowerSDK/**/*.{m,swift}'
fs.dependency 'FlowerSDK'
fs.dependency 'CoreSDK'
end
spec.subspec 'OceanSDK' do |os|
os.source_files = '**/SDK/Sources/OceanSDK/**/*.{m,swift}'
os.dependency 'OceanSDK'
os.dependency 'CoreSDK'
end
我如何在 Android 上执行此操作?我能想到的解决方案是;创建 3 个名为“CoreSDK”、“OceanSDK”、“FlowerSDK”的模块。然后“OceanSDK”和“FlowerSDK”模块使用“CoreSDK”模块。 有人有更好的解决方案吗?
I created Module on Android Studio. I also want to create different Module(Library) libraries containing this Module(Library).
For example on iOS I did this with Pod Spec as follows.
spec.subspec 'FlowerSDK' do |fs|
fs.source_files = '**/SDK/Sources/FlowerSDK/**/*.{m,swift}'
fs.dependency 'FlowerSDK'
fs.dependency 'CoreSDK'
end
spec.subspec 'OceanSDK' do |os|
os.source_files = '**/SDK/Sources/OceanSDK/**/*.{m,swift}'
os.dependency 'OceanSDK'
os.dependency 'CoreSDK'
end
How can I do this on Android? The solution I can think of is; Creating 3 Modules named "CoreSDK", "OceanSDK", "FlowerSDK". Then the "OceanSDK" and "FlowerSDK" modules use the "CoreSDK" module.
Anyone have a better and better solution, idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在模块级别
build.gradle
中,添加此实现项目(path: ':yourModule')
例如,
在您的 OceanSDK 模块中-->> build.gradle
实现项目(path: ':CoreSDK')
In Module level
build.gradle
, add thisimplementation project(path: ':yourModule')
For example,
in your OceanSDK Module-->> build.gradle
implementation project(path: ':CoreSDK')