【问题标题】:Way To Search for a Gradle Plugin搜索 Gradle 插件的方法
【发布时间】:2015-03-26 07:31:42
【问题描述】:

我正在尝试将现有项目从 Eclipse 转换为 Android Studio

我想尽可能多地放置从 jcenter() 或 mavenCentral() 存储库中提取的 Gradle 插件

我有点困惑如何搜索这些 我找到的三个网站都没有返回令人满意的结果

http://plugins.gradle.org

http://mvnrepository.com

https://bintray.com

这三个中最好的似乎是 mvnrepository

这三个都没有返回 Microsoft Live SDK 的结果。假设不存在此插件并且我必须将其包含为项目是否正确?

导入到 Studio 时生成的我的依赖项 - 我更改的 Facebook 除外

dependencies {
compile 'com.facebook.android:facebook-android-sdk:3.23.1'
compile project(':liveSdk')
compile 'com.google.http-client:google-http-client-gson:1.19.0'
compile 'com.google.code.gson:gson:2.1'
compile 'com.android.support:mediarouter-v7:18.0.0'
compile 'com.android.support:appcompat-v7:18.0.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/dropbox-android-sdk-1.5.4.jar')
compile files('libs/google-api-client-1.18.0-rc.jar')
compile files('libs/google-api-client-android-1.18.0-rc.jar')
compile files('libs/google-api-services-drive-v2-rev119-1.18.0-rc.jar')
compile files('libs/google-http-client-1.18.0-rc.jar')
compile files('libs/google-http-client-android-1.18.0-rc.jar')
compile files('libs/google-oauth-client-1.18.0-rc.jar')
compile files('libs/jackson-annotations-2.2.2.jar')
compile files('libs/jackson-core-2.2.2.jar')
compile files('libs/jackson-databind-2.2.2.jar')
compile files('libs/json_simple-1.1.jar')
}

【问题讨论】:

    标签: maven android-studio gradle android-gradle-plugin jcenter


    【解决方案1】:

    这些库将从远程存储库中解析:

    compile 'com.facebook.android:facebook-android-sdk:3.23.1'
    compile 'com.google.http-client:google-http-client-gson:1.19.0'
    compile 'com.google.code.gson:gson:2.1'
    compile 'com.android.support:mediarouter-v7:18.0.0'
    compile 'com.android.support:appcompat-v7:18.0.0'
    compile 'com.google.android.gms:play-services:+'
    

    这是您工作区中的一个项目:

    compile project(':liveSdk')
    

    这是您的 libs 文件夹中的文件:

    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile files('libs/dropbox-android-sdk-1.5.4.jar')
    compile files('libs/google-api-client-1.18.0-rc.jar')
    compile files('libs/google-api-client-android-1.18.0-rc.jar')
    compile files('libs/google-api-services-drive-v2-rev119-1.18.0-rc.jar')
    compile files('libs/google-http-client-1.18.0-rc.jar')
    compile files('libs/google-http-client-android-1.18.0-rc.jar')
    compile files('libs/google-oauth-client-1.18.0-rc.jar')
    compile files('libs/jackson-annotations-2.2.2.jar')
    compile files('libs/jackson-core-2.2.2.jar')
    compile files('libs/jackson-databind-2.2.2.jar')
    compile files('libs/json_simple-1.1.jar')
    

    因此,如果您的 Eclipse 中有一个 liveSDK 项目,您也应该导入它。 希望对您有所帮助。

    【讨论】:

    • 我知道依赖项的含义。我要问的是如何轻松地将 jar 转换为存储库
    • 我不确定你的意思。如果您实际上在本地有来自 liveSDK 的 jar,则可以使用 flatDir 存储库。见stackoverflow.com/questions/20700053/…
    【解决方案2】:

    我通常去 Maven Central 寻找已发布的 gradle 库:

    http://search.maven.org/

    只需输入 jar 的名称,您很可能会看到已发布的 gradle 库。

    【讨论】:

    • 谢谢,我希望能够进行更灵活的搜索,例如只需输入 facebooksdk 并找到没有完整包名的正确搜索
    • 是的,你不需要完整的包名。如果你在 maven Central 中输入“Facebook”,它会给你几个选项。但最终你确实需要知道完整的包名来选择你想要的库
    • 这并不完全正确,如果你输入 Facebook,你会得到一个很长的列表,你需要扫描它来找到相关的包。如果最有可能或最受欢迎的软件包位于顶部,那将很有帮助。我发现搜索效率不高。如果你有一两个包没关系,但更多你开始浪费时间
    • 啊,我明白了。是的,它的效率相对较低,但希望您只需经历一次。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-20
    • 2021-10-04
    相关资源
    最近更新 更多