-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make it possible to use configure with the main plugin #680
Conversation
### Android Library (multiple variants) | ||
|
||
For projects using the `com.android.library` plugin. This will publish all variants of the project (e.g. both | ||
`debug` and `release`) or a subset of specified variants. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old docs for each platform have been moved to what.md
- [`java-platform`](#java-platform) | ||
- [`version-catalog`](#version-catalog) | ||
|
||
## Android Library (multiple variants) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From here on this is a 1:1 copy of what used to be in base.md
@@ -178,7 +178,6 @@ private fun writeSettingFile(path: Path) { | |||
dependencyResolutionManagement { | |||
repositories { | |||
mavenLocal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this made Kotlin/JS compilation fail for some reason https://youtrack.jetbrains.com/issue/KT-61760, fortunately we don't need it.
* Calls [configure] with a [Platform] chosen based on other applied Gradle plugins. | ||
*/ | ||
@Incubating | ||
fun configureBasedOnAppliedPlugins() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could allow optionally passing javadocJar: JavadocJar? = null, sourcedJar: Boolean = true
(null = we use our current logic) here to eliminate many use cases of calling configure
. Only weird thing about this would be that some platforms would ignore the option if it doesn't apply or is not configurable for it.
This brings 2 changes:
configureBasedOnAppliedPlugins
. This allows to get the automatic behavior for the base plugin while keeping the rest configurable manually.The tests run through without an issue, so moving the automatic KMP configuration to
afterEvaluate
doesn't seem to have any issues. In the first place I only moved it out ofafterEvaluate
in #351 so that it runs before the Android configuration infinalizeDsl
. That's not really needed since we can just do the KMP configuration infinalizeDsl
as well and then no-op inafterEvaluate
if the platform was already configured.