• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

top-master/GradleCopy: Tool to copy Gradle caches to Android local "m2repos ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

top-master/GradleCopy

开源软件地址(OpenSource Url):

https://github.com/top-master/GradleCopy

开源编程语言(OpenSource Language):

C++ 97.7%

开源软件介绍(OpenSource Introduction):

GradleCopy

Is a Qt framework based tool to copy Gradle caches to Android local "m2repository" directory which saves me from redownloading them (again and again).

Preview

Usage Example

  1. First, ensure you have ANDROID_HOME environment-variable, pointing to your Android-SDK directory.
  2. Create the init.gradle file in your %UserProfile%/.gradle directory, and open it (in your prefered text-editor).
  3. Then, simply copy below and paste in init.gradle file (replacing any previous content):
ext {
    offlineRepoDir = "${System.getenv("ANDROID_HOME")}\\extras\\m2repository"
}
rootProject {
    buildscript {
        ext {
            offlineRepoDir = offlineRepoDir
        }
    }
    allprojects {
        buildscript {
            repositories {
                maven { url uri(offlineRepoDir) }
            }
        }
        repositories {
            maven { url uri(offlineRepoDir) }
        }
    }
}

settingsEvaluated { settings ->
    settings.pluginManagement {
        buildscript {
            repositories {
                maven { url uri(offlineRepoDir) }
            }
        }
        repositories {
            maven { url uri(offlineRepoDir) }
        }
    }
}
  1. Download GradleCopy if you didn't already and launch it.
  2. Uncheck the Test Run option (to skip listing what will be done).
  3. At last, click the Copy button and done!
  4. But sometimes Gradle only downloads .pom files, and fails to fetch related .jar files:
    • To fix that: Gradle will not even try to download related .jar files (as long as your offline repo contains related .pom file).
    • First, click the "Generate Missing Jar List" option from the Copy button's dropdown menu.
    • In the resulted window, click "Disable incomplete lib" option from the Download button's dropdown menu (which renames any .pom file with no .jar file beside it, inside your offline m2repository directory only).
    • Previous step (the rename) can be undone by clicking "Restore incomplete lib" option (from the same menu).
    • For now, the Download button itself is not functional (which in future, downloads what is missing, instead of relaying solely on Gradle).

Platform: broken Windows but should also work for Mac and Linux as well (once compiled).

Note: All codes are based and meant to be Apache 2.0 License but it does use the Qt4 framework under the LGPL or GPL license, so if you rewrite this using another framework it is pure Apache 2.0 License




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap