简体   繁体   English

如何查看Gradle源集路径?

[英]How to view Gradle source set paths?

I am currently working on an Android project, which, for various legacy reasons, uses a non-standard Gradle layout. 我目前正在开发一个Android项目,由于各种遗留原因,它使用非标准的Gradle布局。 I'm trying to add a class which will have different implementations in different build flavors, but it's not being picked up by the compiler. 我正在尝试添加一个类,它将在不同的构建版本中具有不同的实现,但它不会被编译器拾取。 The project uses setRoot , so the paths are partially auto-generated, and I suspect they may be wrong. 该项目使用setRoot ,因此路径部分自动生成,我怀疑它们可能是错误的。

So my question is, how do I view the source set paths that Gradle is actually using? 所以我的问题是,如何查看Gradle实际使用的源集路径? This seems like it would be simple, but neither the built-in help nor several hours of Googling have yielded any answers. 这看起来很简单,但内置的帮助和几个小时的谷歌搜索都没有产生任何答案。

Android plugin adds the task sourceSets that prints out all the source sets defined in the project. Android插件添加了任务sourceSets ,用于打印出项目中定义的所有源集。

You can run this from the command line: 您可以从命令行运行此命令:

gradle sourceSets

Or expand Tasks->Android->sourceSets in the Gradle panel of Android Studio 或者在Android Studio的Gradle面板中展开Tasks->Android->sourceSets

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM