@@ -110,6 +110,8 @@ public class DumpApi {
110110 PACKAGE_TO_MODULE .put ("org.apposed.appose.tool.Uv" , "tool/uv.api" );
111111
112112 // Utility packages - singular naming.
113+ PACKAGE_TO_MODULE .put ("org.apposed.appose.util.Downloads" , "util/download.api" );
114+ PACKAGE_TO_MODULE .put ("org.apposed.appose.util.Environments" , "util/environment.api" );
113115 PACKAGE_TO_MODULE .put ("org.apposed.appose.util.FilePaths" , "util/filepath.api" );
114116 PACKAGE_TO_MODULE .put ("org.apposed.appose.util.Platforms" , "util/platform.api" );
115117 PACKAGE_TO_MODULE .put ("org.apposed.appose.util.Processes" , "util/process.api" );
@@ -124,6 +126,8 @@ public class DumpApi {
124126 private static final Set <String > STATIC_UTILITY_CLASSES = new HashSet <>(Arrays .asList (
125127 "org.apposed.appose.Appose" ,
126128 "org.apposed.appose.builder.Builders" ,
129+ "org.apposed.appose.util.Downloads" ,
130+ "org.apposed.appose.util.Environments" ,
127131 "org.apposed.appose.util.FilePaths" ,
128132 "org.apposed.appose.util.Platforms" ,
129133 "org.apposed.appose.util.Processes" ,
@@ -329,27 +333,27 @@ static void dumpStaticUtilityAsModuleFunctions(TypeDeclaration<?> type) {
329333 }
330334 }
331335
332- // Output public static fields as module-level constants.
336+ // Output static fields as module-level constants (public and private if INCLUDE_PRIVATE) .
333337 for (BodyDeclaration <?> member : type .getMembers ()) {
334338 if (member instanceof FieldDeclaration ) {
335339 FieldDeclaration field = (FieldDeclaration ) member ;
336- if (field .isPublic () && field .isStatic ( )) {
340+ if (field .isStatic () && ( field .isPublic () || INCLUDE_PRIVATE )) {
337341 for (VariableDeclarator var : field .getVariables ()) {
338- String fieldName = toSnakeCase ( var . getNameAsString () ).toUpperCase ();
342+ String fieldName = nonClassName ( field , var ).toUpperCase ();
339343 String fieldType = pythonType (var .getType ());
340344 out .println (fieldName + ": " + fieldType );
341345 }
342346 }
343347 }
344348 }
345349
346- // Collect all public static methods.
350+ // Collect all static methods (public and private if INCLUDE_PRIVATE) .
347351 Map <String , List <MethodDeclaration >> methodsByName = new LinkedHashMap <>();
348352 for (BodyDeclaration <?> member : type .getMembers ()) {
349353 if (member instanceof MethodDeclaration ) {
350354 MethodDeclaration method = (MethodDeclaration ) member ;
351- if (method .isPublic () && method .isStatic ( )) {
352- String methodName = toSnakeCase (method . getNameAsString () );
355+ if (method .isStatic () && ( method .isPublic () || INCLUDE_PRIVATE )) {
356+ String methodName = nonClassName (method );
353357 methodsByName .computeIfAbsent (methodName , k -> new ArrayList <>()).add (method );
354358 }
355359 }
@@ -454,7 +458,7 @@ static String formatParameterType(Parameter param) {
454458 static String formatModuleFunction (MethodDeclaration method ) {
455459 StringBuilder sb = new StringBuilder ("def " );
456460
457- String methodName = toSnakeCase (method . getNameAsString () );
461+ String methodName = nonClassName (method );
458462 sb .append (methodName ).append ("(" );
459463
460464 NodeList <Parameter > params = method .getParameters ();
@@ -488,7 +492,7 @@ static String formatModuleFunctionWithOptionalParams(List<MethodDeclaration> met
488492
489493 StringBuilder sb = new StringBuilder ("def " );
490494
491- String methodName = toSnakeCase (longest . getNameAsString () );
495+ String methodName = nonClassName (longest );
492496 sb .append (methodName ).append ("(" );
493497
494498 NodeList <Parameter > params = longest .getParameters ();
0 commit comments