Skip to content
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 5 commits into from
Nov 9, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ buildscript {
dependencies {
classpath deps.build.gradlePlugins.android
classpath deps.build.gradlePlugins.kotlin
classpath deps.build.gradlePlugins.dokkaAndroid
}
}

apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'org.jetbrains.dokka-android'

android {
compileSdkVersion deps.build.compileSdkVersion
Expand All @@ -53,4 +55,5 @@ dependencies {
androidTestCompile project(':test-utils')
}

apply from: rootProject.file('gradle/android-kotlin-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ buildscript {
dependencies {
classpath deps.build.gradlePlugins.android
classpath deps.build.gradlePlugins.kotlin
classpath deps.build.gradlePlugins.dokkaAndroid
}
}

apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'org.jetbrains.dokka-android'

android {
compileSdkVersion deps.build.compileSdkVersion
Expand All @@ -53,4 +55,5 @@ dependencies {
androidTestCompile project(':test-utils')
}

apply from: rootProject.file('gradle/android-kotlin-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ tasks.withType(JavaCompile) {
"-XepOpt:NullAway:AnnotatedPackages=com.uber"]
}

apply from: rootProject.file('gradle/android-java-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
1 change: 1 addition & 0 deletions android/autodispose-android-archcomponents/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ tasks.withType(JavaCompile) {
"-XepOpt:NullAway:AnnotatedPackages=com.uber"]
}

apply from: rootProject.file('gradle/android-java-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
3 changes: 3 additions & 0 deletions android/autodispose-android-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ buildscript {
dependencies {
classpath deps.build.gradlePlugins.android
classpath deps.build.gradlePlugins.kotlin
classpath deps.build.gradlePlugins.dokkaAndroid
}
}

apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'org.jetbrains.dokka-android'

android {
compileSdkVersion deps.build.compileSdkVersion
Expand All @@ -53,4 +55,5 @@ dependencies {
androidTestCompile project(':test-utils')
}

apply from: rootProject.file('gradle/android-kotlin-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
1 change: 1 addition & 0 deletions android/autodispose-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ tasks.withType(JavaCompile) {
options.compilerArgs += ["-Xep:NullAway:ERROR", "-XepOpt:NullAway:AnnotatedPackages=com.uber"]
}

apply from: rootProject.file('gradle/android-java-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
3 changes: 3 additions & 0 deletions autodispose-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
buildscript {
dependencies {
classpath deps.build.gradlePlugins.kotlin
classpath deps.build.gradlePlugins.dokka
}
}

apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jetbrains.dokka'

dependencies {
compile deps.kotlin.stdlib
Expand All @@ -13,4 +15,5 @@ dependencies {
testCompile project(':test-utils')
}

apply from: rootProject.file('gradle/kotlin-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
1 change: 1 addition & 0 deletions autodispose-rxlifecycle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ tasks.withType(JavaCompile) {
options.compilerArgs += ["-Xep:NullAway:ERROR", "-XepOpt:NullAway:AnnotatedPackages=com.uber"]
}

apply from: rootProject.file('gradle/java-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
1 change: 1 addition & 0 deletions autodispose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ tasks.withType(JavaCompile) {
options.compilerArgs += ["-Xep:NullAway:ERROR", "-XepOpt:NullAway:AnnotatedPackages=com.uber"]
}

apply from: rootProject.file('gradle/java-artifacts.gradle')
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
20 changes: 20 additions & 0 deletions gradle/android-java-artifacts.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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
}
19 changes: 19 additions & 0 deletions gradle/android-kotlin-artifacts.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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.sourceFiles
}
7 changes: 5 additions & 2 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def versions = [
archComponents: '1.0.0-rc1',
errorProne: '2.1.1',
kotlin: '1.1.51',
support: '26.1.0'
support: '26.1.0',
dokka: '0.9.15'
]

def build = [
Expand All @@ -41,7 +42,9 @@ def build = [
android: 'com.android.tools.build:gradle:2.3.0',
apt: 'net.ltgt.gradle:gradle-apt-plugin:0.11',
errorProne: 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.11',
kotlin: "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
kotlin: "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
dokka: "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: alpha this

dokkaAndroid: "org.jetbrains.dokka:dokka-android-gradle-plugin:${versions.dokka}"
]
]

Expand Down
50 changes: 2 additions & 48 deletions gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,28 +134,6 @@ 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
}
} else {
install {
repositories.mavenInstaller {
Expand Down Expand Up @@ -192,34 +170,10 @@ 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')
}
}
}

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
}
}
17 changes: 17 additions & 0 deletions gradle/java-artifacts.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
task javaJavadoc(type: Javadoc) {
source = sourceSets.main.allSource

if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}

task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource.srcDirs
}

task docJar(type: Jar, dependsOn: javaJavadoc) {
classifier = 'javadoc'
from javaJavadoc.destinationDir
}
19 changes: 19 additions & 0 deletions gradle/kotlin-artifacts.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
dokka {
externalDocumentationLink {
url = new URL("http://reactivex.io/RxJava/2.x/javadoc/")
}

outputFormat = 'html'
outputDirectory = "$buildDir/docs/kdoc"
sourceDirs = sourceSets.main.allSource
}

task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task docJar(type: Jar, dependsOn: dokka) {
classifier = 'javadoc'
from dokka.outputDirectory
}