Skip to content

Instantly share code, notes, and snippets.

@mattrob33
Created March 5, 2022 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattrob33/75222e73651f561fe0ec6a38520e75ae to your computer and use it in GitHub Desktop.
Save mattrob33/75222e73651f561fe0ec6a38520e75ae to your computer and use it in GitHub Desktop.
/**
* Apply configuration settings that are shared across all modules.
*/
fun PluginContainer.applyBaseConfig(project: Project) {
whenPluginAdded {
when (this) {
is AppPlugin -> {
project.extensions
.getByType<AppExtension>()
.apply {
baseConfig()
}
}
is LibraryPlugin -> {
project.extensions
.getByType<LibraryExtension>()
.apply {
baseConfig()
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment