Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ junit = "6.0.1"
nmcp = "1.4.3"
picocli = "4.7.7"
protobuf-plugin = "0.9.6"
protobuf = "3.25.8"
protobuf = "4.33.2"
scala-library = "2.12.21"
scalatest = "3.2.19"
scalatestplus-junit5 = "3.2.19.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.substrait.isthmus.cli;

import com.google.protobuf.DescriptorProtos;
import com.google.protobuf.Empty;
import com.google.protobuf.GeneratedMessageV3;
import com.google.protobuf.GeneratedMessage;
import com.google.protobuf.MessageLite;
import com.google.protobuf.ProtocolMessageEnum;
import io.github.classgraph.ClassGraph;
Expand Down Expand Up @@ -54,10 +55,11 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {

// Empty class
register(Empty.class);
registerDeclaredClassesRecursively(DescriptorProtos.class);

try (PackageScanner substrait = new PackageScanner("io.substrait")) {
// protobuf items
substrait.registerByParent(GeneratedMessageV3.class);
substrait.registerByParent(GeneratedMessage.class);
substrait.registerByParent(MessageLite.Builder.class);
substrait.registerByParent(ProtocolMessageEnum.class);

Expand Down Expand Up @@ -131,6 +133,13 @@ private static void register(Class<?> c) {
RuntimeReflection.register(c.getMethods());
}

private static void registerDeclaredClassesRecursively(Class<?> c) {
register(c);
for (Class<?> declaredClass : c.getDeclaredClasses()) {
registerDeclaredClassesRecursively(declaredClass);
}
}

private static final class PackageScanner implements AutoCloseable {
private final ScanResult scan;

Expand Down