[go: nahoru, domu]

blob: b01e5cb524202fcded1de35e65510b238e570de9 [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"]
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 Sprochbcbd33a2022-01-12 14:45:37 -080035 maven {
36 url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/"
37 }
Yigit Boyara755f332020-05-30 19:14:46 -070038 google()
39 mavenCentral()
Yigit Boyara755f332020-05-30 19:14:46 -070040 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 Saffbf201d92021-07-01 10:30:01 -040054 gradlePluginPortal()
Yigit Boyara755f332020-05-30 19:14:46 -070055 }
56
57 ext.repos = [:]
Yigit Boyara755f332020-05-30 19:14:46 -070058 dependencies {
Dustin Lamb8bb8e82021-08-09 09:47:22 -070059 // 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 Boyard3ed3e32021-05-19 13:26:48 -070065 classpath(libs.gson)
Aurimas Liutikase1b84582021-04-23 14:17:30 -070066 classpath(libs.shadow)
Dustin Lamb8bb8e82021-08-09 09:47:22 -070067 classpath(libs.japicmpPluginz)
Yigit Boyara755f332020-05-30 19:14:46 -070068 }
69}
Yigit Boyara755f332020-05-30 19:14:46 -070070
Dustin Lamc93a99d2020-12-31 00:08:18 +000071apply from: "$supportRootFolder/buildSrc/dependencies.gradle"
Jeff Gaston5633a812021-08-13 11:34:58 -040072apply from: "$supportRootFolder/buildSrc/out.gradle"
Yigit Boyara755f332020-05-30 19:14:46 -070073init.chooseOutDir("/${rootProject.name}")
74
75apply plugin: AndroidXRootPlugin
76apply plugin: AndroidXPlaygroundRootPlugin