Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.yuebinyun:debug-badge:'
}
dependencies {
implementation("com.github.yuebinyun:debug-badge:")
}
<dependency>
<groupId>com.github.yuebinyun</groupId>
<artifactId>debug-badge</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.yuebinyun" % "debug-badge" % ""
:dependencies [[com.github.yuebinyun/debug-badge ""]]
Add it to your project!
or
./gradlew clean
## or
## gradle clean
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.github.yuebinyun.debug-badge:debug-badge:0.1.3'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.yuebinyun.badge'
android {
//...
//
}
dependencies {
//...
}
// if you don't set flavor
badge {
// label = "Debug"
// label = "Dev" // optional. Defualt text is `Debug`
label = "${project.android.defaultConfig.versionName}"
labelColor = 0xFFFFFF // optional. Default color is WHITE
labelBgColor = 0x0099FF // optional. Defualt color is RED
}
// if you want to add badge for flavor-debug-version app
badgeFlavor {
demo {
label = "demo"
// label = "Dev" // optional. Defualt text is `Debug`
// label = "${project.android.defaultConfig.versionName}"
// labelColor = 0x000000 // optional. Default color is WHITE
// labelBgColor = 0x0099FF // optional. Defualt color is RED
}
full {
label = "full"
// label = "Dev" // optional. Defualt text is `Debug`
// label = "${project.android.defaultConfig.versionName}"
// labelColor = 0x000000 // optional. Default color is WHITE
// labelBgColor = 0x0099FF // optional. Defualt color is RED
}
// NOT SET
// flavor1 {
// label = "flavor1"
// }
flavor2 {
label = "flavor2"
labelColor = 0xFF00FF // optional. Default color is WHITE
labelBgColor = 0x0099FF // optional. Defualt color is RED
}
}