Link to home
Start Free TrialLog in
Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on

How to make an aar in Android Studio and upload it to a repository

HI,
I have the following build.gradle file :

apply plugin: 'android-library'
apply plugin: 'maven'


android {
    compileSdkVersion 19
    buildToolsVersion '19.1'
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
        }
    }
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }

   lintOptions {
        abortOnError false
    }
}

dependencies {
    compile project(':olympus-commons')
    compile project(':stream-client')
    compile project(':door-proxy')

    compile 'com.google.guava:guava:17.0'

    compile 'to.talk.aragorn:logging:0.1-SNAPSHOT@aar'
    compile 'to.talk.aragorn:event-utils:0.1-SNAPSHOT@aar'
    compile 'to.talk.aragorn:commons:0.30-SNAPSHOT@aar'

  }

def coreAarFile = file('build/conman-client.aar')
artifacts {
    archives coreAarFile
}

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "http://ci.aws.talk.to:8081/nexus/content/repositories/snapshots",
                    authentication: [
                            userName: 'deployer',
                            password: 'qwedsa'
                    ])
            pom.groupId = 'to.talk.legolas'
            pom.artifactId = 'conman-client'
            pom.version = '1.01-SNAPSHOT'
        }
    }
}

Open in new window


When i build my module it builds sucessfully and there is a build folder output but i dont see the conman-client.aar file there.

How to use gradle to upload a file to repository
ASKER CERTIFIED SOLUTION
Avatar of Am P
Am P
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial