1/* 2 * Copyright 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17import androidx.build.AndroidXPlaygroundRootPlugin 18import androidx.build.AndroidXRootPlugin 19 20// A generic build.gradle file for all playground projects that sets it up to use public artifacts. 21// See README.md for details 22 23buildscript { 24 def playgroundCommonFolder = rootProject.buildFile.parentFile 25 ext.supportRootFolder = playgroundCommonFolder.parentFile 26 27 def metalavaBuildId = rootProject.properties["androidx.playground.metalavaBuildId"] 28 if (metalavaBuildId == null) { 29 throw new GradleException("metalava build id must be defined.") 30 } 31 def metalavaRepo = "https://androidx.dev/metalava/builds/${metalavaBuildId}/artifacts/repo/m2repository" 32 repositories { 33 google() 34 mavenCentral() 35 maven { 36 url metalavaRepo 37 metadataSources { 38 mavenPom() 39 artifact() 40 } 41 } 42 gradlePluginPortal().content { 43 it.includeModule("com.gradleup.shadow", "shadow-gradle-plugin") 44 it.includeModule("me.champeau.gradle", "japicmp-gradle-plugin") 45 } 46 } 47 ext.repos = [:] 48} 49 50apply plugin: AndroidXRootPlugin 51apply plugin: AndroidXPlaygroundRootPlugin 52