Skip to content

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

Closed
wants to merge 15 commits into from

Conversation

rpmcdougall
Copy link

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!

@rpmcdougall rpmcdougall changed the title Gh pages additions Proposing solution for: Automate Publishing of Javadocs #2631 May 5, 2018
@rpmcdougall
Copy link
Author

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
Copy link

codecov bot commented May 5, 2018

Codecov Report

Merging #5993 into 2.x will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...l/operators/observable/ObservableFlatMapMaybe.java 84.96% <0%> (-9.81%) 2% <0%> (ø)
...rnal/operators/flowable/FlowableFlatMapSingle.java 94.56% <0%> (-2.18%) 2% <0%> (ø)
...ernal/operators/flowable/FlowableFromIterable.java 94.11% <0%> (-2.14%) 5% <0%> (ø)
.../io/reactivex/disposables/CompositeDisposable.java 98.14% <0%> (-1.86%) 39% <0%> (-1%)
...perators/single/SingleFlatMapIterableFlowable.java 96.66% <0%> (-1.67%) 2% <0%> (ø)
...perators/mixed/ObservableConcatMapCompletable.java 98.49% <0%> (-1.51%) 3% <0%> (ø)
...internal/operators/flowable/FlowableSwitchMap.java 95.28% <0%> (-1.42%) 3% <0%> (ø)
...perators/mixed/ObservableSwitchMapCompletable.java 98.94% <0%> (-1.06%) 3% <0%> (ø)
...ternal/operators/observable/ObservableFlatMap.java 85.94% <0%> (-0.96%) 3% <0%> (ø)
...nternal/operators/observable/ObservableCreate.java 97.39% <0%> (-0.87%) 2% <0%> (ø)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90203b6...136b5d2. Read the comment docs.

build.gradle Outdated
into 'api'
}
}
commitMessage = 'Publishing a new page'
Copy link
Member

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 {
Copy link
Member

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')) {
Copy link
Member

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?

@akarnokd
Copy link
Member

akarnokd commented May 5, 2018

Please also make sure it doesn't delete the v1 javadocs by first clearing all the target directories.

@rpmcdougall
Copy link
Author

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.

build.gradle Outdated
preserve {
include '1.x/**'
include '2.x/**'
include 'images/**'
Copy link
Member

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")) {
Copy link
Member

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'
Copy link
Member

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?

Copy link
Author

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.

@rpmcdougall
Copy link
Author

rpmcdougall commented May 5, 2018

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:
https://github.com/rpmcdougall/RxJava/tree/gh-pages
https://rpmcdougall.github.io/RxJava/javadoc/

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.

@akarnokd
Copy link
Member

akarnokd commented May 5, 2018

To be clear, in the manual process I copy the files to 3 locations:

  • under /javadoc, preserving the rx and resources directory
  • under 2.x/javadoc
  • under 2.x/javadoc/2.x.y release version specific

@akarnokd
Copy link
Member

akarnokd commented May 5, 2018

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.

@rpmcdougall
Copy link
Author

I was also just looking into making a couple more Gradle copy specs, but I could also do something liek that as well.
https://docs.gradle.org/current/javadoc/org/gradle/api/file/CopySpec.html

@rpmcdougall
Copy link
Author

rpmcdougall commented May 5, 2018

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

@akarnokd
Copy link
Member

akarnokd commented May 5, 2018

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.

@akarnokd
Copy link
Member

akarnokd commented May 6, 2018

Thanks for your efforts, but for now, we'll go with the shell script variant, which should give more control over what happens.

@akarnokd akarnokd closed this May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants