获取项目属性列表

执行 gradle properties 可以获取项目所有属性列表. 如下例:

例 11.16. 属性信息

gradle -q api:properties 的输出结果

  1. > gradle -q api:properties
  2. ------------------------------------------------------------
  3. Project :api - The shared API for the application
  4. ------------------------------------------------------------
  5. allprojects: [project ':api']
  6. ant: org.gradle.api.internal.project.DefaultAntBuilder@12345
  7. antBuilderFactory: org.gradle.api.internal.project.DefaultAntBuilderFactory@12345
  8. artifacts: org.gradle.api.internal.artifacts.dsl.DefaultArtifactHandler@12345
  9. asDynamicObject: org.gradle.api.internal.ExtensibleDynamicObject@12345
  10. baseClassLoaderScope: org.gradle.api.internal.initialization.DefaultClassLoaderScope@12345
  11. buildDir: /home/user/gradle/samples/userguide/tutorial/projectReports/api/build
  12. buildFile: /home/user/gradle/samples/userguide/tutorial/projectReports/api/build.gradle