Uploaded image for project: 'Buildr (Retired)'
  1. Buildr (Retired)
  2. BUILDR-116

TestTask should include the main compile target in its dependencies, even when using non standard directories

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.3.3
    • Test frameworks
    • None
    • Trunk revision 680924

    Description

      TestTask should include the main compile target in its dependencies, even when using non standard directories (e.g., 'src/java' instead of 'src/main/java').

      For instance, I have a project with java sources in 'src/java' and its junit tests in 'src/test'. The buildfile is roughly like this:
      <code>
      define 'my-project' do
      compile _('src/java')
      test.compile _('src/test')
      end
      </code>

      'buildr clean test' fails on test compilation because the main compile target (i.e., 'target/classes') is not in the TestTask's dependencies. The problem is that
      1. the main CompileTask tries to set its target directory during the 'before_define' phase, which is too early because it is before the "compile _('src/java')" line.
      2. the TestTask does not add the main compile target during the 'after_define' phase, because the main CompileTask still has no target at that time.

      Attachments

        1. BUILDR-116.spec.patch
          0.8 kB
          Antoine Contal
        2. BUILDR-116.spec.patch2
          0.7 kB
          Antoine Contal
        3. BUILDR-116.lib.patch
          1 kB
          Antoine Contal

        Activity

          People

            Unassigned Unassigned
            lacton Antoine Contal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: