https://github.com/kaedea/intransitives
Gradle plugin for intransitive-complie dependencies.
https://github.com/kaedea/intransitives
dependency-manager gradle-plugin
Last synced: 11 months ago
JSON representation
Gradle plugin for intransitive-complie dependencies.
- Host: GitHub
- URL: https://github.com/kaedea/intransitives
- Owner: kaedea
- License: apache-2.0
- Created: 2018-05-29T06:33:59.000Z (about 8 years ago)
- Default Branch: develop
- Last Pushed: 2018-07-31T07:53:20.000Z (almost 8 years ago)
- Last Synced: 2025-04-04T12:51:33.731Z (about 1 year ago)
- Topics: dependency-manager, gradle-plugin
- Language: Groovy
- Size: 184 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Intransitives
[](https://bintray.com/kaedea/moe-studio/intransitives/_latestVersion)


Gradle plugin `intransitives` helps to make apis of transitive children dependencies invisible from user.
## Problems
When you add an dependency in `build.gradle`, Gradle will also compile transitive children dependencies by default. This behavior makes the dependencies manager much simpler but something we hope to hide the apis of children dependencies. For example, picasso depends on okhttp as the following
APP -> Picasso -> OkHttp
If we compile picasso, we will also compile okhttp (that is how picasso works). In another word, the apis of okhttp is visible to us though we do not compile it explictly. If we do not announce compling okhttp explictly, we should not access its apis. Because the implementaion of picasso might changes so that it does not compile okhttp any more.
## Solution
If we want to avoid accessing of transitive apis, we should set `transitive = false` of complie while `transitive = true` of runtime (hide the apis in compile time and package the apis in runtime). Such as
```groovy
dependencies {
implementation ('com.squareup.picasso:picasso:latest.release') {
transitive = false
}
runtimeOnly ('com.squareup.picasso:picasso:latest.release') {
transitive = true
}
}
```
And this is how `intransitives` works.
## Getting Started
Just apply the plugin in the `build.gradle` file of your module.
```groovy
// ~/project/build.gradle
// 1. Add dependency
buildscript {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.kaedea:intransitives:latest.release'
}
}
// 2. Apply plugin
apply plugin: 'com.kaedea.intransitives'
intransitives {
// 3. Move your dependencies here in need
implementation 'com.squareup.picasso:picasso:latest.release'
}
```
Use task `:app:intransitives` to dump your intransitive dependencies confinguration.
## Contributing
Check [CONTRIBUTING.md](/CONTRIBUTING.md).
## License
The project is [Apache License, Version 2.0](/LICENSE) licensed.