How to compile forked library in Gradle?
5865 просмотра
4 ответа
I want to compile the following library in my project in build.gradle
:
https://github.com/theDazzler/Android-Bootstrap
It is forked from https://github.com/Bearded-Hen/Android-Bootstrap, but no documentation in the repository explains how to include in in project.
I tried something like this:
compile 'com.theDazzler:androidbootstrap:+'
but gradle failed and shows error that library not found.
Edit: Can anyone fork it and/or publish it?
Автор: Fenil Источник Размещён: 13.11.2019 11:47Ответы (4)
37 плюса
This fork isn't published in the maven central repo.
Then you can't use an import like compile com.theDazzler:androidbootstrap:+
You have to: - clone this library locally as a module in your project Clone the https://github.com/theDazzler/Android-Bootstrap/tree/master/AndroidBootstrap folder in your root/module1 folder.
root:
module1
build.gradle
app
build.gradle
settings.gradle
Change your settings.gradle file in
include ':module1' include ':app'
In your app/build.gradle file you have to add:
dependencies {
// Module Library
compile project(':module1')
}
Finally in your module1/build.gradle you have to check the level used for gradle plugin.
EDIT 31/10/2015:
You can use another way to add a dependency with a github project,using the github repo and the jitpack plugin
In this case you have to add this repo tp your build.gradle
repositories {
// ...
maven { url "https://jitpack.io" }
}
and the dependency:
dependencies {
compile 'com.github.User:Repo:Tag'
}
Автор: Gabriele Mariotti
Размещён: 15.02.2015 08:07
6 плюса
It can be simply done by using Jitpack.
Step 1. Add the JitPack repository to your build file
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
compile 'com.github.User:Repo:Tag'
}
for eg: compile 'com.github.sachinvarma:JcPlayer:0.0.1'
Автор: Sachin Varma Размещён: 26.06.2017 06:073 плюса
The issue is: has that theDazzler/Android-Bootstrap
been published anywhere? In any gradle/maven repo?
The usual build.gradle
file has a section repositories
which should reference that maven repo.
So it is possible any project using theDazzler/Android-Bootstrap
should reference the repo where it is published, And with a project like gradle-git-repo-plugin
, you could publish that fork on its own release section to publish it.
That task gets wrapped into a
publishToGithub
task that handles committing and pushing the change. Then you can run
gradle -Porg=layerhq -Prepo=gradle-releases publishToGithub
You can also run
gradle -Porg=layerhq -Prepo=gradle-releases publish
Автор: VonC Размещён: 14.02.2015 09:27to stage a release in the local github repo and commit it manually.
3 плюса
Hi i had the same issue but with a different project :)
So first you should have the library code on your dev machine. Next steps are: add a new file called settings.gradle to the root of your project if its not already there.
inside add this:
include 'AndroidBootStrap'
project('AndroidBootStrap').path = "path/to/AndroidBootstrap/AndroidBootStrapLibrary"
also add include for your root project if its not there. Inside your build.gradle file add
compile project(':AndroidBootStrap')
to add the dependency.
How your folder Structure should look:
root
YourProject
settings.gradle
YourProjectModule
build.gradle
AndroidBootStrap
AndroidBootStrapLibrary
build.gradle
In the end the files look like this:
settings.gradle:
include 'AndroidBootStrap'
project('AndroidBootStrap').path = "../AndroidBootstrap/AndroidBootStrapLibrary"
include 'YourProjectModule'
build.gradle (YourModule):
...
dependencies {
...
compile project(':AndroidBootStrap')
}
Maybe its necessary to modify some point but i hope you get the idea!
Cheers Neri
Автор: Dominik Размещён: 16.02.2015 11:16Вопросы из категории :
- android Насколько хорошо отражает эмулятор Android Phone?
- android Как сохранить состояние активности Android с помощью сохранения состояния экземпляра?
- android Android: доступ к дочерним представлениям из ListView
- android Как вызвать SOAP веб-сервис на Android
- git Как я могу отменить git reset --hard HEAD ~ 1?
- git Как настроить Git голый доступный по HTTP репозиторий на IIS
- git Как мне отменить неустановленные изменения в Git?
- git Как удалить локальные (неотслеживаемые) файлы из текущего рабочего дерева Git?
- github Как клонировать все удаленные ветки в Git?
- github Как я могу удалить коммит на GitHub?
- github Доступ к оболочке git в GitX в OS X
- github Как мне вытащить свой проект из github?
- gradle gradle - как мне создать банку с директорией lib с другими банками в ней?
- gradle Gradle: как отобразить результаты теста в консоли в режиме реального времени?
- gradle Gradle build без тестов
- gradle Использование Gradle для создания JAR с зависимостями
- android-studio Как я могу использовать внешние JAR-файлы в проекте Android?
- android-studio Обработка событий щелчка на отрисовке внутри EditText
- android-studio Ctrl + 1 Eclipse в IntelliJ и Android Studio
- android-studio Lint: How to ignore "<key> is not translated in <language>" errors?