Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public JavaApi ()
}

public string ExtendedApiSource { get; set; }
public string Platform { get; set; }
public IList<JavaPackage> Packages { get; set; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public static void Save (this JavaApi api, string xmlfile)
public static void Save (this JavaApi api, XmlWriter writer)
{
writer.WriteStartElement ("api");

if (api.Platform != null)
writer.WriteAttributeString ("platform", api.Platform);

foreach (var pkg in api.Packages) {
if (!pkg.Types.Any (t => !t.IsReferenceOnly))
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public static void Load (this JavaApi api, XmlReader reader, bool isReferenceOnl
if (reader.LocalName != "api")
throw XmlUtil.UnexpectedElementOrContent (null, reader, "api");
api.ExtendedApiSource = reader.GetAttribute ("api-source");
XmlUtil.CheckExtraneousAttributes ("api", reader, "api-source");
api.Platform = reader.GetAttribute ("platform");
XmlUtil.CheckExtraneousAttributes ("api", reader, "api-source", "platform");
if (reader.IsEmptyElement)
reader.Read ();
else {
Expand Down
10 changes: 10 additions & 0 deletions src/Xamarin.Android.Tools.Bytecode/ClassPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class ClassPath {

public IEnumerable<string> DocumentationPaths { get; set; }

public string AndroidFrameworkPlatform { get; set; }

public bool AutoRename { get; set; }

public ClassPath (string path = null)
Expand Down Expand Up @@ -109,6 +111,13 @@ XAttribute GetApiSource ()
return new XAttribute ("api-source", ApiSource);
}

XAttribute GetPlatform ()
{
if (string.IsNullOrEmpty (AndroidFrameworkPlatform))
return null;
return new XAttribute ("platform", AndroidFrameworkPlatform);
}

bool IsGeneratedName (string parameterName)
{
return parameterName.StartsWith ("p") && parameterName.Length > 1 && Char.IsDigit (parameterName [1]);
Expand Down Expand Up @@ -311,6 +320,7 @@ public XElement ToXElement ()
var packagesDictionary = GetPackages ();
var api = new XElement ("api",
GetApiSource (),
GetPlatform (),
packagesDictionary.Keys.OrderBy (p => p, StringComparer.OrdinalIgnoreCase)
.Select (p => new XElement ("package",
new XAttribute ("name", p),
Expand Down
5 changes: 5 additions & 0 deletions tools/class-parse/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static void Main (string[] args)
int verbosity = 0;
bool autorename = false;
var outputFile = (string) null;
string platform = null;
var docsPaths = new List<string> ();
var p = new OptionSet () {
"usage: class-dump [-dump] FILES",
Expand All @@ -48,6 +49,9 @@ public static void Main (string[] args)
{ "autorename",
"Renames parameter names in the interfaces by derived classes.",
v => autorename = v != null },
{ "platform=",
"(Internal use only) specify Android framework platform ID",
v => platform = v },
{ "h|?|help",
"Show this message and exit.",
v => help = v != null },
Expand All @@ -65,6 +69,7 @@ public static void Main (string[] args)
};
var classPath = new ClassPath () {
ApiSource = "class-parse",
AndroidFrameworkPlatform = platform,
DocumentationPaths = docsPaths.Count == 0 ? null : docsPaths,
DocletType = docsType,
AutoRename = autorename
Expand Down