Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 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)
println 'from remote'
@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();
}