You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Owen Thomas <ow...@gmail.com> on 2022/08/06 00:26:09 UTC

Should I exclude ./gradle/nb-cache from commit?

I have my projects running. All is good in the world.

I see the directory indicated in the title of this message sometimes
contains files for projects with old names (I converted my project names
from camel to kebab case when this was indicated to me as the standard in
gradle/maven, so I did as I was told).

Is it important to keep nb-cache under version control in Git? Are there
any other NetBeans or Gradle directories that can be ignored? Do I ignore
them or do I exclude them from the commit?

Thanks,

  Owen.

Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Andreas Reichel <an...@manticore-projects.com>.
Owen,

not sure what best practise is, but I exclude ALL gradle folder and
files except the Build (build.gradle) file, From that, gradle can
always sort out itself and nothing else is needed.

Cheers
Andreas


On Sat, 2022-08-06 at 10:26 +1000, Owen Thomas wrote:
> I have my projects running. All is good in the world.
> 
> I see the directory indicated in the title of this message sometimes
> contains files for projects with old names (I converted my project
> names from camel to kebab case when this was indicated to me as the
> standard in gradle/maven, so I did as I was told).
> 
> Is it important to keep nb-cache under version control in Git? Are
> there any other NetBeans or Gradle directories that can be ignored?
> Do I ignore them or do I exclude them from the commit?
> 
> Thanks,
> 
>   Owen.


Re: Should I exclude ./gradle/nb-cache from commit?

Posted by ma...@gmail.com.
I commit gradle folder (please note : not the .gradle folder) as it
contains the gradle wrapper which helps me restrict and use specific gradle
versions on my build systems.
I like this def provided by gitignore.io
https://www.toptal.com/developers/gitignore/api/gradle


*Cheers*
Mani/Naren/Iyer
*The trick of walking on water is knowing where the stones are.*


On Sat, Aug 6, 2022 at 6:25 AM Andreas Reichel <
andreas@manticore-projects.com> wrote:

>
>
> On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
>
> while gradle/ folders
> shall be committed
>
>
>
> Laszlo,
>
> thank you for advise, please care to elaborate. Why should it be there
> when it can be rebuild on demand? What is the advantage of tracking it and
> the disadvantage of dismissing it?
> Sorry to bother you, I just would like to learn.
>
> Cheers
> Andreas
>

Re: Should I exclude ./.gradle/nb-cache from commit?

Posted by Owen Thomas <ow...@gmail.com>.
I've also ignored "./build" as keeping these files in version control is
silly.

Now that that's done, I can forget about it for another decade or so. :)

On Sat, 6 Aug 2022 at 11:36, Owen Thomas <ow...@gmail.com> wrote:

> Sorry, I have misquoted the folder in the title. The folder I intended to
> quote is "./.gradle/nb-cache", and I have corrected the title of this email
> accordingly.
>
> What I will do then is ignore ".gradle" from each project's base
> directory. Let me know if that is not correct or is incomplete.
>
> Thanks,
>
>   Owen.
>
> On Sat, 6 Aug 2022 at 10:55, Andreas Reichel <
> andreas@manticore-projects.com> wrote:
>
>>
>>
>> On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
>>
>> while gradle/ folders
>> shall be committed
>>
>>
>>
>> Laszlo,
>>
>> thank you for advise, please care to elaborate. Why should it be there
>> when it can be rebuild on demand? What is the advantage of tracking it and
>> the disadvantage of dismissing it?
>> Sorry to bother you, I just would like to learn.
>>
>> Cheers
>> Andreas
>>
>

Should I exclude ./.gradle/nb-cache from commit?

Posted by Owen Thomas <ow...@gmail.com>.
Sorry, I have misquoted the folder in the title. The folder I intended to
quote is "./.gradle/nb-cache", and I have corrected the title of this email
accordingly.

What I will do then is ignore ".gradle" from each project's base directory.
Let me know if that is not correct or is incomplete.

Thanks,

  Owen.

On Sat, 6 Aug 2022 at 10:55, Andreas Reichel <an...@manticore-projects.com>
wrote:

>
>
> On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
>
> while gradle/ folders
> shall be committed
>
>
>
> Laszlo,
>
> thank you for advise, please care to elaborate. Why should it be there
> when it can be rebuild on demand? What is the advantage of tracking it and
> the disadvantage of dismissing it?
> Sorry to bother you, I just would like to learn.
>
> Cheers
> Andreas
>

Re: Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Eric Bresie <eb...@gmail.com>.
FYI GitHub has a nice repository of gitignore files

https://github.com/github/gitignore/ (https://github.com/github/gitignore/tree/main)

Including for gradle https://github.com/github/gitignore/blob/main/Gradle.gitignore

Eric Bresie
Ebresie@gmail.com (mailto:Ebresie@gmail.com)

> On August 6, 2022 at 11:29:50 PM CDT, Laszlo Kishalmi <laszlo.kishalmi@gmail.com (mailto:laszlo.kishalmi@gmail.com)> wrote:
>
> Well, really Gradle Wrapper is optional. It seems that the majority of the users like that, so we do have Maven Wrapper as well now.
>
>
> On 8/6/22 19:25, Andreas Reichel wrote:
> > Thank you for the response.
> >
> > Looks like I don't need it because I never use Gradle Wrapper and always stick with the latest Gradle Version only.
> > (I actually wished there was an option to avoid Gradle Wrapper completely, there was never a Make or ANT wrapper for good. Downloading random stuff from the network outside of the OS' package manager still gives me shivers.)
> >
> > Cheers
> > Andreas
> >
> >
> > On Sat, 2022-08-06 at 18:52 -0700, Laszlo Kishalmi wrote:
> > >
> > > gradle/ folder (not the .gradle) usually the place to put additional build logic, and if nothing else that's where Gradle places it's wrapper gardle/wrapper/
> > >
> > >
> > >
> > > Make sure you add the gardle/wrapper/gradle-wrapper.jar along with the grade/wrapper/gradle-wrapper.properties file. (Unless some policy explicitly state otherwise) Although that is a binary file, that is java the entry point of gradlew and gradlew.bat files. That would download the correct Gradle if it is not installed on the system.
> > >
> > >
> > >
> > >
> > >
> > > On 8/5/22 17:54, Andreas Reichel wrote:
> > >
> > > >
> > > >
> > > > On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
> > > >
> > > > > while gradle/ folders
> > > > > shall be committed
> > > >
> > > >
> > > > Laszlo,
> > > >
> > > > thank you for advise, please care to elaborate. Why should it be there when it can be rebuild on demand? What is the advantage of tracking it and the disadvantage of dismissing it?
> > > > Sorry to bother you, I just would like to learn.
> > > >
> > > > Cheers
> > > > Andreas
> > >
> > >
> >
> >

Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Ernie Rael <er...@raelity.com>.
About gradlew. I occasionally work with 3rd party stuff that is 
incompatible with latest/greatest gradle. A few days ago, I split off a 
few classes from a 20 year old project (ant based) into a lib and 
decided to use gradle on one of my projects for the first time. (I 
figure moving all my stuff to gradle will avoid ever again feeling like 
I need to modernize my builds)

I started using "gradle" instead of (./|[../]+)gradlew but realized that 
was a bad habit to get into. I was thinking of writing a wrapper that 
would search for gradlew; fortunately, I came across "gw" when looking 
at gradle completion to determine how to hook gradle completion into my 
imaginary new command.

Turns out there are a few version of "gw" around. I decided to install 
https://crates.io/crates/gw so I'd have an excuse to also install rust. 
Now I can type gw, which will execute gradlew if it finds one, otherwise 
gradle; and a two character solution is wonderful.

-ernie

On 8/8/22 8:38 AM, Scott Palmer wrote:
> To have truly reproducible builds you need to have dependency 
> management for the tools and JDK, not just libraries.  That's what the 
> wrapper is about.  The wrapper can do hash checks on the downloaded 
> Gradle tool so it should be "safe".  Using the Gradle mechanism to run 
> with a specified JDK, and fetch it from a trusted source if it is 
> missing, completes the controlled environment - mostly, I think the 
> JRE running the Gradle daemon is still not properly version controlled.
>
> That said - I always run bleeding-edge Gradle as well ;-)
>
> Scott
>
> On Sun, Aug 7, 2022 at 12:30 AM Laszlo Kishalmi 
> <la...@gmail.com> wrote:
>
>     Well, really Gradle Wrapper is optional. It seems that the
>     majority of the users like that, so we do have Maven Wrapper as
>     well now.
>
>     On 8/6/22 19:25, Andreas Reichel wrote:
>>     Thank you for the response.
>>
>>     Looks like I don't need it because I never use Gradle Wrapper and
>>     always stick with the latest Gradle Version only.
>>     (I actually wished there was an option to avoid Gradle Wrapper
>>     completely, there was never a Make or ANT wrapper for good.
>>     Downloading random stuff from the network outside of the OS'
>>     package manager still gives me shivers.)
>>
>>     Cheers
>>     Andreas
>>
>>     On Sat, 2022-08-06 at 18:52 -0700, Laszlo Kishalmi wrote:
>>>
>>>     gradle/ folder (not the .gradle) usually the place to put
>>>     additional build logic, and if nothing else that's where Gradle
>>>     places it's wrapper gardle/wrapper/
>>>
>>>     Make sure you add the gardle/wrapper/gradle-wrapper.jar along
>>>     with the grade/wrapper/gradle-wrapper.properties file. (Unless
>>>     some policy explicitly state otherwise) Although that is a
>>>     binary file, that is java the entry point of gradlew and
>>>     gradlew.bat files. That would download the correct Gradle if it
>>>     is not installed on the system.
>>>
>>>
>>>     On 8/5/22 17:54, Andreas Reichel wrote:
>>>
>>>>
>>>>
>>>>     On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
>>>>
>>>>>     while gradle/ folders
>>>>>     shall be committed
>>>>
>>>>
>>>>     Laszlo,
>>>>
>>>>     thank you for advise, please care to elaborate. Why should it
>>>>     be there when it can be rebuild on demand? What is the
>>>>     advantage of tracking it and the disadvantage of dismissing it?
>>>>     Sorry to bother you, I just would like to learn.
>>>>
>>>>     Cheers
>>>>     Andreas
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Scott Palmer <sw...@gmail.com>.
To have truly reproducible builds you need to have dependency
management for the tools and JDK, not just libraries.  That's what the
wrapper is about.  The wrapper can do hash checks on the downloaded Gradle
tool so it should be "safe".  Using the Gradle mechanism to run with a
specified JDK, and fetch it from a trusted source if it is missing,
completes the controlled environment - mostly, I think the JRE running the
Gradle daemon is still not properly version controlled.

That said - I always run bleeding-edge Gradle as well ;-)

Scott

On Sun, Aug 7, 2022 at 12:30 AM Laszlo Kishalmi <la...@gmail.com>
wrote:

> Well, really Gradle Wrapper is optional. It seems that the majority of the
> users like that, so we do have Maven Wrapper as well now.
> On 8/6/22 19:25, Andreas Reichel wrote:
>
> Thank you for the response.
>
> Looks like I don't need it because I never use Gradle Wrapper and always
> stick with the latest Gradle Version only.
> (I actually wished there was an option to avoid Gradle Wrapper completely,
> there was never a Make or ANT wrapper for good. Downloading random stuff
> from the network outside of the OS' package manager still gives me shivers.)
>
> Cheers
> Andreas
>
> On Sat, 2022-08-06 at 18:52 -0700, Laszlo Kishalmi wrote:
>
> gradle/ folder (not the .gradle) usually the place to put additional build
> logic, and if nothing else that's where Gradle places it's wrapper
> gardle/wrapper/
>
> Make sure you add the gardle/wrapper/gradle-wrapper.jar along with the
> grade/wrapper/gradle-wrapper.properties file. (Unless some policy
> explicitly state otherwise) Although that is a binary file, that is java
> the entry point of gradlew and gradlew.bat files. That would download the
> correct Gradle if it is not installed on the system.
>
>
> On 8/5/22 17:54, Andreas Reichel wrote:
>
>
>
> On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
>
> while gradle/ folders
> shall be committed
>
>
>
> Laszlo,
>
> thank you for advise, please care to elaborate. Why should it be there
> when it can be rebuild on demand? What is the advantage of tracking it and
> the disadvantage of dismissing it?
> Sorry to bother you, I just would like to learn.
>
> Cheers
> Andreas
>
>
>

Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Laszlo Kishalmi <la...@gmail.com>.
Well, really Gradle Wrapper is optional. It seems that the majority of 
the users like that, so we do have Maven Wrapper as well now.

On 8/6/22 19:25, Andreas Reichel wrote:
> Thank you for the response.
>
> Looks like I don't need it because I never use Gradle Wrapper and 
> always stick with the latest Gradle Version only.
> (I actually wished there was an option to avoid Gradle Wrapper 
> completely, there was never a Make or ANT wrapper for good. 
> Downloading random stuff from the network outside of the OS' package 
> manager still gives me shivers.)
>
> Cheers
> Andreas
>
> On Sat, 2022-08-06 at 18:52 -0700, Laszlo Kishalmi wrote:
>>
>> gradle/ folder (not the .gradle) usually the place to put additional 
>> build logic, and if nothing else that's where Gradle places it's 
>> wrapper gardle/wrapper/
>>
>> Make sure you add the gardle/wrapper/gradle-wrapper.jar along with 
>> the grade/wrapper/gradle-wrapper.properties file. (Unless some policy 
>> explicitly state otherwise) Although that is a binary file, that is 
>> java the entry point of gradlew and gradlew.bat files. That would 
>> download the correct Gradle if it is not installed on the system.
>>
>>
>> On 8/5/22 17:54, Andreas Reichel wrote:
>>
>>>
>>>
>>> On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
>>>
>>>> while gradle/ folders
>>>> shall be committed
>>>
>>>
>>> Laszlo,
>>>
>>> thank you for advise, please care to elaborate. Why should it be 
>>> there when it can be rebuild on demand? What is the advantage of 
>>> tracking it and the disadvantage of dismissing it?
>>> Sorry to bother you, I just would like to learn.
>>>
>>> Cheers
>>> Andreas
>

Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Andreas Reichel <an...@manticore-projects.com>.
Thank you for the response.

Looks like I don't need it because I never use Gradle Wrapper and
always stick with the latest Gradle Version only.
(I actually wished there was an option to avoid Gradle Wrapper
completely, there was never a Make or ANT wrapper for good. Downloading
random stuff from the network outside of the OS' package manager still
gives me shivers.)

Cheers
Andreas

On Sat, 2022-08-06 at 18:52 -0700, Laszlo Kishalmi wrote:
> gradle/ folder (not the .gradle) usually the place to put additional
> build logic, and if nothing else that's where Gradle places it's
> wrapper gardle/wrapper/ 
> Make sure you add the gardle/wrapper/gradle-wrapper.jar along with
> the grade/wrapper/gradle-wrapper.properties file. (Unless some policy
> explicitly state otherwise) Although that is a binary file, that is
> java the entry point of gradlew and gradlew.bat files. That would
> download the correct Gradle if it is not installed on the system.
> 
> On 8/5/22 17:54, Andreas Reichel wrote:
>  
> > 
> > 
> > 
> > On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
> >  
> > > while gradle/ folders 
> > > shall be committed
> > 
> > 
> > Laszlo,
> > 
> > thank you for advise, please care to elaborate. Why should it be
> > there when it can be rebuild on demand? What is the advantage of
> > tracking it and the disadvantage of dismissing it?
> > Sorry to bother you, I just would like to learn.
> > 
> > Cheers
> > Andreas


Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Laszlo Kishalmi <la...@gmail.com>.
gradle/ folder (not the .gradle) usually the place to put additional 
build logic, and if nothing else that's where Gradle places it's wrapper 
gardle/wrapper/

Make sure you add the gardle/wrapper/gradle-wrapper.jar along with the 
grade/wrapper/gradle-wrapper.properties file. (Unless some policy 
explicitly state otherwise) Although that is a binary file, that is java 
the entry point of gradlew and gradlew.bat files. That would download 
the correct Gradle if it is not installed on the system.


On 8/5/22 17:54, Andreas Reichel wrote:
>
>
> On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
>> while gradle/ folders
>> shall be committed
>
>
> Laszlo,
>
> thank you for advise, please care to elaborate. Why should it be there 
> when it can be rebuild on demand? What is the advantage of tracking it 
> and the disadvantage of dismissing it?
> Sorry to bother you, I just would like to learn.
>
> Cheers
> Andreas

Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Andreas Reichel <an...@manticore-projects.com>.

On Fri, 2022-08-05 at 17:52 -0700, Laszlo Kishalmi wrote:
> while gradle/ folders 
> shall be committed


Laszlo,

thank you for advise, please care to elaborate. Why should it be there
when it can be rebuild on demand? What is the advantage of tracking it
and the disadvantage of dismissing it?
Sorry to bother you, I just would like to learn.

Cheers
Andreas

Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Laszlo Kishalmi <la...@gmail.com>.
,gradle/ folders should be on the ignore list, while gradle/ folders 
shall be committed

On 8/5/22 17:26, Owen Thomas wrote:
> I have my projects running. All is good in the world.
>
> I see the directory indicated in the title of this message sometimes 
> contains files for projects with old names (I converted my project 
> names from camel to kebab case when this was indicated to me as the 
> standard in gradle/maven, so I did as I was told).
>
> Is it important to keep nb-cache under version control in Git? Are 
> there any other NetBeans or Gradle directories that can be ignored? Do 
> I ignore them or do I exclude them from the commit?
>
> Thanks,
>
>   Owen.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Bernd Michaely <in...@bernd-michaely.de>.
You're welcome :-)


On 07.08.22 03:08, Owen Thomas wrote:
> Thanks Bernd for providing this important information. It is help like 
> this from you and others that helps me make sense of the complexity, 
> and I feel that I wouldn't be able to comprehend as quickly without 
> it. I hope that I might be able to provide others with the same from 
> time to time.
>
> On Sun, 7 Aug 2022 at 02:16, Bernd Michaely <in...@bernd-michaely.de> 
> wrote:
>
>     The original Gradle (7.5) doc says:
>
>>     The project root directory contains all source files that are
>>     part of your project. In addition, it contains files and
>>     directories that are generated by Gradle such as |.gradle| and
>>     |build|. While the former are usually checked in to source
>>     control, the latter are transient files used by Gradle to support
>>     features like incremental builds.
>     see:
>     https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root
>
>
>
>     regards,
>
>     Bernd
>
>
>     On 06.08.22 02:26, Owen Thomas wrote:
>>     I have my projects running. All is good in the world.
>>
>>     I see the directory indicated in the title of this message
>>     sometimes contains files for projects with old names (I converted
>>     my project names from camel to kebab case when this was indicated
>>     to me as the standard in gradle/maven, so I did as I was told).
>>
>>     Is it important to keep nb-cache under version control in Git?
>>     Are there any other NetBeans or Gradle directories that can be
>>     ignored? Do I ignore them or do I exclude them from the commit?
>>
>>     Thanks,
>>
>>       Owen.
>

Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Owen Thomas <ow...@gmail.com>.
Thanks Bernd for providing this important information. It is help like this
from you and others that helps me make sense of the complexity, and I feel
that I wouldn't be able to comprehend as quickly without it. I hope that I
might be able to provide others with the same from time to time.

On Sun, 7 Aug 2022 at 02:16, Bernd Michaely <in...@bernd-michaely.de> wrote:

> The original Gradle (7.5) doc says:
>
> The project root directory contains all source files that are part of your
> project. In addition, it contains files and directories that are generated
> by Gradle such as .gradle and build. While the former are usually checked
> in to source control, the latter are transient files used by Gradle to
> support features like incremental builds.
>
> see:
> https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root
>
>
> regards,
>
> Bernd
>
>
> On 06.08.22 02:26, Owen Thomas wrote:
>
> I have my projects running. All is good in the world.
>
> I see the directory indicated in the title of this message sometimes
> contains files for projects with old names (I converted my project names
> from camel to kebab case when this was indicated to me as the standard in
> gradle/maven, so I did as I was told).
>
> Is it important to keep nb-cache under version control in Git? Are there
> any other NetBeans or Gradle directories that can be ignored? Do I ignore
> them or do I exclude them from the commit?
>
> Thanks,
>
>   Owen.
>
>

Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Neil C Smith <ne...@apache.org>.
On Sat, 6 Aug 2022 at 17:16, Bernd Michaely <in...@bernd-michaely.de> wrote:
>
> The original Gradle (7.5) doc says:
>
> The project root directory contains all source files that are part of your project. In addition, it contains files and directories that are generated by Gradle such as .gradle and build. While the former are usually checked in to source control, the latter are transient files used by Gradle to support features like incremental builds.
>
> see: https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root

Given the paragraph below that, it's got to be a typo!

"From version 4.10 onwards, Gradle automatically cleans the
project-specific cache directory. After building the project,
version-specific cache directories in .gradle/<gradle-version>/ are
checked periodically (at most every 24 hours) for whether they are
still in use. They are deleted if they haven’t been used for 7 days."

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Should I exclude ./gradle/nb-cache from commit?

Posted by Bernd Michaely <in...@bernd-michaely.de>.
The original Gradle (7.5) doc says:

> The project root directory contains all source files that are part of 
> your project. In addition, it contains files and directories that are 
> generated by Gradle such as |.gradle| and |build|. While the former 
> are usually checked in to source control, the latter are transient 
> files used by Gradle to support features like incremental builds.

see: 
https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root 



regards,

Bernd


On 06.08.22 02:26, Owen Thomas wrote:
> I have my projects running. All is good in the world.
>
> I see the directory indicated in the title of this message sometimes 
> contains files for projects with old names (I converted my project 
> names from camel to kebab case when this was indicated to me as the 
> standard in gradle/maven, so I did as I was told).
>
> Is it important to keep nb-cache under version control in Git? Are 
> there any other NetBeans or Gradle directories that can be ignored? Do 
> I ignore them or do I exclude them from the commit?
>
> Thanks,
>
>   Owen.