Question

How to configure my ivysettings.xml file so that ivy can resolve the Android extra and support libraries that are deployed in ANDROID_HOME/extras/android/m2repository ?

At the end, I would like to be able to add those libraries with

    <dependency
        name="support-v4"
        org="com.android.support"
        rev="19.0.1" />
Was it helpful?

Solution

Here is the way to go (ANDROID_HOME is an environment variable that points to your android SDK):

<ivysettings>
    ...
    <properties environment="env" />
    <property name="android.repo" value="${env.ANDROID_HOME}/extras/android/m2repository/com/android/support" />
    ...
    <resolvers>
        ... your resolvers ...
        <filesystem name="android-local" checkmodified="true">
            <ivy pattern="${android.repo}/[module]/[revision]/[artifact]-[revision].[ext]" />
            <artifact pattern="${android.repo}/[module]/[revision]/[artifact]-[revision].[ext]" />
            <artifact pattern="${android.repo}/[module]/[revision]/[artifact]-[revision]-sources.[ext]" />
            <artifact pattern="${android.repo}/[module]/[revision]/[artifact]-[revision]-javadoc.[ext]" />
        </filesystem>
        <chain name="local-chain">
            ... ref to your resolvers ...
            <resolver ref="android-local" />
        </chain>
    </resolvers>
</ivysettings>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top