-
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
Add the ability to specify targets and push to multiple maven repos. #23
Add the ability to specify targets and push to multiple maven repos. #23
Conversation
The client code will simply create a `mavenRepositories{ }` and add info on the needed repos. Example: mavenRepositories { internalRepo = { releaseRepositoryUrl = MAVEN_URL_INTERNAL snapshotRepositoryUrl = MAVEN_URL_SNAPSHOT_INTERNAL repositoryUsername = MAVEN_USERNAME_INTERNAL repositoryPassword = MAVEN_PASSWORD_INTERNAL } betaRepo = { releaseRepositoryUrl = MAVEN_URL_BETA snapshotRepositoryUrl = MAVEN_URL_SNAPSHOT_BETA repositoryUsername = MAVEN_USERNAME_BETA repositoryPassword = MAVEN_PASSWORD_BETA } } and this will create the tasks `uploadInternalRepo` and `uploadBetaRepo`
Codecov Report
@@ Coverage Diff @@
## master #23 +/- ##
=========================================
- Coverage 93.68% 90% -3.69%
- Complexity 7 13 +6
=========================================
Files 2 3 +1
Lines 95 120 +25
Branches 6 14 +8
=========================================
+ Hits 89 108 +19
- Misses 1 5 +4
- Partials 5 7 +2
Continue to review full report at Codecov.
|
I think it would be great if more of the code could be reused. The new |
@gabrielittner I totally agree it's not the best reusable code. Now I'm slightly under-pressure to get moving with the project and got it done just to the point of having the minimum working. It will take some time until I'll be able to come back to it and get a refactor to unify it all. If anyone feel like taking a stab at it before I come back, go for it. But for a clean re-use possibly would need to change the plugin API. My first suggestion would be like
but then I'll certainly wait for the maintainers to give a green light before changing. |
I think it would already be possible to reuse some of the plugin code without breaking the API. If we have an interface like the following both the existing extension and your new model could implement it and then we could have a shared method that does this part gradle-maven-publish-plugin/src/main/groovy/com/vanniktech/maven/publish/MavenPublishPlugin.groovy Lines 30 to 44 in 68b1201
interface RepositoryModel {
var releaseRepositoryUrl: String
var snapshotRepositoryUrl: String
var repositoryUsername: String?
var repositoryPassword: String?
} I'd be happy to do a follow up on this if you're too busy right now, but let's wait for what @vanniktech thinks. |
Sorry for answering late to this. Yes, we should reuse as much as possible. Also, the task names should be prefixed with Feel free to improve this @gabrielittner and create a PR against this one so we'll ship this feature in one go (to not break snapshot users - if there are any). Also, the default of the new behavior should be exactly the same as it was before. So configuring this is optional and will just extend the functionality. The normal #9 - should not break either. On a side note, can't we use this mechanism somehow smartly? |
@gabrielittner I like it, and it makes sense to me. I gotta admit I had too much fun playing with gradle plugin and all the power that it brings so I'll try to squeeze an hour tomorrow. @vanniktech prefix with Regarding this:
Do you mean on the In terms of change, it would make simpler to code, but I'm not sure I agree with the behavior. Reason is, you have a default task Regarding #9,if I understood the concern correctly, I've been using this method here findProperty(String key, String defaultValue) and it works really nice, I could just bring it over to this project and apply throughout. Also I'll leave a question about unifying into 1 API, or keep 2 separate. Which one? |
oh, never mind, I just saw this #24 superseding my PR. |
This got branched and improved on #25 |
Actually, roll back |
updated PR with commits from @gabrielittner |
I have the changes locally and will update the README once 0.6.0 is released. Once this is done we can update the open PR and merge it.
@budius feel free to update this PR once more and we can merge this |
@vanniktech sorry I took too long. Had a few days off. |
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.
No rush. Thanks for all of the work!
The client code will simply create a
mavenRepositories{ }
and add info on the needed repos.Example:
and this will create the tasks
uploadInternalRepo
anduploadBetaRepo