apply plugin: 'com.android.library'

android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion

	lintOptions {
		abortOnError false
	}
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
	
	defaultConfig {
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
    }
}

configurations {
    jaxDoclet
    classpaths
}

dependencies {
    jaxDoclet("com.google.doclava:doclava:1.0.6")
    classpaths files(new File(System.getenv('ANDROID_HOME') + '/platforms/rootProject.targetSdkVersion/android.jar'))
}

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    exclude {
        it.file.path.contains('aidl')
    }
    title = null
    options.docletpath = configurations.jaxDoclet.files.asType(List)
    options.classpath = configurations.classpaths.files.asType(List)
    options {
        doclet "com.google.doclava.Doclava"
        bootClasspath new File(System.getenv('JAVA_HOME') + "/jre/lib/rt.jar")
		addStringOption "d", "./build/docs/javadoc"
        addStringOption "hdf project.name", "RCS API"
        addStringOption "hdf sdk.version", "1.6"
        addStringOption "title", "TAPI 1.6.1"
        addStringOption "federate android", "http://developer.android.com/reference/"
        addStringOption "federationxml android", "http://doclava.googlecode.com/svn/static/api/android-10.xml"
        addStringOption "since ./version/blackbird_1_5_1.xml", "1.5"
		addStringOption "since ./version/crane_1_6_1.xml", "1.6"
    }
}