Skip to content

Instantly share code, notes, and snippets.

View eriwen's full-sized avatar

Eric Wendelin eriwen

View GitHub Profile
var flakyTests = emptyList<String>()
if (project.file("flaky-tests.txt").exists()) {
flakyTests = project.file("flaky-tests.txt").readLines(Charset.defaultCharset())
}
tasks.test {
filter {
flakyTests.forEach(::excludeTestsMatching)
}
}
@eriwen
eriwen / multi-language-sample-adoc-macros.adoc
Last active February 21, 2024 12:08
Multi-language examples for asciidoctor, including all the intermediate transforms, CSS, and HTML, and asciidoc source
@eriwen
eriwen / multi-language-sample.html
Last active February 21, 2024 12:08
Multi-language code samples on the web
<div class="exampleblock testable-sample multi-language-sample">
<div class="title">build.gradle</div>
<div class="content">
<pre class="prettyprint highlight"><code class="language-groovy" data-lang="groovy">logging.captureStandardOutput LogLevel.INFO
println 'A message which is logged at INFO level'</code></pre>
</div>
</div>
<div class="exampleblock testable-sample multi-language-sample">
<div class="title">build.gradle.kts</div>
@eriwen
eriwen / init.gradle
Created May 3, 2018 15:03
Fix stderr in plain console in Gradle 4.7
rootProject {
def errorFile = file("${rootProject.buildDir}/errors.log")
def errorListener = new ErrorCapture(errorFile)
allprojects {
logging.addStandardErrorListener(errorListener)
tasks.all {
logging.addStandardErrorListener(errorListener)
}
}
}
@eriwen
eriwen / kotlin-hl.xml
Created April 13, 2018 18:42
Kotlin syntax highlighting config for xslthl
<?xml version="1.0" encoding="UTF-8"?>
<!--
Syntax highlighting definition for Kotlin
xslthl - XSLT Syntax Highlighting
http://sourceforge.net/projects/xslthl/
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks
This software is provided 'as-is', without any express or implied
@eriwen
eriwen / groovy-hl.xml
Created April 13, 2018 18:38
Groovy syntax highlighting config for xslthl
<?xml version="1.0" encoding="UTF-8"?>
<!--
Syntax highlighting definition for Groovy
xslthl - XSLT Syntax Highlighting
http://sourceforge.net/projects/xslthl/
Copyright (C) 2005-2008 Michal Molhanec, Jirka Kosek, Michiel Hendriks
This software is provided 'as-is', without any express or implied
@eriwen
eriwen / autofix_kotlin_dsl.zsh
Created October 30, 2017 21:51
Automatically fix Kotlin version declared in build.gradle.kts
#!/usr/bin/env zsh
OAUTH_HEADER="Authorization: token ${GITHUB_OAUTH_TOKEN}"
GITHUB_API_URL="https://api.github.com"
# List Repos that have a .kts file containing 'kotlin("jvm")'
AFFECTED_REPOS=$(curl -H "${OAUTH_HEADER}" "${GITHUB_API_URL}/search/code?q=kotlin%28jvm%29+extension%3Akts" | jq '.items[].repository.full_name' | sed -e 's/"//g' | sort | uniq)
typeset -A version_hash
version_hash=(4.3 1.1.51 4.2.1 1.1.4-3 4.2 1.1.4-3 4.1 1.1.3-2 4.0 1.1.0 3.5 1.1.0)
@eriwen
eriwen / gradle-internal-api-usage.sql
Last active February 21, 2024 12:09
Get most frequent usage of Gradle Internal APIs from BigQuery GitHub Data
SELECT
class,
COUNT(*) count
FROM (
SELECT
REGEXP_REPLACE(line, r'import |;', '') AS class,
c.id
FROM (
SELECT
SPLIT(c.content, '\n') line,
@eriwen
eriwen / github-labels-config.json
Created May 7, 2017 22:34
Configuration for github-labels node tool
[{
"name": "a:bug",
"color": "d93f0b"
}, {
"name": "a:chore",
"color": "1d76db"
}, {
"name": "a:feature",
"color": "0e8a16"
}, {
@eriwen
eriwen / Gradle Public API
Created April 17, 2017 15:25
Definition of Gradle Public API for versioning/regression testing purposes
include 'org/gradle/*'
include 'org/gradle/api/**'
include 'org/gradle/authentication/**'
include 'org/gradle/buildinit/**'
include 'org/gradle/caching/**'
include 'org/gradle/external/javadoc/**'
include 'org/gradle/ide/**'
include 'org/gradle/ivy/**'
include 'org/gradle/jvm/**'
include 'org/gradle/language/**'