xref: /aosp_15_r20/external/moshi/moshi-adapters/japicmp/build.gradle.kts (revision 238ab3e782f339ab327592a602fa7df0a3f729ad)
1*238ab3e7SAndroid Build Coastguard Worker /*
2*238ab3e7SAndroid Build Coastguard Worker  * Copyright (C) 2020 Square, Inc.
3*238ab3e7SAndroid Build Coastguard Worker  *
4*238ab3e7SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*238ab3e7SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*238ab3e7SAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*238ab3e7SAndroid Build Coastguard Worker  *
8*238ab3e7SAndroid Build Coastguard Worker  *    https://www.apache.org/licenses/LICENSE-2.0
9*238ab3e7SAndroid Build Coastguard Worker  *
10*238ab3e7SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*238ab3e7SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*238ab3e7SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*238ab3e7SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*238ab3e7SAndroid Build Coastguard Worker  * limitations under the License.
15*238ab3e7SAndroid Build Coastguard Worker  */
16*238ab3e7SAndroid Build Coastguard Worker 
17*238ab3e7SAndroid Build Coastguard Worker import me.champeau.gradle.japicmp.JapicmpTask
18*238ab3e7SAndroid Build Coastguard Worker 
<lambda>null19*238ab3e7SAndroid Build Coastguard Worker plugins {
20*238ab3e7SAndroid Build Coastguard Worker   `java-library`
21*238ab3e7SAndroid Build Coastguard Worker   id("me.champeau.gradle.japicmp")
22*238ab3e7SAndroid Build Coastguard Worker }
23*238ab3e7SAndroid Build Coastguard Worker 
24*238ab3e7SAndroid Build Coastguard Worker val baseline = configurations.create("baseline")
25*238ab3e7SAndroid Build Coastguard Worker val latest = configurations.create("latest")
26*238ab3e7SAndroid Build Coastguard Worker 
<lambda>null27*238ab3e7SAndroid Build Coastguard Worker dependencies {
28*238ab3e7SAndroid Build Coastguard Worker   baseline("com.squareup.moshi:moshi-adapters:1.12.0") {
29*238ab3e7SAndroid Build Coastguard Worker     isTransitive = false
30*238ab3e7SAndroid Build Coastguard Worker     isForce = true
31*238ab3e7SAndroid Build Coastguard Worker   }
32*238ab3e7SAndroid Build Coastguard Worker   latest(project(":moshi-adapters"))
33*238ab3e7SAndroid Build Coastguard Worker }
34*238ab3e7SAndroid Build Coastguard Worker 
<lambda>null35*238ab3e7SAndroid Build Coastguard Worker val japicmp = tasks.register<JapicmpTask>("japicmp") {
36*238ab3e7SAndroid Build Coastguard Worker   dependsOn("jar")
37*238ab3e7SAndroid Build Coastguard Worker   oldClasspath = baseline
38*238ab3e7SAndroid Build Coastguard Worker   newClasspath = latest
39*238ab3e7SAndroid Build Coastguard Worker   isOnlyBinaryIncompatibleModified = true
40*238ab3e7SAndroid Build Coastguard Worker   isFailOnModification = true
41*238ab3e7SAndroid Build Coastguard Worker   txtOutputFile = file("$buildDir/reports/japi.txt")
42*238ab3e7SAndroid Build Coastguard Worker   isIgnoreMissingClasses = true
43*238ab3e7SAndroid Build Coastguard Worker   isIncludeSynthetic = true
44*238ab3e7SAndroid Build Coastguard Worker }
45*238ab3e7SAndroid Build Coastguard Worker 
<lambda>null46*238ab3e7SAndroid Build Coastguard Worker tasks.named("check").configure {
47*238ab3e7SAndroid Build Coastguard Worker   dependsOn(japicmp)
48*238ab3e7SAndroid Build Coastguard Worker }
49