Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 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 | |
| 17 | import androidx.build.AndroidXPlaygroundRootPlugin |
| 18 | import 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 | |
| 23 | buildscript { |
| 24 | def playgroundCommonFolder = rootProject.buildFile.parentFile |
| 25 | ext.supportRootFolder = playgroundCommonFolder.parentFile |
| 26 | |
| 27 | def metalavaBuildId = rootProject.properties["androidx.playground.metalavaBuildId"] |
Aurimas | 9dc5a16 | 2023-02-16 05:26:48 +0000 | [diff] [blame] | 28 | if (metalavaBuildId == null) { |
| 29 | throw new GradleException("metalava build id must be defined.") |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 30 | } |
| 31 | def metalavaRepo = "https://androidx.dev/metalava/builds/${metalavaBuildId}/artifacts/repo/m2repository" |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 32 | repositories { |
| 33 | google() |
| 34 | mavenCentral() |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 35 | maven { |
| 36 | url metalavaRepo |
| 37 | metadataSources { |
| 38 | mavenPom() |
| 39 | artifact() |
| 40 | } |
| 41 | } |
Aurimas | c36b1d3 | 2022-04-22 23:16:35 +0000 | [diff] [blame] | 42 | gradlePluginPortal().content { |
Aurimas Liutikas | 2e6b1a2 | 2024-09-11 10:01:11 -0700 | [diff] [blame] | 43 | it.includeModule("com.gradleup.shadow", "shadow-gradle-plugin") |
Aurimas | c36b1d3 | 2022-04-22 23:16:35 +0000 | [diff] [blame] | 44 | it.includeModule("me.champeau.gradle", "japicmp-gradle-plugin") |
| 45 | } |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 46 | } |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 47 | ext.repos = [:] |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 48 | } |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 49 | |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 50 | apply plugin: AndroidXRootPlugin |
| 51 | apply plugin: AndroidXPlaygroundRootPlugin |