https://github.com/gotev/android-base-library
Template project to create an Android library, which is ready to be published locally and on Maven Central.
https://github.com/gotev/android-base-library
android artifact bintray kotlin library maven template test testing
Last synced: 7 months ago
JSON representation
Template project to create an Android library, which is ready to be published locally and on Maven Central.
- Host: GitHub
- URL: https://github.com/gotev/android-base-library
- Owner: gotev
- License: apache-2.0
- Created: 2016-10-17T17:19:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-07-12T06:07:57.000Z (over 4 years ago)
- Last Synced: 2025-06-05T04:39:56.553Z (8 months ago)
- Topics: android, artifact, bintray, kotlin, library, maven, template, test, testing
- Language: Kotlin
- Homepage:
- Size: 205 KB
- Stars: 20
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Android Base Library Template
Template project to create an Android library, which is ready to be published locally and on Maven Central.
## What's in this project template
- Kotlin 1.4.32
- KtLint
- Android Testing setup for both unit and integration tests
- Library project
- Example app project which imports the library project
- `manifest.gradle` which contains library metadata information and common dependencies between library project and demo app project.
## Getting started
* Fork this project
* Clone it locally
* Run `./rename` and enter the required information
* Done! Open `example/build.gradle` from your Android Studio and start writing your next awesome library!
### Maven Central
Follow this guide: https://github.com/sky-uk/gradle-maven-plugin/#maven-central-publish
## Release
You can release the library:
- **locally**: `./release local`. This is going to create a `releases` directory which can be used as a Maven Repository.
- **MavenCentral**: `./release`
## Using the library
Once the library is published, you can use it like this:
```groovy
implementation 'LIBRARY_PROJECT_GROUP:LIBRARY_NAME:1.0.0'
```
### Using your GitHub Repository as a Maven Repository
Perform `./release local` and then push the `releases` directory. In your dependencies, add this to your repositories section:
```groovy
maven {
content { includeGroup "LIBRARY_PROJECT_GROUP" }
credentials(HttpHeaderCredentials.class) {
name = "Authorization"
value = "Bearer ${ System.getenv('GITHUB_TOKEN') }"
}
authentication { register("header", HttpHeaderAuthentication.class) }
url "https://raw.githubusercontent.com/GITHUB_USER/GITHUB_REPOSITORY_NAME/master/releases"
}
```
You need to add an environment variable in your `.bash_profile` for the github repo to work:
```
export GITHUB_TOKEN="YOUR_TOKEN"
```
And then `source .bash_profile`