Skip to content

Add automated docs in Travis CI #801

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ build
testData
testCache
server.config
docs/

# Jacoco
jacoco.exec
Expand Down
29 changes: 19 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ before_install:
- mkdir "$ANDROID_HOME/licenses" || true
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"

script:
- ./gradlew clean testDebugUnitTest jacocoTestReport

after_success:
- ./gradlew coveralls
- codecov
Expand All @@ -26,10 +23,22 @@ cache:
- $HOME/.gradle
- $HOME/.m2/repository

deploy:
provider: script
script: ./gradlew bintrayUpload
skip_cleanup: true
on:
branch: master
tags: true
jobs:
include:
- stage: test
script: ./gradlew clean testDebugUnitTest jacocoTestReport
- stage: release
script: ./gradlew javadocRelease
deploy:
- provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
local_dir: docs/
on:
all_branches: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't we want to only do this on the master branch, @addisonElliott ?

Copy link
Contributor Author

@addisonElliott addisonElliott Apr 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spent an hour or two thinking the same thing. I used the same code that @flovilmart used when he added automated docs for JS and iOS.

See here:

all_branches excludes PRs. It took me awhile to find documentation saying that.

My guess is the thought process is that the only new branches on Parse-SDK-Android will be the master branch commit or new tags. Thus, the latest documentation will be pushed whenever a new commit to master is made or a new release is made.

- provider: script
script: ./gradlew bintrayUpload
skip_cleanup: true
on:
branch: master
tags: true
1 change: 1 addition & 0 deletions Parse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ android.libraryVariants.all { variant ->

def javadoc = task("javadoc${variant.name.capitalize()}", type: Javadoc) {
description "Generates Javadoc for $variant.name."
destinationDir = rootProject.file("docs/api")
source = variant.javaCompile.source
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar)
Expand Down