• Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • gradle-plugin
    • None

      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.

          [JENKINS-12769] Cannot specify location of gradle wrapper

          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

          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

          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.

          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.

          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.

          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.

          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!

          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!

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

          Steven Christou added a comment - gbois do you know which commit this was part of which resolved this issue?

          gbois Sorry, I just found it: PR 13

          Steven Christou added a comment - gbois Sorry, I just found it: PR 13

          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.

          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.

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

              Created:
              Updated:
              Resolved: