Skip to content

Instantly share code, notes, and snippets.

View autonomousapps's full-sized avatar

Tony Robalik autonomousapps

View GitHub Profile
There were 4 failures:
1) net.bytebuddy.agent.builder.ResettableClassFileTransformer
java.lang.ClassNotFoundException: net.bytebuddy.agent.builder.ResettableClassFileTransformer
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at android.support.test.internal.runner.TestLoader.doLoadClass(TestLoader.java:92)
at android.support.test.internal.runner.TestLoader.loadIfTest(TestLoader.java:113)
at android.support.test.internal.runner.TestRequestBuilder.loadClassesFromClassPath(TestRequestBuilder.java:801)
at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:747)
at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:354)
------------------------------- MODULE dekker -------------------------------
EXTENDS TLC, Integers
CONSTANT Threads
(*--algorithm dekker
variables
flag = [t \in Threads |-> FALSE],
next_thread \in Threads;
@autonomousapps
autonomousapps / gist:209dee9be7e3a3c9de9611b811443e68
Last active August 20, 2020 17:57
Using a custom Gradle distribution
# How do I package a custom Gradle distribution with init scripts?
I want to be able to configure Gradle Enterprise, build scans, and the cache, all from one centralized location.
# Answer
In order to customize your Gradle distribution, you basically have to add one or more init scripts to the `init.d/` directory in the distribution `.zip` file. That's talked about here:
https://docs.gradle.org/current/userguide/init_scripts.html#sec:using_an_init_script
> Put a file that ends with `.gradle` (or `.init.gradle.kts` for Kotlin) in the `GRADLE_HOME/init.d/` directory, in the Gradle distribution. This allows you to package up a custom Gradle distribution containing some custom build logic and plugins. You can combine this with the Gradle wrapper as a way to make custom logic available to all builds in your enterprise.
The actual script would look something like **Example 9** from https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_configure_remote
@autonomousapps
autonomousapps / pub.gradle.kts
Created August 28, 2020 18:11
Publishing android libraries -- the "all" component
import com.android.build.gradle.LibraryExtension
plugins {
`maven-publish`
}
var sourcesJar: TaskProvider<Jar>? = null
pluginManager.withPlugin("com.android.library") {
// Task for generating the source jar so one can attach the source when debugging in other
// projects. Added to debug publication automatically. The 'android' (LibraryExtension) extension
https://scans.gradle.com/s/h3lttvotbd7ve
failure:
```
Could not resolve all files for configuration ':app:labDebugAndroidTestCompileClasspath'.
> Failed to transform tguard.jar (project :tguard) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.usage=java-api, org.jetbrains.kotlin.localToProject=public, org.jetbrains.kotlin.platform.type=jvm}.
> Execution failed for IdentityTransform: /Users/trobalik/workspace/hiya/aegis-android/tguard/build/libs/tguard.jar.
> Expecting a file or a directory: /Users/trobalik/workspace/hiya/aegis-android/tguard/build/libs/tguard.jar
```
@autonomousapps
autonomousapps / gist:fc5aff10403b5a07f34391fcfd88945d
Created November 5, 2020 19:24
jar tf simple-grammar-1.0-SNAPSHOT.jar
META-INF/
META-INF/MANIFEST.MF
com/
com/autonomousapps/
com/autonomousapps/internal/
com/autonomousapps/internal/grammar/
com/autonomousapps/internal/grammar/KotlinParser$ExclContext.class
com/autonomousapps/internal/grammar/KotlinParser$LambdaParametersContext.class
com/autonomousapps/internal/grammar/KotlinParser$FunctionBodyContext.class
com/autonomousapps/internal/grammar/KotlinParser$MultiLineStringLiteralContext.class
@autonomousapps
autonomousapps / AndroidUnitTest.java
Created December 22, 2020 19:23
buildSrc/src/main/java/com/android/build/gradle/tasks/factory/AndroidUnitTest.java
//buildSrc/src/main/java/com/android/build/gradle/tasks/factory/AndroidUnitTest.java
package com.android.build.gradle.tasks.factory;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
import com.android.build.api.artifact.impl.ArtifactsImpl;
import com.android.build.api.component.TestComponentProperties;
import com.android.build.api.component.impl.ComponentPropertiesImpl;
import com.android.build.api.component.impl.UnitTestPropertiesImpl;
import com.android.build.api.variant.impl.VariantPropertiesImpl;
@autonomousapps
autonomousapps / build.gradle
Created January 12, 2021 22:32
Print Gradle's class loader hierarchy
// app/build.gradle
def printClassLoaders(classLoader) {
while (classLoader != null) {
println(classLoader)
classLoader = classLoader.parent
}
}
class A {
}
alias.lg log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
alias.last log -1 HEAD
alias.unstage reset HEAD --
alias.amend commit --amend --no-edit
alias.co checkout
alias.alias config --get-regexp ^alias\.
alias.st status
alias.up push --force-with-lease
alias.aa !git add . && git commit --amend --no-edit
alias.fix !git add . && git commit --amend --no-edit && git push --force-with-lease
@autonomousapps
autonomousapps / ResolveDependenciesPlugin.kt
Created March 16, 2022 20:13
Plugin for resolving dependencies in a task action, to help with pre-populating a docker image
class ResolveDependenciesPlugin : Plugin<Project> {
override fun apply(target: Project): Unit = target.run {
pluginManager.withPlugin("java") {
registerTask(theJars = artifactFilesProvider("compileClasspath", "jar"))
}
pluginManager.withPlugin("com.android.base") {
// This lets us call `./gradlew resolveDependencies` and have it Just Work.
val lifecycleTask = tasks.register(RESOLVE_DEPENDENCIES_TASK_NAME)