@@ -7,7 +7,6 @@ buildscript {
77 dependencies {
88 classpath " org.graceframework:grace-gradle-plugin:$graceVersion "
99 // classpath "org.graceframework.plugins:asset-pipeline-gradle:$assetPipelineVersion"
10- classpath ' org.asciidoctor:asciidoctor-gradle-jvm:4.0.3'
1110 classpath " com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion "
1211 classpath " org.graceframework.plugins:views-gradle:6.3.0-M1"
1312 classpath " io.github.gradle-nexus:publish-plugin:2.0.0"
@@ -32,8 +31,10 @@ ext."signing.keyId" = System.getenv("SIGNING_KEY") ?: project.hasProperty("signi
3231ext. " signing.password" = System . getenv(" SIGNING_PASSPHRASE" ) ?: project. hasProperty(" signing.password" ) ? project. getProperty(' signing.password' ) : null
3332ext. " signing.secretKeyRingFile" = project. hasProperty(" signing.secretKeyRingFile" ) ? project. getProperty(' signing.secretKeyRingFile' ) : null
3433
34+ apply plugin : ' groovy'
3535apply plugin : ' maven-publish'
3636apply plugin : " io.github.gradle-nexus.publish-plugin"
37+ apply plugin : ' org.graceframework.grace-doc'
3738
3839nexusPublishing {
3940 repositories {
@@ -50,23 +51,33 @@ nexusPublishing {
5051 }
5152}
5253
53- subprojects { project ->
54-
54+ allprojects {
5555 ext {
5656 groovyVersion = System . getenv(' CI_GROOVY_VERSION' ) ?: project. groovyVersion
5757 }
5858
5959 repositories {
60- // mavenLocal()
6160 mavenCentral()
62- if (groovyVersion && groovyVersion . endsWith(' -SNAPSHOT' )) {
61+ if (project . projectVersion . endsWith(' -SNAPSHOT' )) {
6362 maven {
6463 name = ' Sonatype OSS Snapshot Repo'
65- url = ' https://s01.oss.sonatype.org/content/repositories/snapshots/'
64+ url = " https://s01.oss.sonatype.org/content/repositories/snapshots/"
6665 }
6766 }
6867 }
6968
69+ configurations {
70+ documentation
71+ }
72+
73+ dependencies {
74+ documentation " com.github.javaparser:javaparser-core:$javaParserCoreVersion "
75+ documentation " org.apache.groovy:groovy:$groovyVersion "
76+ documentation " org.apache.groovy:groovy-ant:$groovyVersion "
77+ }
78+ }
79+
80+ subprojects { project ->
7081 if (project. name. startsWith(" examples" )) {
7182 group = " examples"
7283
@@ -268,3 +279,43 @@ subprojects { project ->
268279 shouldRunAfter(tasks. withType(Sign ))
269280 }
270281}
282+
283+
284+ def cleanTask = project. tasks. findByName(' clean' )
285+ if (cleanTask == null ) {
286+ task clean(type : Delete ) {
287+ delete(buildDir)
288+ }
289+ }
290+ else {
291+ cleanTask. doLast {
292+ ant. delete(dir : ' build/docs' )
293+ }
294+ }
295+
296+ tasks. withType(Groovydoc ) {
297+ group = ' Documentation'
298+ docTitle = " Grace Data MongoDB - ${ project.version} "
299+ destinationDir = project. file(' build/docs/manual/api' )
300+ def files = []
301+ project. rootProject. subprojects
302+ .findAll { ! it. name != ' docs' && ! it. name. startsWith(' examples' ) }
303+ .each { subproject ->
304+ if (subproject. file(' src/main/groovy' ). exists()) {
305+ files + = subproject. files(' src/main/groovy' )
306+ }
307+ if (subproject. file(' src/main/java' ). exists()) {
308+ files + = subproject. files(' src/main/java' )
309+ }
310+ }
311+ if (project. file(' src/main/groovy' ). exists()) {
312+ files + = project. files(' src/main/groovy' )
313+ }
314+ source = files
315+ classpath + = configurations. documentation
316+ }
317+
318+ docs {
319+ dependsOn groovydoc
320+ sourceDir = project. file(' src/docs' )
321+ }
0 commit comments