Skip to content

Commit 0b2d8b5

Browse files
authored
Merge pull request #433 from gradle/fix_JavaCompileWorkaround
Check if schema exists to avoid JavaCompileWorkaround issue
2 parents cba90de + 0fe9889 commit 0b2d8b5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/main/groovy/org/gradle/android/workarounds/room/JavaCompileWorkaround.groovy

+9-7
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,15 @@ class JavaCompileWorkaround extends AnnotationProcessorWorkaround<JavaCompilerRo
116116
}
117117

118118
static void copyExistingSchemasToTaskSpecificTmpDir(FileOperations fileOperations, Provider<Directory> existingSchemaDir, JavaCompilerRoomSchemaLocationArgumentProvider provider) {
119-
// Derive the variant directory from the command line provider it is configured with
120-
def variantSpecificSchemaDir = provider.schemaLocationDir
121-
122-
// Populate the variant-specific temporary schema dir with the existing schemas
123-
fileOperations.sync {
124-
it.from existingSchemaDir
125-
it.into variantSpecificSchemaDir
119+
if (existingSchemaDir.isPresent()) {
120+
// Derive the variant directory from the command line provider it is configured with
121+
def variantSpecificSchemaDir = provider.schemaLocationDir
122+
123+
// Populate the variant-specific temporary schema dir with the existing schemas
124+
fileOperations.sync {
125+
it.from existingSchemaDir
126+
it.into variantSpecificSchemaDir
127+
}
126128
}
127129
}
128130

0 commit comments

Comments
 (0)