apply plugin: 'com.android.library' //apply plugin: 'maven' //apply plugin: 'com.github.dcendents.android-maven' //apply plugin: 'realm-android' android { compileSdkVersion 27 // resourcePrefix 'mpcht' defaultConfig { minSdkVersion 15 targetSdkVersion 27 versionCode 3 versionName '3.0.2' } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } lintOptions { abortOnError false } testOptions { unitTests.returnDefaultValues = true // this prevents "not mocked" error } } //repositories { // maven { // url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' // } //} dependencies { //compile fileTree(dir: 'libs', include: ['*.jar']) //compile 'com.android.support:support-v4:19.+' //provided 'io.realm:realm-android:0.87.5' // "optional" dependency to realm-database API testImplementation "org.mockito:mockito-core:1.9.5" } android.libraryVariants.all { variant -> def name = variant.buildType.name def task = project.tasks.create "jar${name.capitalize()}", Jar task.dependsOn variant.javaCompile task.from variant.javaCompile.destinationDir artifacts.add('archives', task); } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } task javadoc(type: Javadoc) { options.charSet = 'UTF-8' failOnError false source = android.sourceSets.main.java.sourceFiles classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) } task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } artifacts { archives sourcesJar archives javadocJar }