Skip to content

Commit

Permalink
Adds javadoc building to gradle script. Cleans up some javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Healy committed Apr 21, 2015
1 parent d7a20c0 commit 38063d5
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 45 deletions.
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,23 @@ android.libraryVariants.all { variant ->
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
artifacts.add('archives', task);
}

// This magic came from:
// http://stackoverflow.com/questions/23297562/gradle-javadoc-and-android-documentation
android.libraryVariants.all { variant ->
task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) {
title = "KISSmetrics Android API ${android.defaultConfig.versionName}"
description = 'Documentation for the KISSmetrics Android API'

source = variant.javaCompile.source
classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath())
options {
links "http://docs.oracle.com/javase/7/docs/api/"
linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference"
}
exclude '**/BuildConfig.java'
exclude '**/R.java'
exclude '**/doc-files/*'
}
}
16 changes: 7 additions & 9 deletions src/main/java/com/kissmetrics/sdk/ArchiverImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import android.util.Log;

/**
* ArchiverImpl
* <p/>
* Handles read/write of settings, identity, recorded events and properties.
* Recorded events and properties are URL encoded before being saved to a send queue.
*/
Expand Down Expand Up @@ -408,7 +406,7 @@ private long currentTimeSeconds() {
************************************************/

/**
* Archives install UUID to Settings > Internal Storage.
* Archives install UUID to Settings &lt; Internal Storage.
*
* @param installUuid Unique identifier of the application install which may only be
* archived once.
Expand All @@ -430,7 +428,7 @@ public void archiveInstallUuid(final String installUuid) {
}

/**
* Archives doTrack boolean to Settings > Internal Storage.
* Archives doTrack boolean to Settings &lt; Internal Storage.
*
* @param doTrack Setting to control recording of aliases, events and properties.
*/
Expand All @@ -442,7 +440,7 @@ public void archiveDoTrack(boolean doTrack) {
}

/**
* Archives doSend boolean to Settings > Internal Storage.
* Archives doSend boolean to Settings &lt; Internal Storage.
*
* @param doSend Setting to control the uploading of aliases, events and properties.
*/
Expand All @@ -454,7 +452,7 @@ public void archiveDoSend(boolean doSend) {
}

/**
* Archives baseUrl String to Settings > Internal Storage.
* Archives baseUrl String to Settings &lt; Internal Storage.
*
* @param baseUrl Setting for API base URL path
*/
Expand All @@ -472,7 +470,7 @@ public void archiveBaseUrl(String baseUrl) {
}

/**
* Archives doTrack verification expiration date to Settings > Internal Storage.
* Archives doTrack verification expiration date to Settings &lt; Internal Storage.
*
* @param expDate Milliseconds from unix epoch when verification expires.
*/
Expand All @@ -484,7 +482,7 @@ public void archiveVerificationExpDate(long expDate) {
}

/**
* Archives hasGenericIdentity boolean to Settings > Internal Storage.
* Archives hasGenericIdentity boolean to Settings &lt; Internal Storage.
*
* @param hasGenericIdentity setting to indicate that a proper identity has been given.
*/
Expand All @@ -495,7 +493,7 @@ public void archiveHasGenericIdentity(final boolean hasGenericIdentity) {
}

/**
* Archives appVersion to Settings > Internal Storage.
* Archives appVersion to Settings &lt; Internal Storage.
*
* @param appVersion String app version name.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/kissmetrics/sdk/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Connection {
* Handles the response and notifies the provided ConnectionDelgate on completion.
*
* @param urlString URL encoded API query string
* @delegate delegate Object implementing the ConnectionDelegate interface
* @param delegate Object implementing the ConnectionDelegate interface
*/
void sendRecord(String urlString, ConnectionDelegate delegate);
}
4 changes: 1 addition & 3 deletions src/main/java/com/kissmetrics/sdk/ConnectionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import android.util.Log;

/**
* ConnectionImpl
* <p/>
* Handles HttpURLConnections for KISSmetrics API queries.
*/
public class ConnectionImpl implements Connection {
Expand All @@ -52,7 +50,7 @@ protected HttpURLConnection createHttpURLConnection(URL url) throws IOException
* Handles the response and notifies the provided ConnectionDelgate on completion.
*
* @param urlString URL encoded API query string
* @delegate delegate Object implementing the ConnectionDelegate interface
* @param delegate Object implementing the ConnectionDelegate interface
*/
public void sendRecord(String urlString, ConnectionDelegate delegate) {
URL url = null;
Expand Down
38 changes: 17 additions & 21 deletions src/main/java/com/kissmetrics/sdk/KISSmetricsAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import android.util.Log;

/**
* KISSmetricsAPI
* <p/>
* Public API for sending identities, events and properties to KISSmetrics from
* Android applications. Compatible with Android 2.2+
*/
Expand Down Expand Up @@ -66,7 +64,7 @@ protected static void setVerificationImpl(VerificationImpl verImpl) {
/**
* Initializes the default Connection if not set. Allows for injection of
* mock HttpURLConnection within VerificationImpl.
* <p/>
*
* Returns the injected verificationImpl if it exists.
*
* @return Connection
Expand Down Expand Up @@ -405,7 +403,7 @@ public void autoSetAppProperties() {
}
}

/**
/*
* *********************************************
* VerificationDelegateInterface methods
* **********************************************
Expand Down Expand Up @@ -457,15 +455,16 @@ public void verificationComplete(boolean success,
************************************************/

/**
* Initializes and/or returns the KISSmetricsAPI singleton
* instance.
*
* @param apiKey KISSmetrics product key
* @param context Android application context
* @param secure !Ignored!
* @return singleton instance of the KISSmeticsAPI
* @deprecated use {@link sharedAPI(String apiKey)} instead. All requests
*
* @deprecated use {@link #sharedAPI(String, android.content.Context)} instead. All requests
* are now made over https. secure(boolean) is ignored.
* <p/>
* Initializes and/or returns the KISSmetricsAPI singleton
* instance.
*/
@Deprecated
public static synchronized KISSmetricsAPI sharedAPI(String apiKey,
Expand All @@ -478,13 +477,12 @@ public static synchronized KISSmetricsAPI sharedAPI(String apiKey,
}

/**
* Records an event with optional properties.
*
* @param name Event name
* @param properties Event properties or null
* @deprecated use {@link record(String name, Map<String, String>
* properties)} instead. 'recordEvent' method name has been
* changed to 'record' for consistency across our various APIs.
* <p/>
* Records an event with optional properties.
* @deprecated use {@link #record(String, java.util.Map)} instead. 'recordEvent' method name
* has been changed to 'record' for consistency across our various APIs.
*/
@Deprecated
public void recordEvent(String name, Map<String, String> properties) {
Expand All @@ -493,11 +491,10 @@ public void recordEvent(String name, Map<String, String> properties) {

/**
* @param name Event name
* @deprecated use {@link record(String name, Map<String, String>
* properties), RecordCondition condition} instead. 'recordOnce'
* would only restrict the recording of events per identity. A
* more flexible solution was needed to allow recording of
* events once per installation or identity.
* @deprecated use {@link #record(String, java.util.Map, com.kissmetrics.sdk.KISSmetricsAPI.RecordCondition)}
* instead. 'recordOnce' would only restrict the recording of events per identity. A
* more flexible solution was needed to allow recording of events once per installation or
* identity.
*/
@Deprecated
public void recordOnce(String name) {
Expand All @@ -507,9 +504,8 @@ public void recordOnce(String name) {

/**
* @param properties User properties
* @deprecated use {@link set(Map<String, String> properties)} instead.
* 'setProperties' method name has been changed to 'set' for
* consistency across our various APIs.
* @deprecated use {@link #set(java.util.Map)} instead. <tt>setProperties</tt> method name
* has been changed to 'set' for consistency across our various APIs.
*/
@Deprecated
public void setProperties(Map<String, String> properties) {
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/kissmetrics/sdk/QueryEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import android.util.Log;

/**
* QueryEncoder
* <p/>
* URL encoder for KISSmetricsAPI queries.
*/
public class QueryEncoder {
Expand All @@ -51,7 +49,7 @@ public QueryEncoder(String key, String clientType, String userAgent) {
}

/**
* Checks provided properties HashMap for _d & _t timestamp keys.
* Checks provided properties HashMap for _d &amp; _t timestamp keys.
*
* @param properties HashMap of user or event properties
* @return boolean true if timestamp has been set in these properties
Expand Down Expand Up @@ -172,7 +170,7 @@ public String encodeProperties(Map<String, String> properties) {
* @param name Event name
* @param properties Event properties
* @param identity User identity
* @param timestamp A unix epoch timestamp to apply if _t & _d have not been set in properties
* @param timestamp A unix epoch timestamp to apply if _t &amp; _d have not been set in properties
* @return the URL encoded query string
*/
public String createEventQuery(String name,
Expand All @@ -198,7 +196,7 @@ clientType, userAgent, encodeIdentity(identity),
*
* @param properties User properties
* @param identity User identity
* @param timestamp A unix epoch timestamp to apply if _t & _d have not been set in properties
* @param timestamp A unix epoch timestamp to apply if _t &amp; _d have not been set in properties
* @return the URL encoded query string
*/
public String createPropertiesQuery(Map<String, String> properties,
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/kissmetrics/sdk/TrackingRunnables.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.util.Map;

/**
* TrackingRunnables interface
* <p/>
* Classes implementing this interface provide Runnable objects to
* handle tracking for specific tracking states.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import com.kissmetrics.sdk.KISSmetricsAPI.RecordCondition;

/**
* TrackingRunnables non-tracking state
* <p/>
* Provides Runnable objects for non-tracking state.
*/
public class TrackingRunnablesNonTrackingState implements TrackingRunnables {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import com.kissmetrics.sdk.KISSmetricsAPI.RecordCondition;

/**
* TrackingRunnables tracking state
* <p/>
* Provides Runnable objects for tracking state.
*/
public class TrackingRunnablesTrackingState implements TrackingRunnables {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/kissmetrics/sdk/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
*
*/
package com.kissmetrics.sdk;

0 comments on commit 38063d5

Please sign in to comment.