-
Notifications
You must be signed in to change notification settings - Fork 13
[FEATURE] Add and improve javadoc tasks #33
Conversation
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 like the changes overall.
Could you also convert all of your comments to sentences?
Plus for the new behavior can you add unit tests?
README.md
Outdated
@@ -19,7 +19,7 @@ buildscript { | |||
mavenCentral() | |||
} | |||
dependencies { | |||
classpath 'com.vanniktech:gradle-android-javadoc-plugin:0.2.1' | |||
classpath 'com.vanniktech:gradle-android-javadoc-plugin:0.3.0' |
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.
We'll need this to be 0.2.1
as it won't get released automatically.
title = "Documentation for Android $project.android.defaultConfig.versionName v$project.android.defaultConfig.versionCode" | ||
description = "Generates Javadoc for $variant.name." | ||
group = 'Documentation' | ||
// apply a filter because use can configure javadoc for some variants but not all of them |
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.
use can
should it be you can
?
Closure outputDir = { Project project -> | ||
"${project.buildDir}/docs/javadoc/" | ||
} | ||
|
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.
nit: remove
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 don't want to remove this one because I would like it to be the default. By default, javadoc generated by java plugin is stored in build/docs/javadoc.
@@ -38,8 +38,8 @@ class GenerationTest { | |||
public void testJavaProject() { | |||
project.plugins.apply('java') | |||
|
|||
expectedException.expect(UnsupportedOperationException.class) | |||
expectedException.expectMessage('Project is not an Android project') | |||
//expectedException.expect(UnsupportedOperationException.class) |
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.
just remove this then
expectedException.expect(UnsupportedOperationException.class) | ||
expectedException.expectMessage('Project is not an Android project') | ||
//expectedException.expect(UnsupportedOperationException.class) | ||
//expectedException.expectMessage('Project is not an Android project') |
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.
just remove this then
gradle.properties
Outdated
@@ -1,5 +1,4 @@ | |||
GROUP=com.vanniktech | |||
VERSION_NAME=0.2.2-SNAPSHOT | |||
VERSION_NAME=0.3.0-SNAPSHOT |
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.
please add the group back
import org.gradle.api.Project | ||
import org.gradle.api.Task | ||
import com.vanniktech.android.javadoc.extensions.Options | ||
import org.gradle.api.* |
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.
please don't use star imports
import org.gradle.api.tasks.javadoc.Javadoc | ||
import org.gradle.external.javadoc.JavadocMemberLevel | ||
|
||
class Generation implements Plugin<Project> { | ||
|
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.
nit: remove
} | ||
logger = project.getLogger() | ||
|
||
createExtensions(project) |
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.
just inline this one
* | ||
* @author Bastien Paul | ||
*/ | ||
public class Options { |
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.
Rename it to AndroidJavaDocExtension
7581f01
to
9682bbf
Compare
- Create task for all projects and subprojects - Create archive task - Add compatibility for javadoc 7 comments - Add customization
9682bbf
to
8c6d26b
Compare
Hi, You can review changes I've made. Thanks |
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.
Few more small things. Once they're resolved I'll merge this
String taskName = genJavadocTaskName(project, variant) | ||
|
||
logger.debug "Create task ${taskName} for project ${project.name}, variant ${variant.name}" | ||
// protection if a task already exists because the name of the task is configurable |
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.
This one still needs to be transformed.
logger.debug "task $taskName already exists" | ||
return project.tasks.findByPath(taskName) | ||
} else { | ||
Task t1 = createJavadocTask(project, variant, taskName) |
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.
javadocTask
instead of t1
?
return project.tasks.findByPath(taskName) | ||
} else { | ||
Task t1 = createJavadocTask(project, variant, taskName) | ||
Task t2 = createJavadocArchiveTask(project, variant, genJavadocJarTaskName(project, variant)) |
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.
javadocArchieveTask
instead of t2
Closure outputDir = { Project project -> | ||
"${project.buildDir}/docs/javadoc/" | ||
} | ||
|
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.
nit: remove
import org.gradle.api.Project | ||
|
||
/** | ||
* <p>Created on 23/06/17 |
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 you go and remove this alltogether? No file has proper date / authors. You'll still get credited in the release notes for the feature.
class GenerationTest { | ||
@Rule public ExpectedException expectedException = ExpectedException.none() | ||
@Rule | ||
public ExpectedException expectedException = ExpectedException.none() |
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.
nit: restore on same line
Hi, I hope this one is the good one ! Thanks, |
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.
Thanks for the contribution !
Hi,
You have made a great job in creating this plugin that I was looking for !
I have made some addition to your plugin based on some experience I have.
androidJavadoc
project extension to customize task name, filter variant and specify javadoc output dirPlease consider my changes and feel free to comment or improve them.
Best regards,
Bastien