Android Studio - 创建子模块

发布于 2025-01-16 18:32:17 字数 594 浏览 3 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

睫毛溺水了 2025-01-23 18:32:18

在模块级别 build.gradle 中,添加此

实现项目(path: ':yourModule')

例如,

在您的 OceanSDK 模块中-->> build.gradle

实现项目(path: ':CoreSDK')

In Module level build.gradle, add this

implementation project(path: ':yourModule')

For example,

in your OceanSDK Module-->> build.gradle

implementation project(path: ':CoreSDK')

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文