Skip to content

Commit

Permalink
Make custom macros classes Gradle 7 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Nov 26, 2021
1 parent c719e9a commit 835498f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PublishGuide extends DefaultTask {
@Input @Optional Boolean asciidoc = false
@Input @Optional String sourceRepo
@Input @Optional Properties properties = new Properties()
@Input Collection macros = []
@Input @Nested Collection macros = []
@InputDirectory File workDir = project.buildDir as File

@TaskAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,29 @@
*/
package grails.doc.macros

import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory

import java.util.regex.Pattern
import org.radeox.macro.BaseMacro
import org.radeox.macro.CodeMacro
import org.radeox.macro.parameter.BaseMacroParameter
import org.radeox.macro.parameter.MacroParameter
import org.radeox.util.Encoder

class GspTagSourceMacro extends BaseMacro {
class GspTagSourceMacro extends BaseMacro implements Serializable {

private static final long serialVersionUID = 0L;

@InputDirectory
List baseDirs

GspTagSourceMacro(basedir) {
if (!(basedir instanceof Collection || basedir.class.array)) basedir = [ basedir ]
baseDirs = basedir.collect { f -> f as File }
}

@Input
String getName() { "source" }

void execute(Writer out, MacroParameter params) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package grails.doc.macros

import org.gradle.api.tasks.Input
import org.radeox.macro.BaseMacro
import org.radeox.macro.parameter.MacroParameter

class HiddenMacro extends BaseMacro {
class HiddenMacro extends BaseMacro implements Serializable {

private static final long serialVersionUID = 0L;

@Input
String getName() { "hidden" }

void execute(Writer out, MacroParameter params) {
Expand Down

0 comments on commit 835498f

Please sign in to comment.