blob: b01e5cb524202fcded1de35e65510b238e570de9 [file] [log] [blame]
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import androidx.build.AndroidXPlaygroundRootPlugin
import androidx.build.AndroidXRootPlugin
// A generic build.gradle file for all playground projects that sets it up to use public artifacts.
// See README.md for details
buildscript {
def playgroundCommonFolder = rootProject.buildFile.parentFile
ext.supportRootFolder = playgroundCommonFolder.parentFile
def metalavaBuildId = rootProject.properties["androidx.playground.metalavaBuildId"]
def dokkaBuildId = rootProject.properties["androidx.playground.dokkaBuildId"]
if (metalavaBuildId == null || dokkaBuildId == null) {
throw new GradleException("metalava and or dokka build ids must be defined.")
}
def metalavaRepo = "https://androidx.dev/metalava/builds/${metalavaBuildId}/artifacts/repo/m2repository"
def dokkaRepo = "https://androidx.dev/dokka/builds/${dokkaBuildId}/artifacts/repository"
repositories {
maven {
url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/"
}
google()
mavenCentral()
maven {
url metalavaRepo
metadataSources {
mavenPom()
artifact()
}
}
maven {
url dokkaRepo
metadataSources {
mavenPom()
artifact()
}
}
gradlePluginPortal()
}
ext.repos = [:]
dependencies {
// NOTE: It's not really clear why asm:9.1 must be explicitly declared here since it should
// be provided transitively.
classpath("org.ow2.asm:asm:9.1")
classpath(libs.androidGradlePluginz)
classpath(libs.kotlinGradlePluginz)
classpath(libs.kspGradlePluginz)
classpath(libs.gson)
classpath(libs.shadow)
classpath(libs.japicmpPluginz)
}
}
apply from: "$supportRootFolder/buildSrc/dependencies.gradle"
apply from: "$supportRootFolder/buildSrc/out.gradle"
init.chooseOutDir("/${rootProject.name}")
apply plugin: AndroidXRootPlugin
apply plugin: AndroidXPlaygroundRootPlugin