summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Xavier Ducrohet <xav@android.com> 2009-12-14 17:55:05 -0800
committer Xavier Ducrohet <xav@android.com> 2009-12-14 17:55:05 -0800
commitf9b6d38d07a337f97eed44e2cec3f9534befcb4a (patch)
tree8e291753910cfd33e0a5b911b4e700db93ace0ae
parent502c498fec23cb28d16f5e86e981400f76da36ea (diff)
Add feature list support to DroidDoc.
Similarly to intent actions/categories, DroidDoc look for the FEATURE-type SdkConstant annotation and builds a list of optional features for the platform. This is then packaged with the SDK to be used by the custom editors (manifest editor in this case) Change-Id: Icb5cf14ebd8251017cd850eacfdbb889219b3697
-rw-r--r--tools/droiddoc/src/DroidDoc.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/droiddoc/src/DroidDoc.java b/tools/droiddoc/src/DroidDoc.java
index a1c49f00ef..4e9d6b1629 100644
--- a/tools/droiddoc/src/DroidDoc.java
+++ b/tools/droiddoc/src/DroidDoc.java
@@ -33,6 +33,7 @@ public class DroidDoc
private static final String SDK_CONSTANT_TYPE_BROADCAST_ACTION = "android.annotation.SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION";
private static final String SDK_CONSTANT_TYPE_SERVICE_ACTION = "android.annotation.SdkConstant.SdkConstantType.SERVICE_INTENT_ACTION";
private static final String SDK_CONSTANT_TYPE_CATEGORY = "android.annotation.SdkConstant.SdkConstantType.INTENT_CATEGORY";
+ private static final String SDK_CONSTANT_TYPE_FEATURE = "android.annotation.SdkConstant.SdkConstantType.FEATURE";
private static final String SDK_WIDGET_ANNOTATION = "android.annotation.Widget";
private static final String SDK_LAYOUT_ANNOTATION = "android.annotation.Layout";
@@ -1147,6 +1148,7 @@ public class DroidDoc
ArrayList<String> broadcastActions = new ArrayList<String>();
ArrayList<String> serviceActions = new ArrayList<String>();
ArrayList<String> categories = new ArrayList<String>();
+ ArrayList<String> features = new ArrayList<String>();
ArrayList<ClassInfo> layouts = new ArrayList<ClassInfo>();
ArrayList<ClassInfo> widgets = new ArrayList<ClassInfo>();
@@ -1177,6 +1179,8 @@ public class DroidDoc
serviceActions.add(cValue.toString());
} else if (SDK_CONSTANT_TYPE_CATEGORY.equals(type)) {
categories.add(cValue.toString());
+ } else if (SDK_CONSTANT_TYPE_FEATURE.equals(type)) {
+ features.add(cValue.toString());
}
}
break;
@@ -1245,6 +1249,9 @@ public class DroidDoc
Collections.sort(categories);
writeValues(output + "/categories.txt", categories);
+ Collections.sort(features);
+ writeValues(output + "/features.txt", features);
+
// before writing the list of classes, we do some checks, to make sure the layout params
// are enclosed by a layout class (and not one that has been declared as a widget)
for (int i = 0 ; i < layoutParams.size();) {