Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5468

Gradle parent / containment queries inconsistent

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      There are queries that power ProjectUtils.rootOf, parentOf and containedSubprojects. Their behaviour is largely inconsistent of the root project is not opened.

      • subproject B that resides in a direct child of root project A reports A as parent
      • but A does not report B as subproject, unless A opens and is trusted

      Project API in general requires that project services does not depend on the project being opened in the UI, so this is rather a bug. Given that gradle is virtually unable to statically determine project contents or hierarchy, it could be clarified in ParentProjectProvider etc Javadocs that the behaviour of unopened project may be reduced, i.e. parent known, but subprojects unknown, or something like that. Also it should be documented how to programmatically get the system 'into good shape' when the API user wants to inspect the hierarchy.

      Maybethe effect of trust and 'opennes' on queries could be discussed also with jtulach on dev mailing list.

      Other bug is that if I have

      • root project A
        • folder F
          • subproject C

      such as there's include :folder:C in settings.gradle, then even ProjectUtils.parentOf(c) returns null - again unless A is opened in the UI. This is most probably a bug, since at the same time ProjectUtils.rootOf(c) yields A.

       

      Attachments

        Activity

          People

            lkishalmi Laszlo Kishalmi
            sdedic Svatopluk Dedic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: