Upload to JitPack
Specs
Featured in
Show some ❤?
Base repository to demonstrate the process of uploading an aar
/ jar
to JitPack.
Blog Post : Guide to publishing your Android Library via JitPack
The process is as follows
-
Create an Android project or open an existing one in Android Studio
-
Init the project with git and also create a repo on Github for the same. Each step here onwards represent a commit and should be pushed to github.
-
Create and add a new module and choose
Android Library
.Goto
File>New>New Module..
and selectAndroid Library
. -
Implement your library code inside the library module you created in the last step.
-
Next add the library module as a dependency to the app module.
- Goto
File>Project Structure..
- Select
app
module in the sidebar - Select the
Dependencies
tab - At the bottom is a
+
icon, click that and selectModule dependency
and select yourlibrary
module. - Press
apply
orok
.
- Goto
-
Once project is synced, add the android-maven-gradle-plugin to classpath in build.gradle file at root project level.
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
..
..
// Setup the android-maven-gradle-plugin in the classpath
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
..
- Next, apply the android-maven-gradle-plugin to the build.gradle file at library module level. Also add the group variable.
apply plugin: 'com.android.library'
// Required plugin in library module apply plugin: 'com.github.dcendents.android-maven'
// Replace nisrulz with <your_github_username> group='com.github.nisrulz'
- Create a release TAG in git
git tag -a 1.0 -m "v1.0" git push origin 1.0
-
Once everything is pushed and the release TAG is also pushed, goto
https://www.jitpack.io/#username/reponame
where replaceusername
with your github username andreponame
with the reponame of the android project. -
Select the release you would like to share by clicking the ‘Get It’ button next to the list of releases of your repository.
- Next the same page at Jitpack would show you how to use the library in your other android projects. Something like below
Selectable code
repositories {
jcenter()
maven {
url “https://jitpack.io”
}
}
dependencies {
compile 'com.github.nisrulz:awesomelib:1.0'
}
- Let the world know of your AwesomeLib
😄
- Add a readme that explains how to integrate and use your Awesome library
- Add a license block as in this repo
- Also include the JitPack badge provided by jitpack in your readme
- Promote your lib on social media so that others can know about it.
- Always add a working sample app in your project that demonstrates your library in use.
- Add screenshots if possible in your readme.
If you found this example helpful or you learned something today and want to thank me, consider buying me a cup of
☕?
- PayPal
- Bitcoin Address: 13PjuJcfVW2Ad81fawqwLtku4bZLv1AxCL
License
Copyright 2016 Nishant Srivastava Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.