I am trying to work around the problem described in GRADLE-2293 where generated files are always updated because a timestamp is written to the Eclipse files located in directory .settings
by the Gradle plugin which generates the Eclipse project files.
The files contain a header like this which I would like to remove
#
#Fri Mar 27 10:26:55 CET 2015
Currently I am using an Exec task to use the external application sed
to cut out lines starting with '#':
task adjustEclipseSettingsFile(type: Exec) {
executable 'sed'
args '-i','-e','s/^#.*//g','.settings/org.eclipse.jdt.core.prefs'
}
eclipseJdt.finalizedBy adjustEclipseSettingsFile
however this adds a dependency on operating system binaries that I would like to avoid.
How can I do this simple removal of lines starting with '#' in a Gradle task without calling external tools?