Combined configuration and task creation for targets#25
Conversation
Codecov Report
@@ Coverage Diff @@
## multiple-repos #25 +/- ##
====================================================
+ Coverage 82.17% 90.16% +7.99%
+ Complexity 16 13 -3
====================================================
Files 4 3 -1
Lines 129 122 -7
Branches 12 15 +3
====================================================
+ Hits 106 110 +4
+ Misses 18 5 -13
- Partials 5 7 +2
Continue to review full report at Codecov.
|
| set(value) { defaultTarget.repositoryPassword = value } | ||
|
|
||
| /** | ||
| * Allows to add additional [MavenPublishTargets][MavenPublishTarget] to publish to multiple repositories. |
There was a problem hiding this comment.
[MavenPublishTargets][MavenPublishTarget] isn't one enough?
There was a problem hiding this comment.
The first one is what you see in when the markdown is rendered the second is the link to the class. I personally prefer that over writing [MavenPublishTarget]s
| * @since 0.7.0 | ||
| */ | ||
| val targets: NamedDomainObjectContainer<MavenPublishTarget> = | ||
| project.container(MavenPublishTarget::class.java) { MavenPublishTarget(it, "") }.apply { |
There was a problem hiding this comment.
why do we need to specify the second parameter of MavenPublishTarget?
There was a problem hiding this comment.
I didn't want to make releaseRepositoryUrl nullable so it's needs something when initializing it. Nullable and then throwing later during configuration is probably better though.
|
Should we rename Probably also worth nuking the previous configuration parameters: I doubt much people used them anyways. |
|
If we rename those two, should we also use the name of additional targets directly as task name? |
|
Had a typo above that I corrected.
I don't quite understand what you mean. Do you have an example? |
|
The sample configuration above would result in these tasks |
|
I've renamed install and upload. The task name for additional targets should be fine as it is. I think we're good to go now. |
vanniktech
left a comment
There was a problem hiding this comment.
Yup looking good. Can be merged.
Before merging this feature into master itself, I'll mull over it a bit though. (I assume everything will go back to #23 right? Can also be a different PR though. Not strongly opinionated.)
|
Either @budius merges the |
The configuration looks like this:
mavenPublish { // these 4 are equivalent to configuring `targets.upload` below releaseRepositoryUrl = "..." snapshotRepositoryUrl = "..." repositoryUsername = "..." repositoryPassword = "..." targets { upload { // configures the default uploadArchives releaseRepositoryUrl = "..." } install { // configures the default installArchives } otherRepo { // creates new upload task called `uploadArchivesOtherRepo` } } }