blob: 9fd6f3466008f2c27b884a45e11862a799e902a7 [file] [log] [blame]
Yigit Boyara755f332020-05-30 19:14:46 -07001/*
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"]
Aurimas9dc5a162023-02-16 05:26:48 +000028 if (metalavaBuildId == null) {
29 throw new GradleException("metalava build id must be defined.")
Yigit Boyara755f332020-05-30 19:14:46 -070030 }
31 def metalavaRepo = "https://androidx.dev/metalava/builds/${metalavaBuildId}/artifacts/repo/m2repository"
Yigit Boyara755f332020-05-30 19:14:46 -070032 repositories {
33 google()
34 mavenCentral()
Yigit Boyara755f332020-05-30 19:14:46 -070035 maven {
36 url metalavaRepo
37 metadataSources {
38 mavenPom()
39 artifact()
40 }
41 }
Aurimasc36b1d32022-04-22 23:16:35 +000042 gradlePluginPortal().content {
43 it.includeModule("gradle.plugin.com.github.johnrengelman", "shadow")
44 it.includeModule("me.champeau.gradle", "japicmp-gradle-plugin")
45 }
Yigit Boyara755f332020-05-30 19:14:46 -070046 }
Yigit Boyara755f332020-05-30 19:14:46 -070047 ext.repos = [:]
Yigit Boyara755f332020-05-30 19:14:46 -070048}
Yigit Boyara755f332020-05-30 19:14:46 -070049
Dustin Lamc93a99d2020-12-31 00:08:18 +000050apply from: "$supportRootFolder/buildSrc/dependencies.gradle"
Jeff Gaston5633a812021-08-13 11:34:58 -040051apply from: "$supportRootFolder/buildSrc/out.gradle"
Yigit Boyara755f332020-05-30 19:14:46 -070052init.chooseOutDir("/${rootProject.name}")
53
54apply plugin: AndroidXRootPlugin
55apply plugin: AndroidXPlaygroundRootPlugin