Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7442

Ant build steps with properties including variables are broken

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: ant-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.376 on Windows 2003 Server with Tomcat 6.
    • Similar Issues:
      Show 5 results

      Description

      If Ant build steps take properties with an %, the next char is enclosed in quotes in a 'fancy' way:
      $ cmd.exe /C '"C:\ant\apache-ant-1.7.1\bin\ant.bat "-Dhudsonhome=%"H"UDSON_HOME%" && exit %%ERRORLEVEL%%"'
      The property should be "-Dhudsonhome=%HUDSON_HOME%"

      This worked with Hudson 1.365

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: alanharder
            Path:
            core/src/main/java/hudson/tasks/Ant.java
            test/src/test/java/hudson/tasks/AntTest.java
            http://jenkins-ci.org/commit/ant-plugin/8971063149d1242188f25455a955cce4990e9eab
            Log:
            [FIXED JENKINS-7442] Fix expansion of EnvVars in ant properties.
            Ant build step had quite a mix: buildFile and antOpts expanded against
            env, properties against buildVariables, and targets against both.
            Now merging buildVariables into env and applying to all.

            Originally-Committed-As: 5f1fef602c6a5672df6edcc84c73c47ff70bb71b

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: alanharder Path: core/src/main/java/hudson/tasks/Ant.java test/src/test/java/hudson/tasks/AntTest.java http://jenkins-ci.org/commit/ant-plugin/8971063149d1242188f25455a955cce4990e9eab Log: [FIXED JENKINS-7442] Fix expansion of EnvVars in ant properties. Ant build step had quite a mix: buildFile and antOpts expanded against env, properties against buildVariables, and targets against both. Now merging buildVariables into env and applying to all. Originally-Committed-As: 5f1fef602c6a5672df6edcc84c73c47ff70bb71b
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: alanharder
            Path:
            test/src/test/java/hudson/tasks/AntTest.java
            war/src/main/webapp/help/ant/ant-properties.html
            http://jenkins-ci.org/commit/ant-plugin/f84ca39415be5312f9170de5a7ca4bf0278297fc
            Log:
            [FIXED JENKINS-7442] Change ArgumentListBuilder.toWindowsCommand() to not escape %VAR%
            type references by default (can now be done by passing "true" parameter).
            This restores ability to use %VAR% references for ant build steps on windows.

            Originally-Committed-As: 3bd3ff9b572391606300f1ecfcad3eb62792d32d

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: alanharder Path: test/src/test/java/hudson/tasks/AntTest.java war/src/main/webapp/help/ant/ant-properties.html http://jenkins-ci.org/commit/ant-plugin/f84ca39415be5312f9170de5a7ca4bf0278297fc Log: [FIXED JENKINS-7442] Change ArgumentListBuilder.toWindowsCommand() to not escape %VAR% type references by default (can now be done by passing "true" parameter). This restores ability to use %VAR% references for ant build steps on windows. Originally-Committed-As: 3bd3ff9b572391606300f1ecfcad3eb62792d32d
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: alanharder
            Path:
            test/src/test/java/hudson/tasks/AntTest.java
            war/src/main/webapp/help/ant/ant-properties.html
            http://jenkins-ci.org/commit/ant-plugin/e344ba82253b924a2ab3a321be265c400018946c
            Log:
            [FIXED JENKINS-7442] Change ArgumentListBuilder.toWindowsCommand() to not escape %VAR%
            type references by default (can now be done by passing "true" parameter).
            This restores ability to use %VAR% references for ant build steps on windows.

            Originally-Committed-As: c4590529f731ba30b5deb0961d73f76e35ab70ff

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: alanharder Path: test/src/test/java/hudson/tasks/AntTest.java war/src/main/webapp/help/ant/ant-properties.html http://jenkins-ci.org/commit/ant-plugin/e344ba82253b924a2ab3a321be265c400018946c Log: [FIXED JENKINS-7442] Change ArgumentListBuilder.toWindowsCommand() to not escape %VAR% type references by default (can now be done by passing "true" parameter). This restores ability to use %VAR% references for ant build steps on windows. Originally-Committed-As: c4590529f731ba30b5deb0961d73f76e35ab70ff
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: alanharder
            Path:
            changelog.html
            core/src/main/java/hudson/util/ArgumentListBuilder.java
            core/src/test/java/hudson/util/ArgumentListBuilderTest.java
            test/src/test/java/hudson/tasks/AntTest.java
            war/src/main/webapp/help/ant/ant-properties.html
            http://jenkins-ci.org/commit/jenkins/3bd3ff9b572391606300f1ecfcad3eb62792d32d
            Log:
            [FIXED JENKINS-7442] Change ArgumentListBuilder.toWindowsCommand() to not escape %VAR%
            type references by default (can now be done by passing "true" parameter).
            This restores ability to use %VAR% references for ant build steps on windows.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: alanharder Path: changelog.html core/src/main/java/hudson/util/ArgumentListBuilder.java core/src/test/java/hudson/util/ArgumentListBuilderTest.java test/src/test/java/hudson/tasks/AntTest.java war/src/main/webapp/help/ant/ant-properties.html http://jenkins-ci.org/commit/jenkins/3bd3ff9b572391606300f1ecfcad3eb62792d32d Log: [FIXED JENKINS-7442] Change ArgumentListBuilder.toWindowsCommand() to not escape %VAR% type references by default (can now be done by passing "true" parameter). This restores ability to use %VAR% references for ant build steps on windows.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: alanharder
            Path:
            changelog.html
            core/src/main/java/hudson/util/ArgumentListBuilder.java
            core/src/test/java/hudson/util/ArgumentListBuilderTest.java
            test/src/test/java/hudson/tasks/AntTest.java
            war/src/main/webapp/help/ant/ant-properties.html
            http://jenkins-ci.org/commit/jenkins/c4590529f731ba30b5deb0961d73f76e35ab70ff
            Log:
            [FIXED JENKINS-7442] Change ArgumentListBuilder.toWindowsCommand() to not escape %VAR%
            type references by default (can now be done by passing "true" parameter).
            This restores ability to use %VAR% references for ant build steps on windows.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: alanharder Path: changelog.html core/src/main/java/hudson/util/ArgumentListBuilder.java core/src/test/java/hudson/util/ArgumentListBuilderTest.java test/src/test/java/hudson/tasks/AntTest.java war/src/main/webapp/help/ant/ant-properties.html http://jenkins-ci.org/commit/jenkins/c4590529f731ba30b5deb0961d73f76e35ab70ff Log: [FIXED JENKINS-7442] Change ArgumentListBuilder.toWindowsCommand() to not escape %VAR% type references by default (can now be done by passing "true" parameter). This restores ability to use %VAR% references for ant build steps on windows.

              People

              • Assignee:
                mindless Alan Harder
                Reporter:
                skorsky skorsky
              • Votes:
                3 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: