android-studio - 在 Android Studio 中下载并提交 gradle 依赖项和插件

标签 android-studio gradle android-gradle-plugin

这是我的一个模块的 build.gradle 文件的摘录。我正在使用 安卓工作室1.5.1 毕业 2.10 .

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'com.google.android.gms:play-services-gcm:9.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
}

我也有classpath 'com.google.gms:google-services:3.0.0'在项目级别的 build.gradle 文件中。

我正在尝试将所有关联的 jar 收集到一个可以提交到我的 git repo 的目录中。就像是:
task copyRuntimeLibs(type: Copy) {
    into "${projectDir}/libs"
    from configurations.compile
}

(这不起作用)
另外,我不想下载源代码或 javadocs。

我需要能够提交所有依赖项,以便可以在没有 Internet 访问的情况下在 Intranet 上共享项目。

最佳答案

我写了一个插件,可以下载所有的 jars 和 pom。见代码here从 Gradle Configuration 下载所有 jars 和所有 pom

注意:有一个失败的测试 here这表明父 pom 没有被下载。我提出了一个问题 here在 Gradle 的 github 上。

我可能会改进插件以调用 Maven Model Builder APIs得到父 poms。

仅供引用 - 我已经成功地将 ModelBuilder API 与 Gradle 集成(参见 herehere ),所以应该不会太难。

关于android-studio - 在 Android Studio 中下载并提交 gradle 依赖项和插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37482994/

相关文章:

android - 运行配置标记为 "X"

最新更新后 Android Studio (3.0) 模拟器不工作

java - 添加库后无法合并dex错误

android - 找不到名称为 'debug' 的 KotlinJvmAndroidCompilation

java - 为什么 Gradle 只包含我的库中具有项目依赖性的类

android-studio - 在 Android Studio 中将自定义代码片段(实时模板)与 Flutter 应用程序结合使用

maven - 我可以在单个artifactId上发布多个 Artifact 吗?

gradle - Gradle将动态值作为系统属性传递给方法

authentication - CloudFoundry CLI登录无法正常工作(凭据被拒绝,请重试)

android - 如何将项目从android studio迁移到android studio