Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document download statistics badges #4752

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 35 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ If you are using Gradle to get a GitHub project into your build, you will need t
**Step 1.** Add the JitPack maven repository to the list of repositories:

```gradle
url "https://jitpack.io"
url "https://jitpack.io"
```

**Step 2.** Add the dependency information:
Expand All @@ -33,15 +33,15 @@ To see an example head to [jitpack.io](https://jitpack.io) and 'Look Up' a GitHu

Gradle example:
```gradle
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.github.User:Repo:Version'
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.github.User:Repo:Version'
}
```

*Note*: when using multiple repositories in build.gradle it is recommended to add JitPack *at the end*. Gradle will go through all repositories in order until it finds a dependency.
Expand All @@ -56,8 +56,8 @@ A snapshot is a version that has not been released. The difference between a rea

For example:
```gradle
// dependency on the latest commit in the master branch
implementation 'com.github.jitpack:gradle-simple:master-SNAPSHOT'
// dependency on the latest commit in the master branch
implementation 'com.github.jitpack:gradle-simple:master-SNAPSHOT'
```

Adding `-SNAPSHOT` will build the latest commit on the master branch.
Expand Down Expand Up @@ -87,8 +87,8 @@ In addition to snapshot builds JitPack supports building Pull Requests. Simply u

For example:
```gradle
// dependency for Pull Request 4
implementation 'com.github.jitpack:gradle-simple:PR4-SNAPSHOT'
// dependency for Pull Request 4
implementation 'com.github.jitpack:gradle-simple:PR4-SNAPSHOT'
```

Publishing on JitPack
Expand All @@ -107,13 +107,13 @@ As long as there's a build file in your repository and it can install your libra
Add dependency information in your README. Tell the world where to get your library:

```gradle
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.jitpack:gradle-simple:1.0'
}
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.jitpack:gradle-simple:1.0'
}
```

- Add sources jar. Creating the sources jar makes it easier for others to use your code and contribute.
Expand Down Expand Up @@ -215,7 +215,20 @@ If you are using a custom domain or BitBucket, use:
(https://jitpack.io/#org.bitbucket.User/Repo)
```

Or, if you prefer the flat-squared style:
For download statistics badges you can use:
- Weekly:
```
![Weekly download statistics](https://jitpack.io/v/USER/REPO/week.svg)
```
![Weekly download statistics](https://jitpack.io/v/jitpack/maven-simple/week.svg)
- Monthly:
```
![Monthly download statistics](https://jitpack.io/v/USER/REPO/month.svg)
```
![Monthly download statistics](https://jitpack.io/v/jitpack/maven-simple/month.svg)


If you prefer the flat-squared badge style you can append `?style=flat-square` to the URL:

```
https://jitpack.io/v/User/Repo.svg?style=flat-square
Expand Down