Loading packages/SettingsLib/Metadata/processor/src/com/android/settingslib/metadata/PreferenceScreenAnnotationProcessor.kt +9 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,15 @@ class PreferenceScreenAnnotationProcessor : AbstractProcessor() { ) } } processingEnv.filer.createSourceFile("$outputPkg.$outputClass").openWriter().use { val javaFileObject = try { processingEnv.filer.createSourceFile("$outputPkg.$outputClass") } catch (e: Exception) { // quick fix: gradle runs this processor twice unexpectedly warn("cannot createSourceFile: $e") return } javaFileObject.openWriter().use { it.write("package $outputPkg;\n\n") it.write("import $PACKAGE.$PREFERENCE_SCREEN_METADATA;\n\n") it.write("// Generated by annotation processor for @$ANNOTATION_NAME\n") Loading Loading
packages/SettingsLib/Metadata/processor/src/com/android/settingslib/metadata/PreferenceScreenAnnotationProcessor.kt +9 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,15 @@ class PreferenceScreenAnnotationProcessor : AbstractProcessor() { ) } } processingEnv.filer.createSourceFile("$outputPkg.$outputClass").openWriter().use { val javaFileObject = try { processingEnv.filer.createSourceFile("$outputPkg.$outputClass") } catch (e: Exception) { // quick fix: gradle runs this processor twice unexpectedly warn("cannot createSourceFile: $e") return } javaFileObject.openWriter().use { it.write("package $outputPkg;\n\n") it.write("import $PACKAGE.$PREFERENCE_SCREEN_METADATA;\n\n") it.write("// Generated by annotation processor for @$ANNOTATION_NAME\n") Loading