| // Copyright 2016 The Cobalt Authors. All Rights Reserved. |
| // |
| // 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. |
| |
| // Top-level build file where you can add configuration options common to all sub-projects/modules. |
| |
| buildscript { |
| repositories { |
| google() |
| jcenter() |
| } |
| dependencies { |
| classpath 'com.android.tools.build:gradle:7.0.2' |
| |
| // NOTE: Do not place your application dependencies here; they belong |
| // in the individual module build.gradle files |
| } |
| } |
| |
| allprojects { |
| repositories { |
| google() |
| jcenter() |
| } |
| gradle.projectsEvaluated { |
| tasks.withType(JavaCompile) { |
| options.compilerArgs += [ |
| "-Xlint:unchecked", |
| "-Xlint:deprecation", |
| ] |
| } |
| } |
| } |
| |
| task clean(type: Delete) { |
| delete rootProject.buildDir |
| } |
| |
| // Move the 'buildDir' for all projects into sub-directories of a shared top-level build directory, |
| // which is either the root's original 'buildDir' or a custom location when building for platform |
| // deploy. Note that the platform deploy action sets a custom 'cobaltGradleDir' property rather |
| // than setting 'buildDir' directly on the command line since Gradle tries to get smart about |
| // 'buildDir' which can end up putting it at the wrong depth in the file system. |
| def rootBuildDir = hasProperty('cobaltGradleDir') ? new File(cobaltGradleDir, 'build') : buildDir |
| allprojects { buildDir = new File(rootBuildDir, project.name).canonicalFile } |
| |
| // Android Studio Gradle plugin 3.5+ builds all supported ABIs for a connected device. Override the |
| // property it sets to build just the first one, which is the preferred ABI for the device. |
| if (hasProperty('android.injected.build.abi')) { |
| def firstAbi = properties.get('android.injected.build.abi').split(',').first() |
| allprojects { setProperty('android.injected.build.abi', firstAbi) } |
| } |