CB-5490: add javadoc target to ant script

- add javadoc target to ant script. It must be invoked explicitly to run.
- ignore the generated javadoc html directories.
- clean up javadoc errors in source files.
- upon invoking 'clean' target, erase generated jar and javadoc
This commit is contained in:
Marcel Kinard 2013-11-26 12:56:23 -05:00
parent b621c3e4c4
commit 6160ca6e30
10 changed files with 68 additions and 25 deletions

2
.gitignore vendored
View File

@ -14,6 +14,8 @@ framework/assets/www/.DS_Store
framework/assets/www/cordova-*.js framework/assets/www/cordova-*.js
framework/assets/www/phonegap-*.js framework/assets/www/phonegap-*.js
framework/libs framework/libs
framework/javadoc-public
framework/javadoc-private
test/libs test/libs
example example
./test ./test

View File

@ -95,6 +95,13 @@
<target name="-post-compile"> <target name="-post-compile">
</target> </target>
--> -->
<target name="-pre-clean">
<!-- delete generated javadoc -->
<delete dir="javadoc-public" failonerror="false" />
<delete dir="javadoc-private" failonerror="false" />
<!-- delete generated jar -->
<delete file="cordova-${version}.jar" failonerror="false" />
</target>
<!-- Import the actual build file. <!-- Import the actual build file.
@ -120,7 +127,31 @@
that includes all JavaScript code. that includes all JavaScript code.
--> -->
<target name="jar" depends="-compile"> <target name="jar" depends="-compile">
<jar jarfile="cordova-${version}.jar" basedir="bin/classes" excludes="org/apache/cordova/R.class,org/apache/cordova/R$*.class"/> <jar
basedir="bin/classes"
excludes="org/apache/cordova/R.class,org/apache/cordova/R$*.class"
jarfile="cordova-${version}.jar" />
</target>
<target name="javadoc">
<delete dir="javadoc-public" failonerror="false" />
<javadoc
access="public"
destdir="javadoc-public"
classpath="${sdk.dir}/platforms/${target}/android.jar">
<packageset dir="src">
<include name="org/apache/cordova/**" />
</packageset>
</javadoc>
<delete dir="javadoc-private" failonerror="false" />
<javadoc
access="private"
destdir="javadoc-private"
classpath="${sdk.dir}/platforms/${target}/android.jar">
<packageset dir="src">
<include name="org/apache/cordova/**" />
</packageset>
</javadoc>
</target> </target>
<!-- tests for Java files --> <!-- tests for Java files -->

View File

@ -208,7 +208,7 @@ public class Config {
* Determine if URL is in approved list of URLs to load. * Determine if URL is in approved list of URLs to load.
* *
* @param url * @param url
* @return * @return true if whitelisted
*/ */
public static boolean isUrlWhiteListed(String url) { public static boolean isUrlWhiteListed(String url) {
if (self == null) { if (self == null) {

View File

@ -63,13 +63,14 @@ import android.widget.LinearLayout;
* html file that contains the application. * html file that contains the application.
* *
* As an example: * As an example:
* *
* <pre>
* package org.apache.cordova.examples; * package org.apache.cordova.examples;
* import android.os.Bundle; * import android.os.Bundle;
* import org.apache.cordova.*; * import org.apache.cordova.*;
* *
* public class Example extends CordovaActivity { * public class Example extends CordovaActivity {
* @Override * &#64;Override
* public void onCreate(Bundle savedInstanceState) { * public void onCreate(Bundle savedInstanceState) {
* super.onCreate(savedInstanceState); * super.onCreate(savedInstanceState);
* *
@ -85,9 +86,11 @@ import android.widget.LinearLayout;
* super.loadUrl("file:///android_asset/www/index.html", 3000); // show splash screen 3 sec before loading app * super.loadUrl("file:///android_asset/www/index.html", 3000); // show splash screen 3 sec before loading app
* } * }
* } * }
* * </pre>
*
* Properties: The application can be configured using the following properties: * Properties: The application can be configured using the following properties:
* *
* <pre>
* // Display a native loading dialog when loading app. Format for value = "Title,Message". * // Display a native loading dialog when loading app. Format for value = "Title,Message".
* // (String - default=null) * // (String - default=null)
* super.setStringProperty("loadingDialog", "Wait,Loading Demo..."); * super.setStringProperty("loadingDialog", "Wait,Loading Demo...");
@ -114,15 +117,19 @@ import android.widget.LinearLayout;
* *
* // Enable app to keep running in background. (Boolean - default=true) * // Enable app to keep running in background. (Boolean - default=true)
* super.setBooleanProperty("keepRunning", false); * super.setBooleanProperty("keepRunning", false);
* </pre>
* *
* Cordova.xml configuration: * Cordova.xml configuration:
*
* <pre>
* Cordova uses a configuration file at res/xml/cordova.xml to specify the following settings. * Cordova uses a configuration file at res/xml/cordova.xml to specify the following settings.
* *
* Approved list of URLs that can be loaded into Cordova * Approved list of URLs that can be loaded into Cordova
* <access origin="http://server regexp" subdomains="true" /> * &lt;access origin="http://server regexp" subdomains="true" /&gt;
* Log level: ERROR, WARN, INFO, DEBUG, VERBOSE (default=ERROR) * Log level: ERROR, WARN, INFO, DEBUG, VERBOSE (default=ERROR)
* <log level="DEBUG" /> * &lt;log level="DEBUG" /&gt;
* * </pre>
*
*/ */
public class CordovaActivity extends Activity implements CordovaInterface { public class CordovaActivity extends Activity implements CordovaInterface {
public static String TAG = "CordovaActivity"; public static String TAG = "CordovaActivity";
@ -291,7 +298,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/** /**
* Get the Android activity. * Get the Android activity.
* *
* @return * @return the Activity
*/ */
public Activity getActivity() { public Activity getActivity() {
return this; return this;
@ -544,7 +551,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* *
* @param name * @param name
* @param defaultValue * @param defaultValue
* @return * @return the boolean value of the named property
*/ */
public boolean getBooleanProperty(String name, boolean defaultValue) { public boolean getBooleanProperty(String name, boolean defaultValue) {
Bundle bundle = this.getIntent().getExtras(); Bundle bundle = this.getIntent().getExtras();
@ -575,7 +582,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* *
* @param name * @param name
* @param defaultValue * @param defaultValue
* @return * @return the int value for the named property
*/ */
public int getIntegerProperty(String name, int defaultValue) { public int getIntegerProperty(String name, int defaultValue) {
Bundle bundle = this.getIntent().getExtras(); Bundle bundle = this.getIntent().getExtras();
@ -600,7 +607,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* *
* @param name * @param name
* @param defaultValue * @param defaultValue
* @return * @return the String value for the named property
*/ */
public String getStringProperty(String name, String defaultValue) { public String getStringProperty(String name, String defaultValue) {
Bundle bundle = this.getIntent().getExtras(); Bundle bundle = this.getIntent().getExtras();
@ -620,7 +627,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* *
* @param name * @param name
* @param defaultValue * @param defaultValue
* @return * @return the double value for the named property
*/ */
public double getDoubleProperty(String name, double defaultValue) { public double getDoubleProperty(String name, double defaultValue) {
Bundle bundle = this.getIntent().getExtras(); Bundle bundle = this.getIntent().getExtras();
@ -815,6 +822,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* @param serviceType * @param serviceType
* @param className * @param className
*/ */
@Deprecated
public void addService(String serviceType, String className) { public void addService(String serviceType, String className) {
if (this.appView != null && this.appView.pluginManager != null) { if (this.appView != null && this.appView.pluginManager != null) {
this.appView.pluginManager.addService(serviceType, className); this.appView.pluginManager.addService(serviceType, className);
@ -1013,7 +1021,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* Determine if URL is in approved list of URLs to load. * Determine if URL is in approved list of URLs to load.
* *
* @param url * @param url
* @return * @return true if the url is whitelisted
*/ */
public boolean isUrlWhiteListed(String url) { public boolean isUrlWhiteListed(String url) {
return Config.isUrlWhiteListed(url); return Config.isUrlWhiteListed(url);
@ -1044,8 +1052,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
/** /**
* Get Activity context. * Get Activity context.
* *
* @return * @return self
* @deprecated
*/ */
@Deprecated
public Context getContext() { public Context getContext() {
LOG.d(TAG, "This will be deprecated December 2012"); LOG.d(TAG, "This will be deprecated December 2012");
return this; return this;

View File

@ -51,7 +51,7 @@ public interface CordovaInterface {
/** /**
* Get the Android activity. * Get the Android activity.
* *
* @return * @return the Activity
*/ */
public abstract Activity getActivity(); public abstract Activity getActivity();

View File

@ -321,10 +321,10 @@ public class CordovaWebView extends WebView {
} }
/** /**
* Override this method to decide wether or not you need to request the * Override this method to decide whether or not you need to request the
* focus when your application start * focus when your application start
* *
* @return * @return true unless this method is overriden to return a different value
*/ */
protected boolean shouldRequestFocusOnInit() { protected boolean shouldRequestFocusOnInit() {
return true; return true;
@ -642,7 +642,7 @@ public class CordovaWebView extends WebView {
* *
* @param name * @param name
* @param defaultValue * @param defaultValue
* @return * @return the String value for the named property
*/ */
public String getProperty(String name, String defaultValue) { public String getProperty(String name, String defaultValue) {
Bundle bundle = this.cordova.getActivity().getIntent().getExtras(); Bundle bundle = this.cordova.getActivity().getIntent().getExtras();
@ -949,7 +949,7 @@ public class CordovaWebView extends WebView {
* if the video overlay is showing then we need to know * if the video overlay is showing then we need to know
* as it effects back button handling * as it effects back button handling
* *
* @return * @return true if custom view is showing
*/ */
public boolean isCustomViewShowing() { public boolean isCustomViewShowing() {
return mCustomView != null; return mCustomView != null;

View File

@ -65,7 +65,7 @@ public class LOG {
* Determine if log level will be logged * Determine if log level will be logged
* *
* @param logLevel * @param logLevel
* @return * @return true if the parameter passed in is greater than or equal to the current log level
*/ */
public static boolean isLoggable(int logLevel) { public static boolean isLoggable(int logLevel) {
return (logLevel >= LOGLEVEL); return (logLevel >= LOGLEVEL);

View File

@ -107,7 +107,7 @@ public class PluginEntry {
* Get the class. * Get the class.
* *
* @param clazz * @param clazz
* @return * @return a reference to the named class
* @throws ClassNotFoundException * @throws ClassNotFoundException
*/ */
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")

View File

@ -339,7 +339,7 @@ public class PluginManager {
* *
* @param id The message id * @param id The message id
* @param data The message data * @param data The message data
* @return * @return Object to stop propagation or null
*/ */
public Object postMessage(String id, Object data) { public Object postMessage(String id, Object data) {
Object obj = this.ctx.onMessage(id, data); Object obj = this.ctx.onMessage(id, data);

View File

@ -149,7 +149,7 @@ public class Whitelist {
* Determine if URL is in approved list of URLs to load. * Determine if URL is in approved list of URLs to load.
* *
* @param uri * @param uri
* @return * @return true if wide open or whitelisted
*/ */
public boolean isUrlWhiteListed(String uri) { public boolean isUrlWhiteListed(String uri) {
// If there is no whitelist, then it's wide open // If there is no whitelist, then it's wide open