@@ -95,9 +95,6 @@ static void Run (CodeGeneratorOptions options, DirectoryAssemblyResolver resolve
9595 resolver . SearchDirectories . Add ( Path . GetDirectoryName ( reference ) ) ;
9696 }
9797
98- var compare_output = @"C:\code\androidx-output" ;
99- var rsp_output = @"C:\Users\jopobst\Desktop\androidx-output" ;
100-
10198 // Figure out if this is class-parse
10299 string apiXmlFile = filename ;
103100 string apiSourceAttr = null ;
@@ -108,15 +105,6 @@ static void Run (CodeGeneratorOptions options, DirectoryAssemblyResolver resolve
108105 }
109106
110107 var is_classparse = apiSourceAttr == "class-parse" ;
111- //var write_compare_files = true;
112-
113-
114- // Save generator.rsp
115- //var rsp = Path.Combine (Environment.CurrentDirectory, "obj", "Release", "monoandroid9.0", "generated", "src", "generator.rsp");
116- //var new_rsp = Path.Combine (rsp_output, Path.GetFileName (Environment.CurrentDirectory) + ".rsp");
117-
118- //File.Copy (rsp, new_rsp, true);
119-
120108
121109 // Resolve types using Java.Interop.Tools.JavaTypeSystem
122110 if ( is_classparse && ! options . UseLegacyJavaResolver ) {
@@ -130,43 +118,8 @@ static void Run (CodeGeneratorOptions options, DirectoryAssemblyResolver resolve
130118 filename = output_xml ;
131119 apiXmlFile = filename ;
132120 is_classparse = false ;
133-
134- //return;
135- // Save generator.rsp
136- //var rsp = Path.Combine (Environment.CurrentDirectory, "obj", "Release", "monoandroid9.0", "generated", "src", "generator.rsp");
137- //var new_rsp = Path.Combine (rsp_output, Path.GetFileName (Environment.CurrentDirectory) + ".rsp");
138-
139- //File.Copy (rsp, new_rsp, true);
140-
141- // Parse api.xml
142- //var type_collection = JavaXmlApiImporter.Parse (filename);
143-
144- //// Add in reference types from assemblies
145- //foreach (var reference in references.Distinct ()) {
146- // Report.Verbose (0, "resolving assembly {0}.", reference);
147- // var assembly = resolver.Load (reference);
148-
149- // ManagedApiImporter.Parse (assembly, type_collection);
150- //}
151-
152- // Run the type resolution pass
153- //type_collection.ResolveCollection ();
154-
155- // Output the adjusted xml
156-
157- //JavaXmlApiExporter.Save (type_collection, output_xml);
158- //JavaXmlApiExporter.Save (type_collection, Path.Combine (compare_output, Path.GetFileName (Environment.CurrentDirectory) + ".txt"));
159- //FormatXml (Path.Combine (compare_output, Path.GetFileName (Environment.CurrentDirectory) + ".txt"));
160-
161- //var compare_file = Path.Combine (compare_output, Path.GetFileName (Environment.CurrentDirectory) + ".txt");
162-
163- //JavaTypeResolutionFixups.Fixup (filename, compare_file, resolver, references.Distinct ().ToArray ());
164- //FormatXml (compare_file);
165-
166121 }
167122
168-
169-
170123 // We don't use shallow referenced types with class-parse because the Adjuster process
171124 // enumerates every ctor/method/property/field to build its model, so we will need
172125 // every type to be fully populated.
@@ -195,12 +148,12 @@ static void Run (CodeGeneratorOptions options, DirectoryAssemblyResolver resolve
195148 }
196149
197150 // For class-parse API description, transform it to jar2xml style.
151+ // Resolve types using ApiXmlAdjuster
198152 if ( is_classparse && options . UseLegacyJavaResolver ) {
199153 apiXmlFile = api_xml_adjuster_output ?? Path . Combine ( Path . GetDirectoryName ( filename ) , Path . GetFileName ( filename ) + ".adjusted" ) ;
200154 new Adjuster ( ) . Process ( filename , opt , opt . SymbolTable . AllRegisteredSymbols ( opt ) . OfType < GenBase > ( ) . ToArray ( ) , apiXmlFile , Report . Verbosity ?? 0 ) ;
201- //new Adjuster ().Process (filename, opt, opt.SymbolTable.AllRegisteredSymbols (opt).OfType<GenBase> ().ToArray (), apiXmlFile, Report.Verbosity ?? 0, Path.Combine (compare_output, Path.GetFileName (Environment.CurrentDirectory) + ".txt"));
202- //FormatXml (Path.Combine (compare_output, Path.GetFileName (Environment.CurrentDirectory) + ".txt"));
203155 }
156+
204157 if ( only_xml_adjuster )
205158 return ;
206159
@@ -298,35 +251,6 @@ static void Run (CodeGeneratorOptions options, DirectoryAssemblyResolver resolve
298251 gen_info . GenerateLibraryProjectFile ( options , enumFiles ) ;
299252 }
300253
301- static void FormatXml ( string filename )
302- {
303- var doc = XDocument . Load ( filename ) ;
304-
305- using var writer = XmlWriter . Create ( filename , new XmlWriterSettings {
306- Encoding = new UTF8Encoding ( false , true ) ,
307- Indent = true ,
308- OmitXmlDeclaration = true ,
309- } ) ;
310-
311- OutputElement ( doc . Root , writer ) ;
312- }
313-
314- static void OutputElement ( XElement ? element , XmlWriter writer )
315- {
316- if ( element is null )
317- return ;
318-
319- writer . WriteStartElement ( element . Name . LocalName ) ;
320-
321- foreach ( var attr in element . Attributes ( ) . OrderBy ( a => a . Name . LocalName ) )
322- writer . WriteAttributeString ( attr . Name . LocalName , attr . Value ) ;
323-
324- foreach ( var elem in element . Elements ( ) . OrderBy ( a => a . XGetAttribute ( "name" ) ) . ThenBy ( a => a . XGetAttribute ( "jni-signature" ) ) )
325- OutputElement ( elem , writer ) ;
326-
327- writer . WriteEndElement ( ) ;
328- }
329-
330254 static void AddTypeToTable ( CodeGenerationOptions opt , GenBase gb )
331255 {
332256 opt . SymbolTable . AddType ( gb ) ;
@@ -407,10 +331,6 @@ internal static void ProcessReferencedType (TypeDefinition td, CodeGenerationOpt
407331 if ( ! td . IsPublic && ! td . IsNested )
408332 return ;
409333
410- // We want to reference the real 'java.util.ArrayList' instead of 'JavaList'
411- if ( td . FullName == "Android.Runtime.JavaList" )
412- return ;
413-
414334 // We want to exclude "IBlahInvoker" types from this type registration.
415335 if ( td . Name . EndsWith ( "Invoker" ) ) {
416336 string n = td . FullName ;
0 commit comments