Helps to save dependencies in files, and use them offline later.
Main goal to save unique jcenter() dependencies to latter usage.
plugins {
id("ru.tutu.dependencies2files") version "0.3.0"
}
//...
repositories {
mavenCentral()
// add proxy repository to save unique jcenter() dependencies:
dependenciesToFiles.addRepository(it) {
saveJcenter()
}
}
plugins {
id("ru.tutu.dependencies2files") version "0.3.0"
}
//...
repositories {
mavenCentral()
// add proxy repository to save unique jcenter() dependencies:
dependenciesToFiles.addRepository(this) {
saveJcenter()
}
}
Compile or build your project, sync IDE with Gradle. Use all cases you want to work with desired dependencies. Also, it'is better use gradle cli option --refresh-dependencies
.
Better to commit all saved dependencies to git. By default all dependencies will saved to save_dependencies
dir.
Instead dependenciesToFiles.addRepository(...)
you may use mavenLocal with custom dir:
repositories {
mavenCentral()
mavenLocal {
url = uri("${rootProject.projectDir}/save_dependencies")
}
}
Now you may check how saved dependencies will work with your build. Sync IDE, compile your project. Good luck in future!
Also you may configure plugin in extension:
dependenciesToFiles {
saveDependenciesDir = "another_directory"
offlineMode = false // you may check dependencies availability with offline toggle
}