1 /* 2 * Copyright (C) 2020 Square, Inc. 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 import me.champeau.gradle.japicmp.JapicmpTask 18 <lambda>null19plugins { 20 `java-library` 21 id("me.champeau.gradle.japicmp") 22 } 23 24 val baseline = configurations.create("baseline") 25 val latest = configurations.create("latest") 26 <lambda>null27dependencies { 28 baseline("com.squareup.moshi:moshi-adapters:1.12.0") { 29 isTransitive = false 30 isForce = true 31 } 32 latest(project(":moshi-adapters")) 33 } 34 <lambda>null35val japicmp = tasks.register<JapicmpTask>("japicmp") { 36 dependsOn("jar") 37 oldClasspath = baseline 38 newClasspath = latest 39 isOnlyBinaryIncompatibleModified = true 40 isFailOnModification = true 41 txtOutputFile = file("$buildDir/reports/japi.txt") 42 isIgnoreMissingClasses = true 43 isIncludeSynthetic = true 44 } 45 <lambda>null46tasks.named("check").configure { 47 dependsOn(japicmp) 48 } 49