diff options
Diffstat (limited to 'build.gradle')
| -rw-r--r-- | build.gradle | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..30ce363 --- /dev/null +++ b/build.gradle | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2020 Google LLC | ||
| 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 | * https://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 | buildscript { | ||
| 18 | |||
| 19 | ext { | ||
| 20 | // Top-level variables used for versioning | ||
| 21 | ext.kotlin_version = '1.5.21' | ||
| 22 | ext.java_version = JavaVersion.VERSION_1_8 | ||
| 23 | } | ||
| 24 | |||
| 25 | repositories { | ||
| 26 | google() | ||
| 27 | mavenCentral() | ||
| 28 | } | ||
| 29 | |||
| 30 | dependencies { | ||
| 31 | classpath 'com.android.tools.build:gradle:7.4.2' | ||
| 32 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
| 33 | classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.11.1' | ||
| 34 | } | ||
| 35 | } | ||
| 36 | |||
| 37 | allprojects { | ||
| 38 | repositories { | ||
| 39 | google() | ||
| 40 | mavenCentral() | ||
| 41 | maven { // repo for TFLite snapshot | ||
| 42 | name 'ossrh-snapshot' | ||
| 43 | url 'https://s01.oss.sonatype.org/content/repositories/snapshots' | ||
| 44 | } | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | subprojects { | ||
| 49 | apply plugin: 'com.diffplug.spotless' | ||
| 50 | spotless { | ||
| 51 | java { | ||
| 52 | target "**/*.java" | ||
| 53 | trimTrailingWhitespace() | ||
| 54 | removeUnusedImports() | ||
| 55 | googleJavaFormat() | ||
| 56 | endWithNewline() | ||
| 57 | } | ||
| 58 | kotlin { | ||
| 59 | target "**/*.kt" | ||
| 60 | trimTrailingWhitespace() | ||
| 61 | endWithNewline() | ||
| 62 | } | ||
| 63 | } | ||
| 64 | } | ||
