This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val scrollState = rememberScrollState() | |
Layout( | |
modifier = Modifier.verticalScroll(scrollState), | |
content = { repeat(itemCount) { item(it) } } | |
) { measurables, constraints -> | |
val placeables = measurables.map { measurable -> | |
measurable.measure(constraints) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Before; | |
import org.junit.Test; | |
import static junit.framework.TestCase.assertEquals; | |
import static org.mockito.Mockito.mock; | |
import static org.mockito.Mockito.verify; | |
import static org.mockito.Mockito.when; | |
public class MockitoTest { | |
interface StringProvider { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Before | |
public void setUp() { | |
} | |
@After | |
public void tearDown() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testSometing() { | |
testedObject.doSomething(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void addLogMethod(CtClass ctClass) { | |
String body = "System.out.println(\"Added later\");"; | |
CtConstructor[] constructors = ctClass.getConstructors(); | |
if (constructors == null) return; | |
for (CtConstructor constructor : constructors) { | |
addCodeIfNeeded(constructor, body); | |
} | |
} | |
void addCode(CtConstructor constructor, String body) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set<String> getClassNames(Collection<TransformInput> inputs) { | |
Set<String> classNames = new HashSet<>(); | |
for (TransformInput input : inputs) { | |
classNames.addAll(getDirectoryInputs(input.getDirectoryInputs())); | |
classNames.addAll(getJarInputs(input.getJarInputs())); | |
} | |
return classNames; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomTransform extends Transform { | |
@Override | |
public String getName() { | |
return "CustomProc"; | |
} | |
@Override | |
public Set<QualifiedContent.ContentType> getInputTypes() { | |
return ImmutableSet.of(QualifiedContent.DefaultContentType.CLASSES); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void registerTransformer() { | |
Object android = project.findProperty("android"); | |
if (android instanceof BaseAppModuleExtension) { | |
System.err.println("Adding transform"); | |
((BaseAppModuleExtension) android).registerTransform(new CustomTransform()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pluginBundle { | |
website = "https://google.com" | |
vcsUrl = "https://gitlab.com/zskamljic" | |
description = "demo plugin" | |
tags = ["demo", "plugin"] | |
plugins { | |
demoPlugin { | |
id = 'equaleyes.demo' | |
displayName = 'Demo Plugin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void addDependencies() { | |
project.getRepositories().add(project.getRepositories().jcenter()); | |
addAnnotationProcessor(); | |
DependencyHandler dependencies = project.getDependencies(); | |
dependencies.add("implementation", "com.lablizards.depend:depend:1.2.0"); | |
dependencies.add("compileOnly", "com.lablizards.depend:depend-annotations:1.2.0"); | |
dependencies.add("annotationProcessor", "com.lablizards.depend:depend-compiler:1.2.0"); | |
} |