Last active
April 11, 2022 10:46
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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