1 buildscript { 2 repositories { 3 jcenter() 4 } 5 dependencies { 6 classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.8.1" 7 } 8 } 9 10 // apply the plugin with its class name rather than its Id to work around gradle limitation of 11 // not being able to find the plugin by Id despite the dependencies being added right above. Gradle 12 // is currently not capable of loading plugins by Id if the dependency is anywhere else than 13 // in the main project build.gradle. This file is "imported" into the project's build.gradle 14 // through a "apply from:". 15 apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin 16 apply plugin: 'maven-publish' 17 18 task sourcesJar(type: Jar) { 19 classifier = 'sources' 20 from android.sourceSets.main.java.srcDirs 21 } 22 23 task javadoc(type: Javadoc) { 24 source = android.sourceSets.main.java.srcDirs 25 classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 26 } 27 28 task javadocJar(type: Jar, dependsOn: javadoc) { 29 classifier = 'javadoc' 30 from javadoc.destinationDir 31 } 32 33 artifacts { 34 archives javadocJar 35 archives sourcesJar 36 } 37 38 publishing { 39 publications { 40 library(MavenPublication) { 41 groupId 'com.android.volley' 42 artifactId 'volley' 43 version project.version 44 pom { 45 packaging 'aar' 46 } 47 48 // Release AAR, Sources, and JavaDoc 49 artifact "$buildDir/outputs/aar/volley-release.aar" 50 artifact sourcesJar 51 artifact javadocJar 52 } 53 } 54 } 55 56 artifactory { 57 contextUrl = "https://oss.jfrog.org" 58 publish { 59 repository { 60 repoKey = 'oss-snapshot-local' 61 username = System.env.CI_DEPLOY_USERNAME 62 password = System.env.CI_DEPLOY_PASSWORD 63 } 64 defaults { 65 publications('library') 66 publishArtifacts = true 67 } 68 } 69 resolve { 70 repoKey = 'jcenter' 71 } 72 } 73