Topic
3 replies Latest Post - ‏2009-04-16T20:27:48Z by SystemAdmin
SystemAdmin
SystemAdmin
123 Posts
ACCEPTED ANSWER

Pinned topic vce.createProviders Ant task does not respect basedir attribute

‏2009-04-16T12:22:01Z |
I encountered a small problem with the vce.createProviders Ant task. My Ant script specifies ".." in the basedir attribute of the project tag. But vce.createProviders uses the VCE Headless Automation Runtime install directory as the base directory. It's easy enough to work around. But the other VCE tags seem to respect the basedir attribute. It's something we should check on.
Updated on 2009-04-16T20:27:48Z at 2009-04-16T20:27:48Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    123 Posts
    ACCEPTED ANSWER

    Re: vce.createProviders Ant task does not respect basedir attribute

    ‏2009-04-16T13:09:15Z  in response to SystemAdmin
    Actually, by setting the location of the VCE configuration files with a <property> task using the location attribute, Ant converts the property to an absolute path which works fine inside the vce.createProviders task.
    • bdelima
      bdelima
      124 Posts
      ACCEPTED ANSWER

      Re: vce.createProviders Ant task does not respect basedir attribute

      ‏2009-04-16T13:55:51Z  in response to SystemAdmin
      None of the VCE ant tasks do anything specific with the basedir project attribute. Another way of saying this is that the VCE ant tasks rely on ANT correctly setting the current working directory before calling a task. I will say that I've seen some odd behavior in the way ANT deals with this. Using absolute paths generally avoid these types of issues altogether.

      Regardless, I'm glad you got it working. It might be helpful to the forum community if you posted some snippets to illustrate the behavior you were seeing.

      Thanks,
      Bob
  • SystemAdmin
    SystemAdmin
    123 Posts
    ACCEPTED ANSWER

    Re: vce.createProviders Ant task does not respect basedir attribute

    ‏2009-04-16T20:27:48Z  in response to SystemAdmin
    That's a good idea. The basedir attribute of an Ant <project> tag determines the base directory for relative locations specified elsewhere in the Ant script. So
    
    <project name=
    "abc" basedir=
    "C:/tmp"> <property name=
    "dir1" location=
    "myDir"/> <property name=
    "dir2" location=
    "/myDir"/> ...
    


    will result in dir1 = "C:/tmp/myDir" and dir2="C:/myDir". It's also fine to set basedir to a relative location. This is commonly set to ".." which is the parent directory.

    For using the vce.createProviders, it's best to define the provider location using the location attribute of the property tag.

    
    <project name=
    "abc" basedir=
    ".."> ... <property name=
    "config.loc" location=
    "vceConfigurations/09-04-16"/> ... <vce.createProviders workspace=
    "myWksp" location=
    "${config.loc}/myCell.configuration" aliasPrefix=
    "My Cell"/> ...
    


    The config.loc property will resolve relative to our Ant basedir directory. In this example, "vceConfigurations" is assumed to be a sibling directory of the one in which the Ant script is running.