|  | /* | 
|  | * Copyright 2020 The Android Open Source Project | 
|  | * | 
|  | * 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 | 
|  | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | * See the License for the specific language governing permissions and | 
|  | * limitations under the License. | 
|  | */ | 
|  |  | 
|  | import androidx.build.AndroidXPlaygroundRootPlugin | 
|  | import androidx.build.AndroidXRootPlugin | 
|  |  | 
|  | // A generic build.gradle file for all playground projects that sets it up to use public artifacts. | 
|  | // See README.md for details | 
|  |  | 
|  | buildscript { | 
|  | def playgroundCommonFolder = rootProject.buildFile.parentFile | 
|  | ext.supportRootFolder = playgroundCommonFolder.parentFile | 
|  |  | 
|  | def metalavaBuildId = rootProject.properties["androidx.playground.metalavaBuildId"] | 
|  | if (metalavaBuildId == null) { | 
|  | throw new GradleException("metalava build id must be defined.") | 
|  | } | 
|  | def metalavaRepo = "https://androidx.dev/metalava/builds/${metalavaBuildId}/artifacts/repo/m2repository" | 
|  | repositories { | 
|  | google() | 
|  | mavenCentral() | 
|  | maven { | 
|  | url metalavaRepo | 
|  | metadataSources { | 
|  | mavenPom() | 
|  | artifact() | 
|  | } | 
|  | } | 
|  | gradlePluginPortal().content { | 
|  | it.includeModule("gradle.plugin.com.github.johnrengelman", "shadow") | 
|  | it.includeModule("me.champeau.gradle", "japicmp-gradle-plugin") | 
|  | } | 
|  | } | 
|  | ext.repos = [:] | 
|  | } | 
|  |  | 
|  | apply from: "$supportRootFolder/buildSrc/dependencies.gradle" | 
|  | apply from: "$supportRootFolder/buildSrc/out.gradle" | 
|  | init.chooseOutDir("/${rootProject.name}") | 
|  |  | 
|  | apply plugin: AndroidXRootPlugin | 
|  | apply plugin: AndroidXPlaygroundRootPlugin |