Skip to content

Commit

Permalink
Refine the build to include real documentation in the kotlin module.
Browse files Browse the repository at this point in the history
Fix documentation bug.
  • Loading branch information
jnizet committed May 31, 2016
1 parent 610a499 commit 2236946
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
12 changes: 12 additions & 0 deletions DbSetup-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ javadoc {
options.addBooleanOption('Xdoclint:all,-missing', true)
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
manifest {
from project.ext.sharedManifest
}
}

artifacts {
archives javadocJar
}

def configurePomDependencies(pom) {
// we don't care about test dependencies
pom.dependencies = pom.dependencies.findAll {it.scope != 'test'}
Expand Down
36 changes: 36 additions & 0 deletions DbSetup-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.2"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.8"
}
}

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

description = 'Kotlin extensions for DbSetup'

Expand All @@ -17,6 +20,39 @@ dependencies {
testCompile 'junit:junit:4.11'
}

dokka {
inputs.dir 'src/main/kotlin'
jdkVersion = 8
}

task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = javadoc.destinationDir
inputs.dir 'src/main/kotlin'
jdkVersion = 8
}

task dokkaJar(type: Jar, dependsOn: dokka) {
classifier = 'dokka'
from dokka.outputDirectory
manifest {
from project.ext.sharedManifest
}
}

task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
manifest {
from project.ext.sharedManifest
}
}

artifacts {
archives javadocJar
archives dokkaJar
}

checkstyleMain {
source sourceSets.main.kotlin
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fun Insert.Builder.mappedValues(vararg entries: Pair<String, Any?>): Insert.Buil
* insertInto("user") {
* columns("id", "firstName", "lastName")
* withGeneratedValue("id", ValueGenerators.sequence())
* repeatingMappedValues(mapOf("firstName" to "John", "lastName" to "Doe")).times(100)
* repeatingValues(mapOf("firstName" to "John", "lastName" to "Doe")).times(100)
* }
* ```
*
Expand Down
13 changes: 2 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ subprojects { subProject ->
}
compileJava.dependsOn checkJavaVersion

def sharedManifest = manifest {
subProject.ext.sharedManifest = manifest {
attributes(['Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'ninja-squad.com'])
}

subProject.jar {
manifest {
from sharedManifest
from subProject.ext.sharedManifest
instruction 'Bundle-Vendor', 'ninja-squad.com'
}
}
Expand Down Expand Up @@ -67,17 +67,8 @@ subprojects { subProject ->
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
manifest {
from sharedManifest
}
}

artifacts {
archives sourcesJar
archives javadocJar
}

task checkSonatypeProperties << {
Expand Down

0 comments on commit 2236946

Please sign in to comment.