Skip to content

Building

Sam Dozor edited this page Nov 8, 2016 · 1 revision

Building the SDK

Follow the steps below to build the SDK from source and incorporate it in your app via a local Maven repository.

1. Clone the SDK and Kit Submodules

git clone --recursive [email protected]:mParticle/mparticle-android-sdk.git
cd mparticle-android-sdk
# if there's a particular branch, SHA, or tag that you'd like to test, switch to it now

2. Deploy the Core SDK

The following will upload the SDK to your local Maven repository, for example ~/.m2/repository/com/mparticle:

./gradlew uploadArchives

3. Deploy Kits

./gradlew uploadArchives -c settings-kits.gradle

4. Using a local Maven repository.

You can add mavenLocal() to your app's build.gradle script to pull artifacts from a local Maven repository:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
    }
}

allprojects {
    repositories {
        mavenLocal() //ADD THIS, ABOVE ALL OTHER REPOSITORIES
        mavenCentral()
    }
}