Skip to content

Instantly share code, notes, and snippets.

@gabrielfeo
Last active April 11, 2022 10:46
Show Gist options
  • Save gabrielfeo/af31a29237c2e40032a3cb8722750cd0 to your computer and use it in GitHub Desktop.
Save gabrielfeo/af31a29237c2e40032a3cb8722750cd0 to your computer and use it in GitHub Desktop.
Log all init script in a Gradle build. Paste in ~/.gradle/init.gradle to inspect IDE-injected init scripts.
import java.time.LocalDateTime
rootProject {
def time = LocalDateTime.now().toString()
def log = new File("${projectDir}/init-scripts-${time}.log")
log.write "${time}\n"
log << gradle.startParameter.currentDir.path
<< '\nInit scripts:\n---------\n\n'
gradle.startParameter.allInitScripts.each { file ->
log << file.path
<< ':\n---------\n'
<< file.text
<< '\n---------\n\n'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment