Buildr
  1. Buildr
  2. BUILDR-84

IDE Meta Generation Should Not Require Sources

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.2
    • Fix Version/s: Wish List
    • Component/s: IDE
    • Labels:
      None
    • Environment:
      eclipse

      Description

      The `eclipse` task (and I assume `idea` as well) requires at least one source file of the relevant type to be found within a source directory. For example, for project meta generation to succeed, the src/main/java/ directory (and/or subdirectories) must contain at least one .java file. The same holds for scala. If these source files are not specified, the task silently fails and just doesn't generate any project meta.

      It seems to me that this would be a fairly common use-case: using Buildr to setup a project prior to creating any sources and then doing the actual coding within an IDE. I would propose that the source autodetection be fixed to just assume that there will be source files within the relevant source dirs if they exist. At the very least, a warning should be printed regarding the absence of sources and that this prevents IDE meta gen.

      There are no Sub-Tasks for this issue.

        Activity

        Hide
        Antoine Toulme added a comment -

        Note that the eclipse task got a overhaul since and now has a good configuration. It is possible to set the natures and builders (even their order) for each project.

        AFAIK, the eclipse task still relies on the compile.language to find whether the java nature is needed.

        Show
        Antoine Toulme added a comment - Note that the eclipse task got a overhaul since and now has a good configuration. It is possible to set the natures and builders (even their order) for each project. AFAIK, the eclipse task still relies on the compile.language to find whether the java nature is needed.
        Hide
        lacton added a comment -

        Sean,

        I created BUILDR-171 for the issue you raised.

        Show
        lacton added a comment - Sean, I created BUILDR-171 for the issue you raised.
        Hide
        Sean Ahn added a comment -

        I have a project that does not have src/main/java folder. Instead, it has src/test/java and unit tests written in java under that subdirectory. The eclipse task does not generate project meta for this project. I'm not sure if it's related to this issue.

        Show
        Sean Ahn added a comment - I have a project that does not have src/main/java folder. Instead, it has src/test/java and unit tests written in java under that subdirectory. The eclipse task does not generate project meta for this project. I'm not sure if it's related to this issue.
        Hide
        Assaf Arkin added a comment -

        If it doesn't break anything else, I don't see reason we can't change the compile task to look for source directories instead of source files.

        Show
        Assaf Arkin added a comment - If it doesn't break anything else, I don't see reason we can't change the compile task to look for source directories instead of source files.
        Hide
        Alex Boisvert added a comment -

        Ok, got it. No objections on my part.

        Show
        Alex Boisvert added a comment - Ok, got it. No objections on my part.
        Hide
        Daniel Spiewak added a comment -

        You should look for the source directories themselves. Project Layouts define where each language's source files should go. Assuming the hierarchies are disjoint (as is the default) it should be possible to just look for the relevant directory and assume that the corresponding language will be required. For example, if src/main/java/ is present (empty or otherwise), it may be assumed in the default layout that the :javac compiler will be required; thus, Java project metadata should be generated.

        Show
        Daniel Spiewak added a comment - You should look for the source directories themselves. Project Layouts define where each language's source files should go. Assuming the hierarchies are disjoint (as is the default) it should be possible to just look for the relevant directory and assume that the corresponding language will be required. For example, if src/main/java/ is present (empty or otherwise), it may be assumed in the default layout that the :javac compiler will be required; thus, Java project metadata should be generated.
        Hide
        Alex Boisvert added a comment -

        You don't need any source, you can specify which languages you want to use by stating,

        compile.using :javac
        or
        compile.using :scalac

        and similarly for tests,

        test.compile.using :javac
        or
        test.compile.using :scalac

        If there are no sources or no indications in the Buildfile, what should we assume?

        Show
        Alex Boisvert added a comment - You don't need any source, you can specify which languages you want to use by stating, compile.using :javac or compile.using :scalac and similarly for tests, test.compile.using :javac or test.compile.using :scalac If there are no sources or no indications in the Buildfile, what should we assume?

          People

          • Assignee:
            Unassigned
            Reporter:
            Daniel Spiewak
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development