Add dummy classes to dump all classes loaded as part of packaging modules to ensure javadoc and sources jars are getting created
This commit is contained in:
committed by
vinoth chandar
parent
f44bcc5b03
commit
2728f96505
@@ -16,12 +16,16 @@
|
||||
|
||||
package com.uber.hoodie.common.util;
|
||||
|
||||
import com.google.common.reflect.ClassPath;
|
||||
import com.google.common.reflect.ClassPath.ClassInfo;
|
||||
import com.uber.hoodie.common.model.HoodieRecordPayload;
|
||||
import com.uber.hoodie.exception.HoodieException;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class ReflectionUtils {
|
||||
|
||||
@@ -82,4 +86,17 @@ public class ReflectionUtils {
|
||||
.map(arg -> arg.getClass()).toArray(Class<?>[]::new);
|
||||
return loadClass(clazz, constructorArgTypes, constructorArgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return stream of top level class names in the same class path as passed-in class
|
||||
* @param clazz
|
||||
*/
|
||||
public static Stream<String> getTopLevelClassesInClasspath(Class clazz) {
|
||||
try {
|
||||
ClassPath classPath = ClassPath.from(clazz.getClassLoader());
|
||||
return classPath.getTopLevelClasses().stream().map(ClassInfo::getName);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Got exception while dumping top level classes", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user