Android支持和常春藤的额外设置

时间:2014-04-30 11:26:45

标签: android ivy

如何配置我的 ivysettings.xml 文件,以便常春藤可以解析部署在ANDROID_HOME/extras/android/m2repository中的Android额外和支持库?

最后,我希望能够使用

添加这些库
    <dependency
        name="support-v4"
        org="com.android.support"
        rev="19.0.1" />

1 个答案:

答案 0 :(得分:2)

这是要走的路(ANDROID_HOME是一个指向你的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>