【发布时间】:2015-06-26 18:16:45
【问题描述】:
有人可以指导我如何使用Jitpack 构建 github 项目。
我尝试按照此说明进行操作,但总是出错。我分叉了一个项目并在其上添加了一些更改,因此我需要获取当前的提交 ID 作为版本。
要将 GitHub 项目添加到您的构建中:
Step 1. Add the JitPack maven repository to your build file url "https://jitpack.io" Step 2. Add the dependency in the form: Group: com.github.Username Artifact: Repository Name Version: Release tag or commit id That's it! The first time you request a project JitPack checks out the code, builds it and sends the Jar files back to you.
这是我的 gradle 文件
buildscript {
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.jakewharton.hugo:hugo-plugin:1.1.+'
classpath 'com.stanfy.spoon:spoon-gradle-plugin:0.10.+'
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:recyclerview-v7:22.0.0'
//THIS ONE SEEMS NOT TO WORK BASE ON THE INSTRUCTION
compile ('com.github.username:repo:commitId')
}
【问题讨论】:
-
你遇到了什么错误?
-
类似'无法解析 com.github.username:repo:commitId' 我尝试更新代码并再次运行。现在gradle进程不会停止
-
我想我会手动导入这个。我不知道我是否得到它,但似乎 gradle 正在同步将近一个小时并且没有返回任何消息。
-
@MightyMilk 您尝试使用的实际 GitHub 项目是什么?
-
@metrimer 这个github.com/mightymilk/material-dialogs