rebuilding gradlew

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

rebuilding gradlew

Adam Murdoch-2
Hi,

How do I rebuild gradlew? I've made some changes to the groovy plugin to
add a groovydoc task. However, I can't use this task in gradle's build
without rebuilding gradlew with my changes in it (or at least, I think
that's the case)


Adam


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: rebuilding gradlew

hans_d
Administrator

On Jul 31, 2008, at 12:09 PM, Adam Murdoch wrote:

> Hi,
>
> How do I rebuild gradlew? I've made some changes to the groovy  
> plugin to add a groovydoc task. However, I can't use this task in  
> gradle's build without rebuilding gradlew with my changes in it (or  
> at least, I think that's the case)

Why do you use gradlew and not gradle?

In my environent the bin directory of the gradle distribution  
installed by the 'gradle install' task is in my path. This way a  
'gradle install' updates the gradle distribution used on my system.

gradlew is part of the Gradle wrapper. See also UG chapter 16  
(although the logic has slightly changed in 0.3). gradlew,  
gradlew.exe and gradle-wrapper.jar is generated by executing 'gradle  
wrapper'. Those three generated files are then submitted to svn.

The wrapper task is configured in Gradle's build.gradle.

The purpose of the gradle wrapper and its scripts is to build  
projects with Gradle without having to install Gradle first (for  
example on CI servers). The gradlew script always runs against a  
certain version of Gradle. This version is specified in the  
configuration of the wrapper task and baked into the generated  
wrapper artifacts. The Gradle distribution with this version is  
either downloaded when executing gradlew the first time, or can be in  
svn (which is the way Gradle uses the Gradle wrapper. See the wrapper  
dir). After the wrapper distribution is available it is unpacked and  
gradlew simply delegates to the gradle command of this wrapper  
distribution.

Sometimes we have a hen-egg problem. This is when you change Gradle  
and/or its build.gradle script in a way, that the new Gradle can't be  
build with an older state of Gradle. In such a case I use my IDE to  
run the Gradle build and install a new distribution.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: rebuilding gradlew

hans_d
Administrator

On Jul 31, 2008, at 1:07 PM, Hans Dockter wrote:

>
> On Jul 31, 2008, at 12:09 PM, Adam Murdoch wrote:
>
>> Hi,
>>
>> How do I rebuild gradlew? I've made some changes to the groovy  
>> plugin to add a groovydoc task. However, I can't use this task in  
>> gradle's build without rebuilding gradlew with my changes in it  
>> (or at least, I think that's the case)
>
> Why do you use gradlew and not gradle?
>
> In my environent the bin directory of the gradle distribution  
> installed by the 'gradle install' task is in my path. This way a  
> 'gradle install' updates the gradle distribution used on my system.
>
> gradlew is part of the Gradle wrapper. See also UG chapter 16  
> (although the logic has slightly changed in 0.3). gradlew,  
> gradlew.exe and gradle-wrapper.jar is generated by executing  
> 'gradle wrapper'. Those three generated files are then submitted to  
> svn.
>
> The wrapper task is configured in Gradle's build.gradle.
>
> The purpose of the gradle wrapper and its scripts is to build  
> projects with Gradle without having to install Gradle first (for  
> example on CI servers). The gradlew script always runs against a  
> certain version of Gradle. This version is specified in the  
> configuration of the wrapper task and baked into the generated  
> wrapper artifacts. The Gradle distribution with this version is  
> either downloaded when executing gradlew the first time, or can be  
> in svn (which is the way Gradle uses the Gradle wrapper. See the  
> wrapper dir). After the wrapper distribution is available it is  
> unpacked and gradlew simply delegates to the gradle command of this  
> wrapper distribution.
>
> Sometimes we have a hen-egg problem. This is when you change Gradle  
> and/or its build.gradle script in a way, that the new Gradle can't  
> be build with an older state of Gradle. In such a case I use my IDE  
> to run the Gradle build and install a new distribution.

The gradle build is often early adopter of new features. In such a  
case we have to build a snapshot dist locally, rename the existing  
one with the new version. Overwrite the existing one with the new  
dist. Change the version number of the wrapper in the build script.  
Trigger the warpper task. Submit the new dist and the new wrapper  
artifacts to svn. That way any user can easily checkout Gradle and  
build it via gradlew.

Although this is always quite a bit of work, the fact that we build  
Gradle with Gradle is so valuable and of course fun that I happily  
accept some inconveniences due to hen-egg problems.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: rebuilding gradlew

hans_d
Administrator
In reply to this post by hans_d

On Jul 31, 2008, at 1:07 PM, Hans Dockter wrote:
>
> Sometimes we have a hen-egg problem. This is when you change Gradle  
> and/or its build.gradle script in a way, that the new Gradle can't  
> be build with an older state of Gradle. In such a case I use my IDE  
> to run the Gradle build and install a new distribution.

Here it is described how to build Gradle with Gradle from IntelliJ:  
http://docs.codehaus.org/display/GRADLE/How+to+run+the+Gradle+project 
+in+IntelliJ+against+any+Gradle+build

The screenshots are not up to date. I have not enough time to update  
them right now, but I have added a warning on how to do it for the  
current HEAD version of Gradle.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: rebuilding gradlew

Adam Murdoch-2
In reply to this post by hans_d


Hans Dockter wrote:

>
> On Jul 31, 2008, at 12:09 PM, Adam Murdoch wrote:
>
>> Hi,
>>
>> How do I rebuild gradlew? I've made some changes to the groovy plugin
>> to add a groovydoc task. However, I can't use this task in gradle's
>> build without rebuilding gradlew with my changes in it (or at least,
>> I think that's the case)
>
> Why do you use gradlew and not gradle?
>
Probably because I'm confused :) I'm still figuring out the best way to
develop for gradle.

I think I pretty much have the same setup that you describe.  The
problem is that I wanted to change build.gradle to use new stuff not
available in the gradle snapshot checked-in to subversion.  I had an
installed version with the changes in it, so the changes worked fine for
me.  However, as soon as I checked in gradle.build, no-one else would be
able to bootstrap from the source using gradlew.  So, I wanted to update
the gradle snapshot.

I think I've managed to do this ok now.  I've changed the 'wrapper' task
for gradle's build.gradle to copy the appropriate jar into place so that
it is easier to updated the gradle snapshot.


Adam

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email