-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Proposing solution for: Automate Publishing of Javadocs #2631 #5993
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
Conversation
Looks like I will need to do some work to get it to fit the current javadoc folder structure and properly generate for specific versions in 2.x to match what is currently there. |
Codecov Report
@@ Coverage Diff @@
## 2.x #5993 +/- ##
============================================
- Coverage 98.25% 98.22% -0.04%
+ Complexity 6051 6050 -1
============================================
Files 656 656
Lines 44078 44078
Branches 6118 6118
============================================
- Hits 43311 43294 -17
- Misses 231 237 +6
- Partials 536 547 +11
Continue to review full report at Codecov.
|
build.gradle
Outdated
into 'api' | ||
} | ||
} | ||
commitMessage = 'Publishing a new page' |
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.
Including the version message would be great.
build.gradle
Outdated
System.setProperty('org.ajoberstar.grgit.auth.username', project.githubToken) | ||
} | ||
|
||
gitPublish { |
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.
Can this be conditional on the build mode? We'd like to publish only on release builds.
build.gradle
Outdated
@@ -103,6 +107,30 @@ javadoc { | |||
} | |||
} | |||
|
|||
|
|||
|
|||
if (project.hasProperty('githubToken')) { |
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.
How do I create this token value? -PgithubToken={$javadocGithubToken}
in buildViaTravis?
Please also make sure it doesn't delete the v1 javadocs by first clearing all the target directories. |
I've noted all of your suggestions, and I'll try to get those in order. As far as the token, I was thinking it was more of an optional thing depending on how one would authenticate to the repo. If its just travis that will be doing the publishing, I don't know that its completely necessary. |
…ectories are preserved, added releasemode conditional
build.gradle
Outdated
preserve { | ||
include '1.x/**' | ||
include '2.x/**' | ||
include 'images/**' |
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.
There is an rx
directory here to be preserved as well: https://github.com/ReactiveX/RxJava/tree/gh-pages/javadoc
build.gradle
Outdated
@@ -103,6 +107,30 @@ javadoc { | |||
} | |||
} | |||
|
|||
|
|||
if (rootProject.hasProperty("releaseMode")) { |
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.
releaseMode==full
build.gradle
Outdated
if (rootProject.hasProperty("releaseMode")) { | ||
gitPublish { | ||
|
||
repoUri = 'https://github.com/rpmcdougall/RxJava.git' |
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.
I guess this is for testing it in your own repo, right?
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.
Indeed, it will be changed to the proper repo when everything else is worked out.
So far it appears to be matching up with the current gh-pages branch as far as maintaining what needs to be there. However, I'm not sure the appropriate way to test making sure the release conditional is working as I'm super green when it comes to releases. Hopefully what I've got so far is mostly in line with what you are looking for. Here is the latest publish on my repo: I'm also curious how the project is migrating previous release documentation to the 2.x directory since I'm wondering how that might fit into what I am working on here if at all. |
To be clear, in the manual process I copy the files to 3 locations:
|
I've cobbled together a script in one of my support libraries and it seems to work. I guess custom copying patterns can be made via these kinds of cps. |
I was also just looking into making a couple more Gradle copy specs, but I could also do something liek that as well. |
Latest push seems to do the trick except for the root of 2.x/javadoc which doesnt seem to be caught up with 2.19. Are some of those previous releases in that directory not full releases? I believe I was caught between my preserve statements and my copyspec colliding a bit, so I'll have to work on that. https://github.com/rpmcdougall/RxJava/tree/cpstest/2.x/javadoc |
I started working on a bash script version: https://github.com/ReactiveX/RxJava/tree/JavadocAutoPublish and https://github.com/ReactiveX/RxJava/blob/JavadocAutoPublish/gradle/push.sh . I'm not proficient with shell scripts so it may take some tries to get it working with RxJava as well. |
Thanks for your efforts, but for now, we'll go with the shell script variant, which should give more control over what happens. |
This is referencing issue #2631 to automate publishing of JavaDocs for 2.x
I've added in a Gradle task using https://github.com/ajoberstar/gradle-git-publish and provided a block to pick up a Github token for auth if present. You can publish a doc with this method by generating the JavaDocs with the already included Gradle task javadocJar and then running the gitPublishPush Gradle task. I have this working here: https://rpmcdougall.github.io/RxJava/
Thanks!