Cleanup.
This commit is contained in:
parent
9993309a0f
commit
ca4c87b3cf
4 changed files with 8 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
|
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
|
||||||
import org.jetbrains.dokka.gradle.LinkMapping
|
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
import java.io.FileInputStream
|
import java.io.FileInputStream
|
||||||
import java.util.Properties
|
import java.util.Properties
|
||||||
|
@ -141,14 +141,14 @@ tasks {
|
||||||
outputFormat = "html"
|
outputFormat = "html"
|
||||||
outputDirectory = "$buildDir/javadoc"
|
outputDirectory = "$buildDir/javadoc"
|
||||||
jdkVersion = 8
|
jdkVersion = 8
|
||||||
val mapping = LinkMapping().apply {
|
|
||||||
|
linkMapping {
|
||||||
dir = "src/main/kotlin"
|
dir = "src/main/kotlin"
|
||||||
url = "https://github.com/ethauvin/${project.name}/blob/${project.version}/src/main/kotlin"
|
url = "https://github.com/ethauvin/akismet-kotlin/blob/master/src/main/kotlin"
|
||||||
suffix = "#L"
|
suffix = "#L"
|
||||||
}
|
}
|
||||||
|
|
||||||
includes = listOf("config/dokka/packages.md")
|
includes = listOf("config/dokka/packages.md")
|
||||||
linkMappings = arrayListOf(mapping)
|
|
||||||
includeNonPublic = false
|
includeNonPublic = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,5 @@ tasks {
|
||||||
group = "application"
|
group = "application"
|
||||||
main = "com.example.AkismetSample"
|
main = "com.example.AkismetSample"
|
||||||
classpath = sourceSets["main"].runtimeClasspath
|
classpath = sourceSets["main"].runtimeClasspath
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,13 +182,12 @@ open class Akismet(apiKey: String) {
|
||||||
* Submit Ham.
|
* Submit Ham.
|
||||||
* See the [Akismet API](https://akismet.com/development/api/#submit-ham) for more details.
|
* See the [Akismet API](https://akismet.com/development/api/#submit-ham) for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fun submitHam(comment: AkismetComment): Boolean {
|
fun submitHam(comment: AkismetComment): Boolean {
|
||||||
return executeMethod(buildApiUrl("submit-ham"), buildFormBody(comment))
|
return executeMethod(buildApiUrl("submit-ham"), buildFormBody(comment))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a [Date][java.util.Date] to a UTC timestamp for use with [dateGmt][AkismetComment.dateGmt], etc.
|
* Convert a date to a UTC timestamp.
|
||||||
*/
|
*/
|
||||||
fun dateToGmt(date: Date): String {
|
fun dateToGmt(date: Date): String {
|
||||||
return DateTimeFormatter.ISO_DATE_TIME.format(
|
return DateTimeFormatter.ISO_DATE_TIME.format(
|
||||||
|
@ -196,8 +195,7 @@ open class Akismet(apiKey: String) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a [LocalDateTime][java.time.LocalDateTime] to a UTC timestamp for use with
|
* Convert a locale date/time to a UTC timestamp.
|
||||||
* [dateGmt][AkismetComment.dateGmt], etc.
|
|
||||||
*/
|
*/
|
||||||
fun dateToGmt(date: LocalDateTime): String {
|
fun dateToGmt(date: LocalDateTime): String {
|
||||||
return DateTimeFormatter.ISO_DATE_TIME.format(
|
return DateTimeFormatter.ISO_DATE_TIME.format(
|
||||||
|
@ -291,7 +289,7 @@ open class Akismet(apiKey: String) {
|
||||||
add("user_role", comment.userRole)
|
add("user_role", comment.userRole)
|
||||||
}
|
}
|
||||||
if (comment.isTest) {
|
if (comment.isTest) {
|
||||||
add("is_test", "true")
|
add("is_test", "1")
|
||||||
}
|
}
|
||||||
if (comment.recheckReason.isNotBlank()) {
|
if (comment.recheckReason.isNotBlank()) {
|
||||||
add("recheck_reason", comment.recheckReason)
|
add("recheck_reason", comment.recheckReason)
|
||||||
|
|
|
@ -128,7 +128,7 @@ open class AkismetComment() {
|
||||||
* Akismet.
|
* Akismet.
|
||||||
*
|
*
|
||||||
* How the submitted content interacts with the server can be very telling, so please include as much of it as
|
* How the submitted content interacts with the server can be very telling, so please include as much of it as
|
||||||
* ossible.
|
* possible.
|
||||||
*/
|
*/
|
||||||
var other: Map<String, String> = emptyMap()
|
var other: Map<String, String> = emptyMap()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue