Quantcast

naming conventions

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

naming conventions

Philip Crotwell
It is probably too late in the game for these types of questions, but
here goes anyway. :)

Gradle is working out really well for me, but I have one small gripe.
I use bash autocomplete a lot. I also do a lot of "cd build" or "vi
build.gradle" or "vi buildSrc/xyz". The gripe is that all of these
start with "build" and so the autocompletion beeps for each of them. I
presume the build and build.gradle names are to be similar to ant,
maven uses pom.xml and target. I am not sure I have any better
suggestions for them, maybe "build" could be "gradleOut" or
"output.gradle" ? To be really old school and borrow from make,
"build.gradle" could be "gradlefile". :)

I assume that buildSrc is treated differently than src because it is
more like a subproject than a regular source directory, but I wonder
if buildSrc could be renamed to src/build? That would have the
advantage of keeping all source files in one directory.

I know all these are configurable, but I really think there is great
advantage to sticking to the convention for these types of things.
Probably bash could be configured to know the difference as well,
haven't had time to try that.

As I said, it is probably too late and this is probably not a
sufficient reason to rethink the file/directory naming convention, so
just tossing this out.

thanks,
Philip

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: naming conventions

Adam Murdoch-2


On 10/12/09 4:06 AM, Philip Crotwell wrote:

> It is probably too late in the game for these types of questions, but
> here goes anyway. :)
>
> Gradle is working out really well for me, but I have one small gripe.
> I use bash autocomplete a lot. I also do a lot of "cd build" or "vi
> build.gradle" or "vi buildSrc/xyz". The gripe is that all of these
> start with "build" and so the autocompletion beeps for each of them. I
> presume the build and build.gradle names are to be similar to ant,
> maven uses pom.xml and target. I am not sure I have any better
> suggestions for them, maybe "build" could be "gradleOut" or
> "output.gradle" ? To be really old school and borrow from make,
> "build.gradle" could be "gradlefile". :)
>
>    

I really don't like the fact that every build file is called
'build.gradle', for the same reason. Along similar lines, it makes it
difficult to find a build file in the IDE, because they all have the
same name.

The name of the build file is also a valuable source of configuration
information that we're not making use of.

We talked a while ago about letting you call your build script whatever
you like. The gradle command would simply look for any file that ends
with .gradle, rather than a file called build.gradle. We would also use
the name of the build file as the (default) name for the project, rather
than using the name of the directory containing the build script. I was
planning on looking at this for the Gradle 0.10 release.

> I assume that buildSrc is treated differently than src because it is
> more like a subproject than a regular source directory, but I wonder
> if buildSrc could be renamed to src/build? That would have the
> advantage of keeping all source files in one directory.
>    

I think this is a better place for it.

> I know all these are configurable, but I really think there is great
> advantage to sticking to the convention for these types of things.
> Probably bash could be configured to know the difference as well,
> haven't had time to try that.
>
> As I said, it is probably too late

I don't think it's too late. We want to get this stuff right for Gradle
1.0, so now is the time to change it if it needs changing. I think in
both cases we can introduce these changes in a controlled way, where we
keep and deprecate the old behaviour, and remove it a few releases later.


--
Adam Murdoch
Gradle Developer
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
|  
Report Content as Inappropriate

Re: naming conventions

Philip Crotwell
What about <project name>.gradle for the build.gradle file?

Another crazy idea I had was making the "build.gradle" executable. It
is a groovy script after all. So instead of running gradle and having
it find the build script, you would run the build.gradle directly. Not
sure if I really like this idea, so just a thought.

I put in a couple of jiras in for this.
http://jira.codehaus.org/browse/GRADLE-776
http://jira.codehaus.org/browse/GRADLE-777

thanks
Philip

On Wed, Dec 9, 2009 at 11:23 PM, Adam Murdoch <[hidden email]> wrote:

>
>
> On 10/12/09 4:06 AM, Philip Crotwell wrote:
>>
>> It is probably too late in the game for these types of questions, but
>> here goes anyway. :)
>>
>> Gradle is working out really well for me, but I have one small gripe.
>> I use bash autocomplete a lot. I also do a lot of "cd build" or "vi
>> build.gradle" or "vi buildSrc/xyz". The gripe is that all of these
>> start with "build" and so the autocompletion beeps for each of them. I
>> presume the build and build.gradle names are to be similar to ant,
>> maven uses pom.xml and target. I am not sure I have any better
>> suggestions for them, maybe "build" could be "gradleOut" or
>> "output.gradle" ? To be really old school and borrow from make,
>> "build.gradle" could be "gradlefile". :)
>>
>>
>
> I really don't like the fact that every build file is called 'build.gradle',
> for the same reason. Along similar lines, it makes it difficult to find a
> build file in the IDE, because they all have the same name.
>
> The name of the build file is also a valuable source of configuration
> information that we're not making use of.
>
> We talked a while ago about letting you call your build script whatever you
> like. The gradle command would simply look for any file that ends with
> .gradle, rather than a file called build.gradle. We would also use the name
> of the build file as the (default) name for the project, rather than using
> the name of the directory containing the build script. I was planning on
> looking at this for the Gradle 0.10 release.
>
>> I assume that buildSrc is treated differently than src because it is
>> more like a subproject than a regular source directory, but I wonder
>> if buildSrc could be renamed to src/build? That would have the
>> advantage of keeping all source files in one directory.
>>
>
> I think this is a better place for it.
>
>> I know all these are configurable, but I really think there is great
>> advantage to sticking to the convention for these types of things.
>> Probably bash could be configured to know the difference as well,
>> haven't had time to try that.
>>
>> As I said, it is probably too late
>
> I don't think it's too late. We want to get this stuff right for Gradle 1.0,
> so now is the time to change it if it needs changing. I think in both cases
> we can introduce these changes in a controlled way, where we keep and
> deprecate the old behaviour, and remove it a few releases later.
>
>
> --
> Adam Murdoch
> Gradle Developer
> http://www.gradle.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: naming conventions

Adam Murdoch-2


On 10/12/09 11:41 PM, Philip Crotwell wrote:
> What about<project name>.gradle for the build.gradle file?
>
>    

That's exactly the plan.

> Another crazy idea I had was making the "build.gradle" executable. It
> is a groovy script after all. So instead of running gradle and having
> it find the build script, you would run the build.gradle directly. Not
> sure if I really like this idea, so just a thought.
>    

It's an interesting idea. So that ./mybuild.gradle <some-args> is
basically the same as gradle -b ./mybuild.gradle <some-args>

> I put in a couple of jiras in for this.
> http://jira.codehaus.org/browse/GRADLE-776
> http://jira.codehaus.org/browse/GRADLE-777
>
>    

Thanks.

> thanks
> Philip
>
> On Wed, Dec 9, 2009 at 11:23 PM, Adam Murdoch<[hidden email]>  wrote:
>    
>>
>> On 10/12/09 4:06 AM, Philip Crotwell wrote:
>>      
>>> It is probably too late in the game for these types of questions, but
>>> here goes anyway. :)
>>>
>>> Gradle is working out really well for me, but I have one small gripe.
>>> I use bash autocomplete a lot. I also do a lot of "cd build" or "vi
>>> build.gradle" or "vi buildSrc/xyz". The gripe is that all of these
>>> start with "build" and so the autocompletion beeps for each of them. I
>>> presume the build and build.gradle names are to be similar to ant,
>>> maven uses pom.xml and target. I am not sure I have any better
>>> suggestions for them, maybe "build" could be "gradleOut" or
>>> "output.gradle" ? To be really old school and borrow from make,
>>> "build.gradle" could be "gradlefile". :)
>>>
>>>
>>>        
>> I really don't like the fact that every build file is called 'build.gradle',
>> for the same reason. Along similar lines, it makes it difficult to find a
>> build file in the IDE, because they all have the same name.
>>
>> The name of the build file is also a valuable source of configuration
>> information that we're not making use of.
>>
>> We talked a while ago about letting you call your build script whatever you
>> like. The gradle command would simply look for any file that ends with
>> .gradle, rather than a file called build.gradle. We would also use the name
>> of the build file as the (default) name for the project, rather than using
>> the name of the directory containing the build script. I was planning on
>> looking at this for the Gradle 0.10 release.
>>
>>      
>>> I assume that buildSrc is treated differently than src because it is
>>> more like a subproject than a regular source directory, but I wonder
>>> if buildSrc could be renamed to src/build? That would have the
>>> advantage of keeping all source files in one directory.
>>>
>>>        
>> I think this is a better place for it.
>>
>>      
>>> I know all these are configurable, but I really think there is great
>>> advantage to sticking to the convention for these types of things.
>>> Probably bash could be configured to know the difference as well,
>>> haven't had time to try that.
>>>
>>> As I said, it is probably too late
>>>        
>> I don't think it's too late. We want to get this stuff right for Gradle 1.0,
>> so now is the time to change it if it needs changing. I think in both cases
>> we can introduce these changes in a controlled way, where we keep and
>> deprecate the old behaviour, and remove it a few releases later.
>>
>>
>> --
>> Adam Murdoch
>> Gradle Developer
>> http://www.gradle.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>      http://xircles.codehaus.org/manage_email
>
>
>    

--
Adam Murdoch
Gradle Developer
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
|  
Report Content as Inappropriate

Re: naming conventions

Tomek Kaczanowski-3
In reply to this post by Adam Murdoch-2
>> ... but I wonder
>> if buildSrc could be renamed to src/build? That would have the
>> advantage of keeping all source files in one directory.
> I think this is a better place for it.
1++

--
Tomek

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: naming conventions

hans_d
Administrator
In reply to this post by Adam Murdoch-2


On Thu, Dec 10, 2009 at 5:23 AM, Adam Murdoch <[hidden email]> wrote:


On 10/12/09 4:06 AM, Philip Crotwell wrote:
It is probably too late in the game for these types of questions, but
here goes anyway. :)

Gradle is working out really well for me, but I have one small gripe.
I use bash autocomplete a lot. I also do a lot of "cd build" or "vi
build.gradle" or "vi buildSrc/xyz". The gripe is that all of these
start with "build" and so the autocompletion beeps for each of them. I
presume the build and build.gradle names are to be similar to ant,
maven uses pom.xml and target. I am not sure I have any better
suggestions for them, maybe "build" could be "gradleOut" or
"output.gradle" ? To be really old school and borrow from make,
"build.gradle" could be "gradlefile". :)

It was called gradlefile in the very old days (before 0.2). Here is the thread were we decided to rename things: http://markmail.org/thread/7i3db3twrd7cy56d

One argument against gradlefile was that it has no extensions and that particuarly under windows it is harder to associate applications with it.
 

 

I really don't like the fact that every build file is called 'build.gradle', for the same reason. Along similar lines, it makes it difficult to find a build file in the IDE, because they all have the same name.

There are already a couple of builds that change the name of the subprojects build.gradle files in the settings.gradle (e.g. the Gradle build). What is inconvenient now is that partial builds are more awkward to trigger from the command line (you need to use the -b option).
 

The name of the build file is also a valuable source of configuration information that we're not making use of.

We talked a while ago about letting you call your build script whatever you like. The gradle command would simply look for any file that ends with .gradle, rather than a file called build.gradle. We would also use the name of the build file as the (default) name for the project, rather than using the name of the directory containing the build script. I was planning on looking at this for the Gradle 0.10 release.


I assume that buildSrc is treated differently than src because it is
more like a subproject than a regular source directory, but I wonder
if buildSrc could be renamed to src/build? That would have the
advantage of keeping all source files in one directory.
 

I think this is a better place for it.

I did think about that option. The reason why I preferred buildSrc was to distinguish it from the input src that will be part of the build artifacts. But I don't feel strong about this.

- Hans
 


I know all these are configurable, but I really think there is great
advantage to sticking to the convention for these types of things.
Probably bash could be configured to know the difference as well,
haven't had time to try that.

As I said, it is probably too late

I don't think it's too late. We want to get this stuff right for Gradle 1.0, so now is the time to change it if it needs changing. I think in both cases we can introduce these changes in a controlled way, where we keep and deprecate the old behaviour, and remove it a few releases later.


--
Adam Murdoch
Gradle Developer
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
|  
Report Content as Inappropriate

Re: naming conventions

hans_d
Administrator
In reply to this post by Philip Crotwell


On Thu, Dec 10, 2009 at 1:41 PM, Philip Crotwell <[hidden email]> wrote:
What about <project name>.gradle for the build.gradle file?

Another crazy idea I had was making the "build.gradle" executable. It
is a groovy script after all. So instead of running gradle and having
it find the build script, you would run the build.gradle directly. Not
sure if I really like this idea, so just a thought.

I really like this idea.

- Hans

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

I put in a couple of jiras in for this.
http://jira.codehaus.org/browse/GRADLE-776
http://jira.codehaus.org/browse/GRADLE-777

thanks
Philip

On Wed, Dec 9, 2009 at 11:23 PM, Adam Murdoch <[hidden email]> wrote:
>
>
> On 10/12/09 4:06 AM, Philip Crotwell wrote:
>>
>> It is probably too late in the game for these types of questions, but
>> here goes anyway. :)
>>
>> Gradle is working out really well for me, but I have one small gripe.
>> I use bash autocomplete a lot. I also do a lot of "cd build" or "vi
>> build.gradle" or "vi buildSrc/xyz". The gripe is that all of these
>> start with "build" and so the autocompletion beeps for each of them. I
>> presume the build and build.gradle names are to be similar to ant,
>> maven uses pom.xml and target. I am not sure I have any better
>> suggestions for them, maybe "build" could be "gradleOut" or
>> "output.gradle" ? To be really old school and borrow from make,
>> "build.gradle" could be "gradlefile". :)
>>
>>
>
> I really don't like the fact that every build file is called 'build.gradle',
> for the same reason. Along similar lines, it makes it difficult to find a
> build file in the IDE, because they all have the same name.
>
> The name of the build file is also a valuable source of configuration
> information that we're not making use of.
>
> We talked a while ago about letting you call your build script whatever you
> like. The gradle command would simply look for any file that ends with
> .gradle, rather than a file called build.gradle. We would also use the name
> of the build file as the (default) name for the project, rather than using
> the name of the directory containing the build script. I was planning on
> looking at this for the Gradle 0.10 release.
>
>> I assume that buildSrc is treated differently than src because it is
>> more like a subproject than a regular source directory, but I wonder
>> if buildSrc could be renamed to src/build? That would have the
>> advantage of keeping all source files in one directory.
>>
>
> I think this is a better place for it.
>
>> I know all these are configurable, but I really think there is great
>> advantage to sticking to the convention for these types of things.
>> Probably bash could be configured to know the difference as well,
>> haven't had time to try that.
>>
>> As I said, it is probably too late
>
> I don't think it's too late. We want to get this stuff right for Gradle 1.0,
> so now is the time to change it if it needs changing. I think in both cases
> we can introduce these changes in a controlled way, where we keep and
> deprecate the old behaviour, and remove it a few releases later.
>
>
> --
> Adam Murdoch
> Gradle Developer
> http://www.gradle.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>

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

   http://xircles.codehaus.org/manage_email



Loading...