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"] |
| 28 | def dokkaBuildId = rootProject.properties["androidx.playground.dokkaBuildId"] |
| 29 | if (metalavaBuildId == null || dokkaBuildId == null) { |
| 30 | throw new GradleException("metalava and or dokka build ids must be defined.") |
| 31 | } |
| 32 | def metalavaRepo = "https://androidx.dev/metalava/builds/${metalavaBuildId}/artifacts/repo/m2repository" |
| 33 | def dokkaRepo = "https://androidx.dev/dokka/builds/${dokkaBuildId}/artifacts/repository" |
| 34 | repositories { |
| 35 | google() |
| 36 | mavenCentral() |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 37 | maven { |
| 38 | url metalavaRepo |
| 39 | metadataSources { |
| 40 | mavenPom() |
| 41 | artifact() |
| 42 | } |
| 43 | } |
| 44 | maven { |
| 45 | url dokkaRepo |
| 46 | metadataSources { |
| 47 | mavenPom() |
| 48 | artifact() |
| 49 | } |
| 50 | } |
Aurimas | c36b1d3 | 2022-04-22 23:16:35 +0000 | [diff] [blame] | 51 | gradlePluginPortal().content { |
| 52 | it.includeModule("gradle.plugin.com.github.johnrengelman", "shadow") |
| 53 | it.includeModule("me.champeau.gradle", "japicmp-gradle-plugin") |
| 54 | } |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | ext.repos = [:] |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 58 | } |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 59 | |
Dustin Lam | c93a99d | 2020-12-31 00:08:18 +0000 | [diff] [blame] | 60 | apply from: "$supportRootFolder/buildSrc/dependencies.gradle" |
Jeff Gaston | 5633a81 | 2021-08-13 11:34:58 -0400 | [diff] [blame] | 61 | apply from: "$supportRootFolder/buildSrc/out.gradle" |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 62 | init.chooseOutDir("/${rootProject.name}") |
| 63 | |
| 64 | apply plugin: AndroidXRootPlugin |
| 65 | apply plugin: AndroidXPlaygroundRootPlugin |