Build "Sources for Android 29" so you can comfortably browse the Android API source in Android Studio.
- Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build
mkdir -p frameworks/base
import android.graphics.drawable.AnimationDrawable | |
import coil.ImageLoader | |
import coil.decode.DecodeResult | |
import coil.decode.Decoder | |
import coil.decode.VideoFrameDecoder | |
import coil.fetch.SourceResult | |
import coil.request.Options | |
import coil.request.Parameters | |
import kotlin.time.Duration | |
import kotlin.time.Duration.Companion.seconds |
class GraphDetails { | |
LinkedHashSet<Project> projects | |
LinkedHashMap<Tuple2<Project, Project>, List<String>> dependencies | |
ArrayList<Project> multiplatformProjects | |
ArrayList<Project> androidProjects | |
ArrayList<Project> javaProjects | |
ArrayList<Project> rootProjects | |
// Used for excluding module from graph | |
public static final SystemTestName = "system-test" |
import java.time.LocalDate | |
import java.time.LocalDateTime | |
import java.time.Month | |
import java.time.ZonedDateTime | |
import java.util.TimeZone | |
fun January(day: Int, year: Int) = LocalDate.of(year, Month.JANUARY, day) | |
fun February(day: Int, year: Int) = LocalDate.of(year, Month.FEBRUARY, day) | |
fun March(day: Int, year: Int) = LocalDate.of(year, Month.MARCH, day) | |
fun April(day: Int, year: Int) = LocalDate.of(year, Month.APRIL, day) |
@Test | |
fun verifySerializedNameMatchesJsonName() { | |
// Reflections library | |
Reflections("com.foobar").getTypesAnnotatedWith(JsonClass::class.java) | |
.flatMap { clz -> | |
// FieldUtils is in Apache Commons | |
FieldUtils.getAllFieldsList(clz).filter { !Modifier.isStatic(it.modifiers) } | |
} | |
.forEach { field -> | |
val serializedNameAnnotation = field.declaredAnnotations.find { it is SerializedName } as? SerializedName |
/** | |
* 1) Change agpVersion | |
* 2) Run './gradlew dumpSources' | |
* 3) Check changeset into source control | |
*/ | |
def agpVersion = 'UPDATE_THIS' | |
repositories { | |
google() | |
jcenter() |
Build "Sources for Android 29" so you can comfortably browse the Android API source in Android Studio.
mkdir android-sdk-source-build
cd android-sdk-source-build
mkdir -p frameworks/base
import com.squareup.javapoet.ClassName | |
import com.squareup.javapoet.ParameterizedTypeName | |
import com.squareup.javapoet.TypeName | |
import com.squareup.javapoet.TypeVariableName | |
import com.squareup.javapoet.WildcardTypeName | |
import com.squareup.javapoet.ArrayTypeName | |
import com.squareup.kotlinpoet.ARRAY | |
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy | |
fun ClassName.asKPClassName(): com.squareup.kotlinpoet.ClassName { |
fun main(args: Array<String>) { | |
println("a" to "b") | |
println("a" to "b" tre "c") | |
println("a" to "b" tre "c" fo "d") | |
println("a" to "b" tre "c" fo "d" fi "e") | |
println("a" to "b" tre "c" fo "d" fi "e" sik "f") | |
println("a" to "b" tre "c" fo "d" fi "e" sik "f" seva "g") | |
} | |
infix fun <A, B, C> Pair<A, B>.tre(c: C) = Triple(first, second, c) |
/* | |
* Copyright (C) 2018 Square, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
#!/bin/bash | |
FFMPEG=$(command -v ffmpeg) | |
INFILE=$1 | |
OUTFILE="${INFILE}.gif" | |
TMPFILE="${INFILE}_gifify_palette.png" | |
if ! $FFMPEG -L > /dev/null 2>&1; then | |
echo "Run: brew install ffmpeg" | |
exit 1 |