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| FROM gradle/gradle-enterprise-test-distribution-agent:2.0.1 | |
| USER 0 | |
| RUN apt-get update \ | |
| && apt-get install -y wget \ | |
| && apt-get install -y unzip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| USER gradle | |
| RUN mkdir -p /home/gradle/android-sdk | |
| ENV ANDROID_HOME "/home/gradle/android-sdk" |
| task checkForOverlappingOutputs { | |
| doLast { | |
| def rootNode = new TreeNode() | |
| rootNode.name = '' | |
| // Gather the outputs of all tasks | |
| allprojects { | |
| tasks.all { task -> | |
| try { | |
| task.outputs.files.each { file -> |
| import org.gradle.api.services.* | |
| subprojects { | |
| apply plugin: OneTestTaskOnly | |
| } | |
| class OneTestTaskOnly implements Plugin<Project> { | |
| void apply(Project project) { | |
| // Register a service to constrain parallelism of test tasks to 1 | |
| Provider<SharedResource> testLimitingService = project.gradle.sharedServices.registerIfAbsent("testLimitingService", SharedResource) { spec -> |
| def fingerprinter = services.get(org.gradle.internal.fingerprint.classpath.ClasspathFingerprinter) | |
| tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { task -> | |
| doFirst { | |
| ClassLoader classLoader = task.getClass().classLoader | |
| while (classLoader instanceof URLClassLoader) { | |
| def fingerprints = [] as Set | |
| def allFiles = [] as Set | |
| classLoader.getURLs().each { | |
| fingerprints.add(["${task.path}:${file(it.file).name}", "${fingerprinter.fingerprint(files(it.file)).hash}"]) | |
| allFiles.add(file(it.file)) |
| tasks.withType(com.android.build.gradle.tasks.MergeResources) { task -> | |
| Map<String, FileCollection> originalResources = [:] | |
| // Create a synthetic input with the original value and RELATIVE path sensitivity | |
| project.gradle.taskGraph.beforeTask { | |
| if (it == task) { | |
| originalResources.putAll(task.resourcesComputer.resources) | |
| task.resourcesComputer.resources.clear() | |
| task.inputs.files(originalResources.values()) | |
| .withPathSensitivity(PathSensitivity.RELATIVE) | |
| .withPropertyName("rawLocalResources.workaround") |
| /** | |
| * 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| #!/usr/bin/env bash | |
| # I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
| # well, so I wrote my own script to do the simple job of converting package names. | |
| # | |
| # You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
| # | |
| # It'll run faster on a clean build because then there are fewer files to scan over. | |
| # | |
| # Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
| Banana Bread (adapted from the St. Peter's Catholic Church Cookbook from my childhood) | |
| 1/2 cup butter (about half a 250g bar) softened | |
| 1 1/4 cup sugar (about 250 g) | |
| 2 eggs | |
| 1 1/2 cup flour (about 180 g) | |
| 3/4 tsp baking powder | |
| 2 1/2 tsp milk | |
| 1/2 tsp vinegar | |
| 1 tsp vanilla |
| /* Copyright 2013 Google Inc. | |
| Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */ | |
| package com.example.latlnginterpolation; | |
| import android.animation.ObjectAnimator; | |
| import android.animation.TypeEvaluator; | |
| import android.animation.ValueAnimator; | |
| import android.annotation.TargetApi; | |
| import android.os.Build; |