@@ -15,12 +15,14 @@ class App {
1515
1616 public static void Main ( string [ ] args )
1717 {
18+ JavaDocletType docsType = 0 ;
19+
1820 bool dump = false ;
1921 bool help = false ;
2022 int verbosity = 0 ;
2123 bool autorename = false ;
2224 var outputFile = ( string ) null ;
23- var docsPath = ( string ) null ;
25+ var docsPaths = new List < string > ( ) ;
2426 var p = new OptionSet ( ) {
2527 "usage: class-dump [-dump] FILES" ,
2628 "" ,
@@ -34,8 +36,12 @@ public static void Main (string[] args)
3436 "Write output to {PATH}." ,
3537 v => outputFile = v } ,
3638 { "docspath=" ,
37- "Android documentation path for parameter fixup" ,
38- doc => docsPath = doc } ,
39+ "Documentation {PATH} for parameter fixup" ,
40+ doc => docsPaths . Add ( doc ) } ,
41+ { "docstype=" ,
42+ "{TYPE} of the docs within --docspath. Values:\n " +
43+ string . Join ( "\n " , JavaDocletTypeMapping . Keys . OrderBy ( s => s ) ) ,
44+ t => docsType = GetJavaDocletType ( t ) } ,
3945 { "v|verbose:" ,
4046 "See stack traces on error." ,
4147 ( int ? v ) => verbosity = v . HasValue ? v . Value : verbosity + 1 } ,
@@ -59,7 +65,8 @@ public static void Main (string[] args)
5965 } ;
6066 var classPath = new ClassPath ( ) {
6167 ApiSource = "class-parse" ,
62- DocumentationPaths = ! string . IsNullOrEmpty ( docsPath ) ? new string [ ] { docsPath } : null ,
68+ DocumentationPaths = docsPaths . Count == 0 ? null : docsPaths ,
69+ DocletType = docsType ,
6370 AutoRename = autorename
6471 } ;
6572 foreach ( var file in files ) {
@@ -81,6 +88,21 @@ public static void Main (string[] args)
8188 output . Close ( ) ;
8289 }
8390
91+ static Dictionary < string , JavaDocletType > JavaDocletTypeMapping = new Dictionary < string , JavaDocletType > {
92+ { "droiddoc" , JavaDocletType . DroidDoc } ,
93+ { "java6" , JavaDocletType . Java6 } ,
94+ { "java7" , JavaDocletType . Java7 } ,
95+ { "java8" , JavaDocletType . Java8 } ,
96+ } ;
97+
98+ static JavaDocletType GetJavaDocletType ( string value )
99+ {
100+ JavaDocletType type ;
101+ if ( value != null && JavaDocletTypeMapping . TryGetValue ( value . ToLowerInvariant ( ) , out type ) )
102+ return type ;
103+ return JavaDocletType . DroidDoc ;
104+ }
105+
84106 static void DumpFileToXml ( ClassPath jar , string file )
85107 {
86108 using ( var s = File . OpenRead ( file ) ) {
0 commit comments