Skip to content

Instantly share code, notes, and snippets.

@ghale
ghale / gist:f72c193056cc37753539
Created June 3, 2015 19:58
Hung test worker stack trace
Deadlock Detection:
No deadlocks found.
Thread 31896: (state = BLOCKED)
- sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
- java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=186 (Interpreted frame)
- java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=42, line=2043 (Interpreted frame)
- org.gradle.messaging.remote.internal.hub.queue.EndPointQueue.take(java.util.Collection) @bci=36, line=49 (Interpreted frame)
- org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run() @bci=25, line=350 (Interpreted frame)
ext.printDep = { dep, indent ->
println "${indent}${dep.moduleGroup}${dep.moduleName}${dep.moduleVersion}"
dep.children.each { child ->
printDep(child, "${indent} ")
}
}
task showBuildScriptDependencies {
doLast {
buildscript.configurations.classpath.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
@ghale
ghale / gist:b45bbb804d5d438cb212
Created November 9, 2015 20:13
example of redistributing gradle with init scripts
apply plugin: "base"
apply plugin: "maven-publish"
repositories {
maven {
url "http://repo.gradle.org/gradle/gradle"
}
}
configurations {
@ghale
ghale / triggerWebsitePullDocs
Created April 19, 2016 16:54
triggerWebsitePullDocs
/var/www/gradleware-web/master/backend-ops.gradle.org/update-docs/../docs-raw 2.12 https://services.gradle.org/distributions/gradle-2.12-patched-docs-2.zip
2.12 exists, not downloading
2.12 docs already transformed
ln -sfT 2.12 current
/var/www/gradleware-web/master/backend-ops.gradle.org/update-docs/../docs-raw 2.13-rc-2 https://services.gradle.org/distributions/gradle-2.13-rc-2-all.zip
wget --no-check-certificate -O 2.13-rc-2.zip https://services.gradle.org/distributions/gradle-2.13-rc-2-all.zip
value host_statistics_pages host_statistics_mb vm_stat_mb vm_stat_pages
free 286318 1118 1115 285662
inactive 806602 3150 3150 806602
wired 948824 3706 3706 948865
active 1439810 5624 5626 1440300
external 407294064 1590992 1561 399654
speculative 1 0 79 20247
total 4194304 16384 16384 4194304
available_fcache 407580381 1592110 2597 665069
available_inact 1092919 4269 4187 1072017
@ghale
ghale / init.gradle
Created May 3, 2018 13:33
Standard error capturing init script
rootProject {
def errorFile = file("${rootProject.buildDir}/errors.log")
def errorListener = new ErrorCapture(errorFile)
allprojects {
logging.addStandardErrorListener(errorListener)
tasks.all {
logging.addStandardErrorListener(errorListener)
}
apply plugin: DbPlugin
tasks.register("subtask1")
tasks.register("subtask2")
tasks.named("fixDbPermissions") {
addStep subtask1
addStep subtask2
}
/*
* Adds extended data to a build scan so that this data can be searched on in the scans ui.
*
* Add this script to the gradle directory and apply it in your build.gradle
* e.g.
*
* apply from: "gradle/buildScan-extended-data.gradle"
*
*
* Note that this script requires the following to be added to your settings.gradle:
import org.gradle.launcher.daemon.registry.DaemonRegistry
def registry = services.get(DaemonRegistry)
if (registry.all.size() > 1) {
registry.all.each { info ->
buildScan {
value "daemon-${info.pid}", "${info.lastBusy} ${info.toString()}"
}
}
@ghale
ghale / build.gradle
Last active February 10, 2020 21:33
Make GitProperties plugin only gather properties once
plugins {
id 'java'
// Only add the git-properties plugin to the classpath, don't apply (yet)
id 'com.gorylenko.gradle-git-properties' version '2.2.1' apply false
}
// This plugin is only applied to the root project
apply plugin: GitRootProjectPropertiesPlugin
subprojects {