Cargo
  1. Cargo
  2. CARGO-479

Improve DefaultAntTaskFactory so that it can create Ant tasks for tasks requiring a valid Ant Target object

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8
    • Fix Version/s: 0.9
    • Component/s: Core
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      1

      Description

      From the mailing list:

      my name is Petar Tahchiev, and I have been working with the cactus-ant-tasks integration with Cargo lately. The problem is that I want to use cargo's DefaultAntTaskFactory
      but it has only one constructor that accepts ant's Project object. In that constructor you set the project instance variable, and all of the instance variables get initialized with some default values. Specifically you instantiate new Target(); The probblem comes when one tries to use the DefaultAntTaskFactory to create "antcall" task, because in the ant API the target's name is tested to see if the <antcall> task is executed within some target. So since you create the target via new Target(), the name of the target is never initialised and stays null, forever. Thus a null-pointer exception is thrown.

      In the RunServerTests cactus task, we use only antcalls. In the cactus API (Vincent surely knows what I am so desparately trying to explain ) we also have a DefaultAntTaskFactory. So my idea is to replace ours with the one you gyus provide.

      To summon up my wish is to look at the patch I supply with this email and tell me: is it possible to add another constructor to the DefaultAntTaskFactory with the following syntacsis:
      public DefaultAntTaskFactory(Project theProject,
      String theCurrentTaskName, Location theCurrentLocation,
      Target theCurrentTarget)

        Activity

        Hide
        Vincent Massol added a comment -

        Applied (with minor modifications). Thanks!

        Show
        Vincent Massol added a comment - Applied (with minor modifications). Thanks!

          People

          • Assignee:
            Vincent Massol
            Reporter:
            Petar Tahchiev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: