-
Notifications
You must be signed in to change notification settings - Fork 118
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
experimental implementation of Configurer that uses maven-publish #32
Conversation
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
=============================================
- Coverage 88.95% 67.09% -21.86%
Complexity 40 40
=============================================
Files 6 8 +2
Lines 172 234 +62
Branches 15 20 +5
=============================================
+ Hits 153 157 +4
- Misses 11 67 +56
- Partials 8 10 +2
Continue to review full report at Codecov.
|
releaseRepositoryUrl | ||
} | ||
// the releaseRepositoryUrl is null checked in the plugin | ||
return URI.create(@Suppress("UnsafeCallOnNullableType") url!!) |
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.
Could use requireNotNull(url) instead
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.
done fd48f06
|
||
private fun MavenPublishTarget.repositoryUrl(version: String): URI { | ||
val url = if (version.endsWith("SNAPSHOT")) { | ||
snapshotRepositoryUrl ?: releaseRepositoryUrl |
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.
Why do we default to release url here?
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.
To mirror the uploadArchives
behavior. When no snapshot repository is specified it will always upload to the non snapshot repository. This is also how installArchives
works which doesn't have a separate snapshot repository.
We could make it more explicit and require a snapshotRepositoryUrl
for snapshots. For installArchives
we'd then just set it to the same path.
repo.name = target.repositoryName | ||
repo.url = target.repositoryUrl(project.version.toString()) | ||
if (target.repositoryUsername != null) { | ||
repo.credentials { it -> |
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.
It is the default and hence we can remove it
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.
done fd48f06
import org.gradle.plugins.signing.SigningExtension | ||
import java.util.concurrent.Callable | ||
|
||
internal val Project.signing get() = extensions.getByType(SigningExtension::class.java) |
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.
Make all of them inline?
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.
done fd48f06
Android libraries aren't supported right. We'd need a SoftwareComponent implementation for those which is tracked here: https://issuetracker.google.com/issues/37055147. Which is blocked by gradle/gradle#1842. The latter is also preventing us of providing our own implementation of SoftwareComponent unless we're ok with internal APIs. Here is an example of how to do it without SoftwareComponent, but for Android adding the dependencies to the pom is more complex
This brings one behavior change for the old implementation. The general configuration inside the Configurers
init
is now done in afterEvaluate because we need to wait until we can read the newuseMavenPublish
property.I still want tests for at least the generated poms. Going to look into that next week.