Monday, 18 February 2019

Pull jars to libs folder from other directory before building the Android application

I have an Android project, that is dependant on an external jar file, i.e. A.jar.

I have configured my android build.gradle to first build the project that builds A.jar. Then the Android build proceeds.

What is the best way to copy the jar from its build folder into the android projects lib folder, after the jar builds?

So the build should proceed as...

Build Jar > Copy Jar to Libs > Build Android Project.

I don't use Android Studio, so I configure my project only through gradle config file manipulation.

The project that currently builds the jar is already listed as a dependency in app/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "saf.mobilebeats2"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        debug {
            applicationIdSuffix ".debug"
            debuggable true
        }
    }
}

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:appcompat-v7:26.0.0'
    implementation project(':dawcore')
    // runtime files('../DawCore/build/libs/DawCore.jar')
}



from Pull jars to libs folder from other directory before building the Android application

No comments:

Post a Comment