-
Notifications
You must be signed in to change notification settings - Fork 226
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 dokka artifacts #122 #126
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7943d44
Add dokka documentation artifacts
charlesdurham 1569705
Fix issue with empty android-kotlin sources jar
charlesdurham 60f6162
Add license
charlesdurham 5c135d3
Alphabetize dependencies.gradle
charlesdurham 6515296
Consolidate artifacts.gradle files
charlesdurham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,101 @@ def getRepositoryPassword() { | |
return hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : "" | ||
} | ||
|
||
def kotlinAndroidArtifactTasks() { | ||
if (!project.plugins.hasPlugin('org.jetbrains.dokka-android')) { | ||
throw new GradleException("Apply the dokka-android plugin in ${project.name}") | ||
} | ||
|
||
dokka { | ||
externalDocumentationLink { | ||
url = new URL("http://reactivex.io/RxJava/2.x/javadoc/") | ||
} | ||
|
||
outputFormat = 'html' | ||
outputDirectory = "$buildDir/docs/kdoc" | ||
sourceDirs = android.sourceSets.main.java.srcDirs | ||
} | ||
|
||
task docJar(type: Jar, dependsOn: dokka) { | ||
classifier = 'javadoc' | ||
from dokka.outputDirectory | ||
} | ||
|
||
task sourceJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.srcDirs | ||
} | ||
} | ||
|
||
def kotlinArtifactTasks() { | ||
if (!project.plugins.hasPlugin('org.jetbrains.dokka')) { | ||
throw new GradleException("Apply the dokka plugin in ${project.name}") | ||
} | ||
|
||
dokka { | ||
externalDocumentationLink { | ||
url = new URL("http://reactivex.io/RxJava/2.x/javadoc/") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
} | ||
|
||
outputFormat = 'html' | ||
outputDirectory = "$buildDir/docs/kdoc" | ||
sourceDirs = sourceSets.main.allSource | ||
} | ||
|
||
task docJar(type: Jar, dependsOn: dokka) { | ||
classifier = 'javadoc' | ||
from dokka.outputDirectory | ||
} | ||
|
||
task sourceJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
} | ||
|
||
def androidArtifactTasks() { | ||
task androidJavadoc(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
|
||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
exclude '**/internal/*' | ||
|
||
if (JavaVersion.current().isJava8Compatible()) { | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
} | ||
} | ||
|
||
task docJar(type: Jar, dependsOn: androidJavadoc) { | ||
classifier = 'javadoc' | ||
from androidJavadoc.destinationDir | ||
} | ||
|
||
task sourceJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.sourceFiles | ||
} | ||
} | ||
|
||
def javaArtifactTasks() { | ||
task javaJavadoc(type: Javadoc) { | ||
source = sourceSets.main.allSource | ||
|
||
if (JavaVersion.current().isJava8Compatible()) { | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
} | ||
} | ||
|
||
task docJar(type: Jar, dependsOn: javaJavadoc) { | ||
classifier = 'javadoc' | ||
from javaJavadoc.destinationDir | ||
} | ||
|
||
task sourceJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource.srcDirs | ||
} | ||
} | ||
|
||
afterEvaluate { project -> | ||
uploadArchives { | ||
repositories { | ||
|
@@ -135,26 +230,10 @@ afterEvaluate { project -> | |
} | ||
} | ||
|
||
task androidJavadocs(type: Javadoc) { | ||
if (!project.plugins.hasPlugin('kotlin-android')) { | ||
source = android.sourceSets.main.java.srcDirs | ||
} | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
exclude '**/internal/*' | ||
|
||
if (JavaVersion.current().isJava8Compatible()) { | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
} | ||
} | ||
|
||
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { | ||
classifier = 'javadoc' | ||
from androidJavadocs.destinationDir | ||
} | ||
|
||
task androidSourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.sourceFiles | ||
if (project.plugins.hasPlugin('kotlin-android')) { | ||
kotlinAndroidArtifactTasks() | ||
} else { | ||
androidArtifactTasks() | ||
} | ||
} else { | ||
install { | ||
|
@@ -193,33 +272,15 @@ afterEvaluate { project -> | |
} | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
} | ||
|
||
if (JavaVersion.current().isJava8Compatible()) { | ||
allprojects { | ||
tasks.withType(Javadoc) { | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
} | ||
if (project.plugins.hasPlugin('kotlin')) { | ||
kotlinArtifactTasks() | ||
} else { | ||
javaArtifactTasks() | ||
} | ||
} | ||
|
||
artifacts { | ||
if (project.getPlugins().hasPlugin('com.android.application') || | ||
project.getPlugins().hasPlugin('com.android.library')) { | ||
archives androidSourcesJar | ||
archives androidJavadocsJar | ||
} else { | ||
archives sourcesJar | ||
archives javadocJar | ||
} | ||
archives sourceJar | ||
archives docJar | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should this point to https://uber.github.io/AutoDispose/0.x/ ?
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.
Hm, what are you thinking here? That's what builds in linking between the kdoc and rxjava's doc, so if you're looking at documentation that links to rxjava you can click on it and jump straight to the rxjava documentation.
I could see adding https://uber.github.io/AutoDispose/0.x/ being useful (at least until there's proper inter-module linking). Although I think each module's doc might need to be linked independently. The dokka examples indicate you can have multiple external documentation links so if you want I could add it and keep rxjava.
I actually didn't even realize the documentation was hosted at https://uber.github.io/AutoDispose/0.x/, this PR just creates javadoc artifacts for maven.
I see https://github.com/uber/AutoDispose/tree/gh-pages/0.x but don't really know how/if the process of getting the doc in there is automated. If you can point me in the right direction I'd be happy to include that as part of this PR.
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.
yeah I'd held off on publicizing the docs site till dokka was figured out. I upload them via osstrich, unfortunately not sure automating it is viable vs just doing it manually after releases (don't worry about it for this PR). I didn't realize that was for dependencies of the project though, so this makes sense 👍