Reading Files Line by Line Add comment to Wiki View in Wiki Edit Wiki page Printable Version

One of my favorite things to do in Groovy is read files line by line. I'm going to show you these examples using a Gradle Build Script.

Imagine you had this build.gradle


What if you wanted to write a script to extract the version from the build.gradle to use it in a Shell Script or for instance a CI Build Task? How would you do this efficiently?


This allows you to extract versions fast and simply using nothing but a Groovy Script! (smile)



Results of your search request can come from various sources: the Groovy website itself, the JIRA issues, the API documentation, as well as a few other interesting Groovy-related blogs.

  By  -  pages  -  views  - last modified