Initially taken by Niko Matsakis and lightly edited by Ryan Levick
- Introductions
- Cargo inside large build systems
- FFI
- Foundations and financial support
| #!/bin/bash | |
| set -e | |
| if [[ -z ${K8S_JVM_POD} ]]; then | |
| echo "K8S_JVM_POD not defined" | |
| exit 1 | |
| fi | |
| EXEC="kubectl exec ${K8S_JVM_POD}" | |
| CP="kubectl cp ${K8S_JVM_POD}" |
To keep the arguments and examples to the point there are few helpful rules:
| // You can place it in the root build.gradle | |
| allprojects { | |
| tasks.withType(JavaForkOptions) { | |
| // Forked processes like GradleWorkerMain for tests won't steal focus! | |
| jvmArgs '-Djava.awt.headless=true' | |
| } | |
| } |
| import org.junit.rules.TestRule; | |
| import org.junit.runner.Description; | |
| import org.junit.runners.model.Statement; | |
| /** Got flaky tests? Shampoo them away. */ | |
| public final class ShampooRule implements TestRule { | |
| private final int iterations; | |
| public ShampooRule(int iterations) { | |
| if (iterations < 1) throw new IllegalArgumentException("iterations < 1: " + iterations); |
| import com.google.auto.value.AutoValue; | |
| import java.lang.annotation.Retention; | |
| import java.lang.annotation.Target; | |
| import static java.lang.annotation.ElementType.TYPE; | |
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| /** | |
| * Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization. | |
| * <p> |
| // add this to the general build.gradle, not in the subproject's build.gradle | |
| // improved version of Xavier's tip http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance. | |
| // usage example default, preDex will be enabled: gradle clean build | |
| // usage example disabling preDex: gradle clean build -PpreDexEnable=false | |
| // preDexEnable parameter's value can be set as property of Continuous Integration build config | |
| // this is the main difference from Xavier's workaround where he doing only hasProperty check | |
| project.ext { | |
| if (project.hasProperty('preDexEnable')) { |
| def toCamelCase(String string) { | |
| String result = "" | |
| string.findAll("[^\\W]+") { String word -> | |
| result += word.capitalize() | |
| } | |
| return result | |
| } | |
| afterEvaluate { project -> | |
| Configuration runtimeConfiguration = project.configurations.getByName('compile') |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.