blob: 494d8086339df472403d30b21ab069c11191fd91 [file] [log] [blame]
/*
* Copyright 2021 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.
*/
pluginManagement {
repositories {
mavenCentral()
google()
gradlePluginPortal().content {
it.includeModule("org.jetbrains.kotlin.jvm", "org.jetbrains.kotlin.jvm.gradle.plugin")
}
}
}
dependencyResolutionManagement {
repositories {
mavenCentral()
google()
gradlePluginPortal().content {
it.includeModule("com.gradle", "develocity-gradle-plugin")
it.includeModule("com.gradle", "common-custom-user-data-gradle-plugin")
it.includeModule("org.spdx", "spdx-gradle-plugin")
it.includeModule("com.gradleup.shadow",
"com.gradleup.shadow.gradle.plugin")
it.includeModule("com.gradleup.shadow", "shadow-gradle-plugin")
}
}
}
apply from: "shared/src/main/groovy/out-setup.groovy"
getGradle().beforeProject { project ->
init.chooseBuildDirectory(
new File("${buildscript.sourceFile.parent}/../.."), rootProject.name, project
)
}
System.setProperty("ALLOW_PUBLIC_REPOS", "true")
rootProject.name = "playground-plugin"
includeBuild("../../buildSrc") {
// cannot use name buildSrc, it is reserved.
name = "supportBuildSrc"
dependencySubstitution {
substitute module('supportBuildSrc:public') using project(':public')
substitute module('supportBuildSrc:private') using project(':private')
substitute module('supportBuildSrc:plugins') using project(':plugins')
}
}
include(":shared")
// Build cache configuration is duplicated here from the GradleEnterpriseConventionsPlugin,
// so that when building the `playground-plugin` included build the same build cache settings will be used.
// Without this, Gradle Enterprise erroneously reports a problem with 'buildSrc' build cache configuration.
def isCI = System.getenv("CI") == "true"
buildCache {
local {
// Aggressively clean up stale build cache entries on CI
if (isCI) {
removeUnusedEntriesAfterDays = 1
}
}
remote(HttpBuildCache) {
url = "https://ge.androidx.dev/cache/"
var buildCachePassword = System.getenv("GRADLE_BUILD_CACHE_PASSWORD")
if (isCI && buildCachePassword != null && !buildCachePassword.empty) {
push = true
credentials {
username = "ci"
password = buildCachePassword
}
} else {
push = false
}
}
}