Skip to content

Commit deb1c48

Browse files
committed
tidy up BCVApiCheckTask
1 parent 97dfd29 commit deb1c48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/bcv-gradle-plugin/src/main/kotlin/tasks/BCVApiCheckTask.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ abstract class BCVApiCheckTask @Inject constructor(
8888
val builtFilePath = allBuiltFilePaths.singleOrNull()
8989
?: error("Expected a single file ${expectedProjectName.get()}.api, but found ${allBuiltFilePaths.size}: $allBuiltFilePaths")
9090

91-
if (builtFilePath !in allCheckFilePaths) {
91+
if (builtApiDeclaration == null || builtFilePath !in allCheckFilePaths) {
9292
val relativeDirPath = projectApiDir.get().toRelativeString(rootDir) + File.separator
9393
error(
9494
"File ${builtFilePath.lastName} is missing from ${relativeDirPath}, please run '$apiDumpTaskPath' task to generate one"
@@ -97,7 +97,7 @@ abstract class BCVApiCheckTask @Inject constructor(
9797

9898
val diff = compareFiles(
9999
checkFile = checkApiDeclaration,
100-
builtFile = builtFilePath.getFile(builtApiDeclaration!!.parentFile!!),
100+
builtFile = builtApiDeclaration,
101101
)
102102
val diffSet = mutableSetOf<String>()
103103
if (diff != null) diffSet.add(diff)

0 commit comments

Comments
 (0)