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

Cannot specify location of gradle wrapper

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When using the gradle plugin for builds, it's possible to select the gradle wrapper instead of the gradle application. However, using the gradle wrapper, it's not possible to specify the location of the gradle wrapper script.

        Attachments

          Activity

          Hide
          mrctrevisan Marco Trevisan added a comment -

          Another way to reproduce:

          • you have a set of gradle projects (one of them is the "master" project and the remaining ones are subprojects) each of them is in an appropriate subdirectory of the workspace, each having its own build.gradle file.
          • you need to invoke gradlew in the master project, so you specify "Root build script" = "${workspace}/master", or simply "master".
          • The plugin still tries to execute gradlew from the workspace root, seems to ignore the "Root build script setting".

          Cheers,

          Marco

          Show
          mrctrevisan Marco Trevisan added a comment - Another way to reproduce: you have a set of gradle projects (one of them is the "master" project and the remaining ones are subprojects) each of them is in an appropriate subdirectory of the workspace, each having its own build.gradle file. you need to invoke gradlew in the master project, so you specify "Root build script" = "${workspace}/master", or simply "master". The plugin still tries to execute gradlew from the workspace root, seems to ignore the "Root build script setting". Cheers, Marco
          Hide
          merscwog merscwog added a comment -

          This is a current blocker for attempting to utilize this gradle plugin and the gradle wrapper together for several valid use cases. There were two highly generalized solutions that are in pull requests from about 3 months ago (there might be some reason why they were not incorporated, as I've not tested either). I submitted a limited solution just over a week ago as a pull request that simply allows gradlew to selectively be found in the same directory as the root build file or workspace top, which required very minor modifications to the existing code base.

          Show
          merscwog merscwog added a comment - This is a current blocker for attempting to utilize this gradle plugin and the gradle wrapper together for several valid use cases. There were two highly generalized solutions that are in pull requests from about 3 months ago (there might be some reason why they were not incorporated, as I've not tested either). I submitted a limited solution just over a week ago as a pull request that simply allows gradlew to selectively be found in the same directory as the root build file or workspace top, which required very minor modifications to the existing code base.
          Hide
          davidparsson David Pärsson added a comment - - edited

          What if the gradlew file does not reside in the root build script project? We're in the situation where we have a multi-project Gradle build, but we don't always want to build from the master directory (where gradlew resides).

          I'd like the ability to supply a relative path to gradlew, or a relative folder where gradlew resides. That path should ideally be relative to the workspace root.

          Show
          davidparsson David Pärsson added a comment - - edited What if the gradlew file does not reside in the root build script project? We're in the situation where we have a multi-project Gradle build, but we don't always want to build from the master directory (where gradlew resides). I'd like the ability to supply a relative path to gradlew, or a relative folder where gradlew resides. That path should ideally be relative to the workspace root.
          Hide
          davidparsson David Pärsson added a comment -

          I found how to solve my issue with the existing functionality. Make master the root build script project, and execute mySubProject:myTask. Almost too simple!

          Show
          davidparsson David Pärsson added a comment - I found how to solve my issue with the existing functionality. Make master the root build script project, and execute mySubProject:myTask. Almost too simple!
          Hide
          schristou Steven Christou added a comment -

          Gregory Boissinot do you know which commit this was part of which resolved this issue?

          Show
          schristou Steven Christou added a comment - Gregory Boissinot do you know which commit this was part of which resolved this issue?
          Hide
          schristou Steven Christou added a comment -

          Gregory Boissinot Sorry, I just found it: PR 13

          Show
          schristou Steven Christou added a comment - Gregory Boissinot Sorry, I just found it: PR 13
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Justin Ryan
          Path:
          src/main/java/hudson/plugins/gradle/Gradle.java
          src/main/resources/hudson/plugins/gradle/Gradle/config.jelly
          src/main/resources/hudson/plugins/gradle/Gradle/help-wrapperScript.html
          http://jenkins-ci.org/commit/gradle-plugin/ffddd0b33e7c820b16d97b5e60a330fe81917556
          Log:
          JENKINS-12769 Provide location of gradlew script, which required moving code into
          radioBlocks which dont have inline, so I had to move to a POJO to store
          them. Uses macro replacement on wrapper location.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Justin Ryan Path: src/main/java/hudson/plugins/gradle/Gradle.java src/main/resources/hudson/plugins/gradle/Gradle/config.jelly src/main/resources/hudson/plugins/gradle/Gradle/help-wrapperScript.html http://jenkins-ci.org/commit/gradle-plugin/ffddd0b33e7c820b16d97b5e60a330fe81917556 Log: JENKINS-12769 Provide location of gradlew script, which required moving code into radioBlocks which dont have inline, so I had to move to a POJO to store them. Uses macro replacement on wrapper location.

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              cjyar cjyar
            • Votes:
              15 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: