@@ -748,96 +748,14 @@ subprojects { Project subproject ->
748
748
testAnnotationProcessor " org.ow2.asm:asm-commons:$asmVersion "
749
749
}
750
750
751
- task moveConfigProps() {
752
- group ' documentation'
753
- doLast {
754
- ant. mkdir(dir : " ${ rootProject.buildDir} /config-props" )
755
- ant. move(file : " ${ subproject.buildDir} /classes/java/main/META-INF/config-properties.adoc" , tofile : " ${ rootProject.buildDir} /config-props/${ subproject.name} -config-properties.adoc" , failonerror : false , quiet : true )
756
- }
757
- }
758
-
759
- task javaDocAtReplacement(type : io.micronaut.docs.JavaDocAtValueReplacementTask , dependsOn : moveConfigProps) {
760
- adocFile = new File (" ${ rootProject.buildDir} /config-props/${ subproject.name} -config-properties.adoc" )
761
- rootProjectDir = rootProject. projectDir
762
- }
763
-
764
- task replaceAtLink(dependsOn : moveConfigProps) {
765
- group ' documentation'
766
-
767
- doLast {
768
- File file = new File (" ${ rootProject.buildDir} /config-props/${ subproject.name} -config-properties.adoc" )
769
- if (file. exists()) {
770
- def atLinkReplacer = { String str ->
771
- String newLine = str. substring(0 , str. indexOf(' {@link io.micronaut.' ))
772
- String sub = " api:" + str. substring(str. indexOf(' {@link io.micronaut.' ) + ' {@link io.micronaut.' . length())
773
- newLine + = sub. substring(0 , sub. indexOf(' }' )) + ' []'
774
- newLine + = sub. substring(sub. indexOf(' }' ) + ' }' . length())
775
- newLine
776
- }
777
-
778
- List<String > lines = file. readLines()
779
- List<String > outputLines = []
780
- for (String line : lines) {
781
- String proccessedLine = line
782
- while (proccessedLine. contains(' {@link io.micronaut.' )) {
783
- proccessedLine = atLinkReplacer(proccessedLine)
784
- }
785
- outputLines << proccessedLine
786
- }
787
- file. text = outputLines. join(' \n ' )
788
- }
789
- }
790
- }
791
- task processConfigProps(dependsOn : [replaceAtLink, javaDocAtReplacement]) {
792
- group ' documentation'
793
- ext {
794
- individualConfigPropsFolder = " ${ rootProject.buildDir} /generated/configurationProperties"
795
- }
796
- doFirst {
797
- if (! new File (" ${ rootProject.buildDir} /generated" ). exists()) {
798
- new File (" ${ rootProject.buildDir} /generated" ). mkdir()
799
- }
800
- if (! new File (" ${ rootProject.buildDir} /generated/configurationProperties" ). exists()) {
801
- new File (" ${ rootProject.buildDir} /generated/configurationProperties" ). mkdir()
802
- }
803
- }
804
- doLast {
805
-
806
- def f = new File (" ${ rootProject.buildDir} /config-props/${ subproject.name} -config-properties.adoc" )
807
- if (f. exists()) {
808
- def lines = f. readLines()
809
- def separator = " <<<"
810
- List<String > accumulator = []
811
- String configurationPropertyName = ' '
812
- for (String line : lines) {
813
-
814
- if (line. startsWith(' <a id="' )) {
815
- String sub = line. substring(line. indexOf(' id="' ) + ' id="' . length())
816
- sub = sub. substring(0 , sub. indexOf(' "' ))
817
- configurationPropertyName = sub
818
- }
819
- if (line == separator) {
820
- File outputfile = new File (" ${ individualConfigPropsFolder} /${ configurationPropertyName} .adoc" )
821
- outputfile. createNewFile()
822
- outputfile. text = accumulator. join(' \n ' )
823
- accumulator = []
824
- configurationPropertyName = null
825
- } else {
826
- accumulator << line
827
- }
828
- }
829
- }
830
- }
831
- }
832
-
833
751
groovydoc {
834
752
classpath + = project. configurations. documentation
835
753
}
836
754
837
755
task allDeps(type : DependencyReportTask ) {}
838
756
}
839
757
840
- apply from : " gradle/docs.gradle"
758
+ apply from :" https://raw.githubusercontent.com/micronaut-projects/micronaut-docs/v ${ micronautDocsVersion } / gradle/docs.gradle"
841
759
842
760
// IDEA 2017.2 made a breaking change with IDE build output vs gradle build output
843
761
// [see https://youtrack.jetbrains.com/issue/IDEA-175172]
0 commit comments