Bug 1448428 - Part 1b: Maintain "unified" GeneratedJNI{Natives,Wrappers}.h header. r=snorp,geckoview-reviewers

It's not trivial to split the existing "unified" include declaration
into granular include declarations, so we continue generating a
unified header that can be incrementally abandoned until it can be
jettisoned.

Depends on D58572

Differential Revision: https://phabricator.services.mozilla.com/D58573
This commit is contained in:
Nick Alexander 2020-05-12 23:02:07 +00:00
Родитель 09bb5a923b
Коммит ee100fb1bf
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -50,6 +50,12 @@ public class AnnotationProcessor {
int ret = 0;
final String unifiedHeaderFileName = OUTPUT_PREFIX + "JNIWrappers.h";
final String unifiedNativesFileName = OUTPUT_PREFIX + "JNINatives.h";
final StringBuilder unifiedHeaderFile = new StringBuilder(GENERATED_COMMENT);
final StringBuilder unifiedNativesFile = new StringBuilder(GENERATED_COMMENT);
// Get an iterator over the classes in the jar files given...
Iterator<ClassWithOptions> jarClassIterator = IterableJarLoadingURLClassLoader.getIteratorOverJars(jars);
@ -63,6 +69,9 @@ public class AnnotationProcessor {
final String headerFileName = OUTPUT_PREFIX + annotatedClass.generatedName + "JNIWrappers.h";
final String nativesFileName = OUTPUT_PREFIX + annotatedClass.generatedName + "JNINatives.h";
unifiedHeaderFile.append("#include \"" + headerFileName + "\"\n"); // annotatedClass.generatedName + "JNIWrappers.h\"\n");
unifiedNativesFile.append("#include \"" + nativesFileName + "\"\n"); // annotatedClass.generatedName + "JNINatives.h\"\n");
final StringBuilder headerFile = new StringBuilder(GENERATED_COMMENT);
final StringBuilder implementationFile = new StringBuilder(GENERATED_COMMENT);
final StringBuilder nativesFile = new StringBuilder(GENERATED_COMMENT);
@ -123,6 +132,9 @@ public class AnnotationProcessor {
ret |= writeOutputFile(nativesFileName, nativesFile);
}
ret |= writeOutputFile(unifiedHeaderFileName, unifiedHeaderFile);
ret |= writeOutputFile(unifiedNativesFileName, unifiedNativesFile);
long e = System.currentTimeMillis();
System.out.println("Annotation processing complete in " + (e - s) + "ms");

Просмотреть файл

@ -86,6 +86,7 @@ classes_with_WrapForJNI = [
]
headers_from_WrapForJNI = sorted(
['GeneratedJNINatives.h', 'GeneratedJNIWrappers.h'] +
['Generated{}JNINatives.h'.format(c) for c in classes_with_WrapForJNI] +
['Generated{}JNIWrappers.h'.format(c) for c in classes_with_WrapForJNI])