You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Mitch Gitman (JIRA)" <ji...@apache.org> on 2008/11/25 18:55:44 UTC

[jira] Created: (IVY-978) buildnumber Ant task ignoring prefix attribute

buildnumber Ant task ignoring prefix attribute
----------------------------------------------

                 Key: IVY-978
                 URL: https://issues.apache.org/jira/browse/IVY-978
             Project: Ivy
          Issue Type: Bug
          Components: Ant
    Affects Versions: 2.0-RC2
         Environment: JDK 1.6.0_07 on Windows Vista
            Reporter: Mitch Gitman


I'm setting the prefix attribute on the buildnumber Ant task:
    <ivy:buildnumber organisation="${ivy.organisation}"
      module="${ivy.module}"
      default="${ivy.default.revision}" prefix="repo" />

But when I go to manually output the properties that are set, I see:
ivy-buildnumber:
     [echo] ivy:buildnumber output:
     [echo] ivy.revision=1.1
     [echo] repo.revision=${repo.revision}

You see that the default ivy.revision property gets set; the repo.revision property does not.

Here's what the buildnumber documentation has to say about the prefix attribute:
"the prefix to use for the property names set (will be prefix.revision, prefix.new.revision, ...)"

Addendum: There's another, possibly related issue with the buildnumber task. My understanding is that the ivy.revision property is supposed to behave as a variable. As long as the user hasn't manually set it at any point, an Ant task can set it to one value, and then another Ant task can come along and set it to another value.

I've run into a situation where I might run a task like ivy:info and then subsequently run ivy:buildnumber. According to info, which reads the ivy.xml, the revision is, say 1.1.200. According to buildnumber, which scans the repository, the revision SHOULD BE working@machinename. (Set aside the fact that the ivy.xml and repository are themselves inconsistent; I'm trying to catch and deal with the situation where they are.) The buildnumber invocation shows revision as 1.1.200 rather than working@machinename. In other words, it fails to find the main thing it's supposed to be finding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-978) buildnumber Ant task ignoring prefix attribute

Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650741#action_12650741 ] 

Maarten Coene commented on IVY-978:
-----------------------------------

I couldn't reproduce your problem, for instance I have the following:

{noformat}
<ivy:buildnumber organisation="org.apache.ivy" module="ivy" default="2.0" prefix="repo" />
<echo>${repo.revision}</echo>
<echo>${repo.new.revision}</echo>
{noformat}

Which results in the following output:

{noformat}
     [echo] 2.0.0-rc2
     [echo] 2.0.0-rc3
{noformat}

The only explenation I can see is that the buildnumber task doesn't find a revision for your module, but that doesn't explain why the ivy.revision property is set.

Could you run ant in debug mode and post the output of the buildnumber task here?

> buildnumber Ant task ignoring prefix attribute
> ----------------------------------------------
>
>                 Key: IVY-978
>                 URL: https://issues.apache.org/jira/browse/IVY-978
>             Project: Ivy
>          Issue Type: Bug
>          Components: Ant
>    Affects Versions: 2.0-RC2
>         Environment: JDK 1.6.0_07 on Windows Vista
>            Reporter: Mitch Gitman
>
> I'm setting the prefix attribute on the buildnumber Ant task:
>     <ivy:buildnumber organisation="${ivy.organisation}"
>       module="${ivy.module}"
>       default="${ivy.default.revision}" prefix="repo" />
> But when I go to manually output the properties that are set, I see:
> ivy-buildnumber:
>      [echo] ivy:buildnumber output:
>      [echo] ivy.revision=1.1
>      [echo] repo.revision=${repo.revision}
> You see that the default ivy.revision property gets set; the repo.revision property does not.
> Here's what the buildnumber documentation has to say about the prefix attribute:
> "the prefix to use for the property names set (will be prefix.revision, prefix.new.revision, ...)"
> Addendum: There's another, possibly related issue with the buildnumber task. My understanding is that the ivy.revision property is supposed to behave as a variable. As long as the user hasn't manually set it at any point, an Ant task can set it to one value, and then another Ant task can come along and set it to another value.
> I've run into a situation where I might run a task like ivy:info and then subsequently run ivy:buildnumber. According to info, which reads the ivy.xml, the revision is, say 1.1.200. According to buildnumber, which scans the repository, the revision SHOULD BE working@machinename. (Set aside the fact that the ivy.xml and repository are themselves inconsistent; I'm trying to catch and deal with the situation where they are.) The buildnumber invocation shows revision as 1.1.200 rather than working@machinename. In other words, it fails to find the main thing it's supposed to be finding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.