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 { |
Jim Sproch | bcbd33a | 2022-01-12 14:45:37 -0800 | [diff] [blame] | 35 | maven { |
| 36 | url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/" |
| 37 | } |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 38 | google() |
| 39 | mavenCentral() |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 40 | maven { |
| 41 | url metalavaRepo |
| 42 | metadataSources { |
| 43 | mavenPom() |
| 44 | artifact() |
| 45 | } |
| 46 | } |
| 47 | maven { |
| 48 | url dokkaRepo |
| 49 | metadataSources { |
| 50 | mavenPom() |
| 51 | artifact() |
| 52 | } |
| 53 | } |
David Saff | bf201d9 | 2021-07-01 10:30:01 -0400 | [diff] [blame] | 54 | gradlePluginPortal() |
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 | dependencies { |
Dustin Lam | b8bb8e8 | 2021-08-09 09:47:22 -0700 | [diff] [blame] | 59 | // NOTE: It's not really clear why asm:9.1 must be explicitly declared here since it should |
| 60 | // be provided transitively. |
| 61 | classpath("org.ow2.asm:asm:9.1") |
| 62 | classpath(libs.androidGradlePluginz) |
| 63 | classpath(libs.kotlinGradlePluginz) |
| 64 | classpath(libs.kspGradlePluginz) |
Yigit Boyar | d3ed3e3 | 2021-05-19 13:26:48 -0700 | [diff] [blame] | 65 | classpath(libs.gson) |
Aurimas Liutikas | e1b8458 | 2021-04-23 14:17:30 -0700 | [diff] [blame] | 66 | classpath(libs.shadow) |
Dustin Lam | b8bb8e8 | 2021-08-09 09:47:22 -0700 | [diff] [blame] | 67 | classpath(libs.japicmpPluginz) |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 68 | } |
| 69 | } |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 70 | |
Dustin Lam | c93a99d | 2020-12-31 00:08:18 +0000 | [diff] [blame] | 71 | apply from: "$supportRootFolder/buildSrc/dependencies.gradle" |
Jeff Gaston | 5633a81 | 2021-08-13 11:34:58 -0400 | [diff] [blame] | 72 | apply from: "$supportRootFolder/buildSrc/out.gradle" |
Yigit Boyar | a755f33 | 2020-05-30 19:14:46 -0700 | [diff] [blame] | 73 | init.chooseOutDir("/${rootProject.name}") |
| 74 | |
| 75 | apply plugin: AndroidXRootPlugin |
| 76 | apply plugin: AndroidXPlaygroundRootPlugin |