Skip to content

Instantly share code, notes, and snippets.

@breskeby
breskeby / myleodailywod.scriptable
Last active May 31, 2022 23:11
MyLeo Daily WOD Script
let widget = await createWidget();
// Check where the script is running
if (config.runsInWidget) {
// Runs inside a widget so add it to the homescreen widget
Script.setWidget(widget);
} else {
// Show the large widget inside the app
widget.presentLarge();
}
println 'from remote'
@breskeby
breskeby / build.gradle
Created August 8, 2019 13:11
non input system properties for test tasks
tasks.withType(Test).configureEach { Test testTask ->
def nonInputs = new InconsequentialSystemProperty()
testTask.jvmArgumentProviders.add(nonInputs)
def nonInputSystemProperty = { String key, value ->
nonInputs.props.put(key, value)
}
testTask.extensions.extraProperties.set("nonInputSystemProperty", nonInputSystemProperty)
@breskeby
breskeby / multiproject-with-deprecations.gradle
Last active February 6, 2019 15:00
Example gradle multiproject with deprecated usage
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.gradle:build-scan-plugin:2.1'
}
}
apply plugin: 'com.gradle.build-scan'
@breskeby
breskeby / build.gradle
Created February 14, 2018 13:55
multiple failures in composites
apply plugin: 'java'
group "org.sample"
version "1.0"
dependencies {
compile "org.sample:included-Sub1:1.0"
compile "org.sample:included-Sub2:1.0"
}
gradle.buildFinished {
@breskeby
breskeby / build.gradle
Created February 10, 2018 14:34
accessing java targetCompatibility
import org.gradle.api.JavaVersion;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.provider.Property;
import java.util.concurrent.Callable;
public class AcmePlugin implements Plugin<Project> {
@breskeby
breskeby / gist:b6b6d4cdd03cf5c79e222a3e7d8ea5b9
Last active April 20, 2017 10:03
slow gradle distribution debugging
please provide output of
- Running “time curl -svo /dev/null https://downloads.gradle.org/distributions/gradle-3.5-all.zip”
- Running “time curl -svo /dev/null https://d2ueg53gsd9z3m.cloudfront.net/distributions/gradle-3.5-all.zip”
- Running “mtr --report https://downloads.gradle.org/distributions/”
- http://gradle.org/cdn-cgi/trace
@breskeby
breskeby / get-help.groovy
Last active November 9, 2016 16:30
buildscan recipe gist for creating topic on gradle forum
buildScan.buildFinished { result ->
if(result.failure){
if(result.failure instanceof org.gradle.internal.exceptions.LocationAwareException){
if(result.failure.reportableCauses.size() >= 1) {
def reportMessage = result.failure.reportableCauses[0].message
buildScan.link("Create Gradle Forum Topic", createForumLink(reportMessage))
}
}
}
}
@breskeby
breskeby / gradle_releases.html
Created January 10, 2016 01:16
gradle release history
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
@breskeby
breskeby / java
Created November 29, 2015 23:34
java class letting fregedoc fail
package org.frege.java;
public class StaticHello {
public static String helloJava() {
return "hello from java";
}
}