apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' // Required by bintray version = '1.0.0' group = 'com.otaliastudios' android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName project.version } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets { main.java.srcDirs += 'src/main/options' main.java.srcDirs += 'src/main/views' main.java.srcDirs += 'src/main/utils' } } dependencies { compile "com.android.support:exifinterface:$supportLibVersion" compile "com.android.support:support-annotations:$supportLibVersion" } install { repositories.mavenInstaller { pom.project { name 'CameraView' description 'A well documented, high-level Android interface that makes capturing pictures ' + 'and videos easy, addressing most of the common issues and needs.' url 'https://github.com/natario1/CameraView' packaging 'aar' groupId project.group artifactId 'cameraview' version project.version licenses { license { name 'The Apache Software License, Version 2.0' url 'http://www.apache.org/licenses/LICENSE-2.0.txt' } } scm { connection 'https://github.com/natario1/CameraView.git' developerConnection 'https://github.com/natario1/CameraView.git' url 'https://github.com/natario1/CameraView' } developers { developer { id = 'natario' name 'Natario' } } } } } Properties props = new Properties() props.load(project.rootProject.file('local.properties').newDataInputStream()) bintray { // https://github.com/bintray/gradle-bintray-plugin user = props.getProperty('bintray.user') key = props.get('bintray.key') configurations = ['archives'] pkg { repo = 'android' name = 'CameraView' licenses = ['Apache-2.0'] vcsUrl = 'https://github.com/natario1/CameraView.git' publish = true override = true version { name = project.version desc = 'CameraView v. '+project.version released = new Date() vcsTag = 'v'+project.version } } } // From official sample https://github.com/bintray/bintray-examples/blob/master/gradle-aar-example/build.gradle task sourcesJar(type: Jar) { classifier = 'sources' from android.sourceSets.main.java.sourceFiles } task javadoc(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) classpath += project.files("${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") project.android.libraryVariants.all { variant -> if (variant.name == 'release') { classpath += files(variant.javaCompile.classpath) } } exclude '**/BuildConfig.java' exclude '**/R.java' exclude '**/internal/**' } task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } artifacts { archives javadocJar archives sourcesJar } // export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home // To deploy ./gradlew bintrayUpload