File: brltty-help.gradle

package info (click to toggle)
brltty 6.8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,776 kB
  • sloc: ansic: 150,447; java: 13,484; sh: 9,667; xml: 5,702; tcl: 2,634; makefile: 2,328; awk: 713; lisp: 366; python: 321; ml: 301
file content (43 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
void listProperties (Object object, String name, int level=0) {
  print ("| " * level)
  level += 1
  print name

  if (object instanceof Map) {
    println "[:]"
    def map = object as Map

    map.keySet().sort().each { key ->
      listProperties(map[key], key, level)
    }
  } else if (object instanceof List) {
    println "[]"
    def list = object as List
    int index = 0

    list.each { element ->
      listProperties(element, ('[' + index++ + ']'), level)
    }
  } else {
    print ": "

    if (object instanceof Project) {
      print "object "
      object = object.name
    } else if (object instanceof Task) {
      print "task "
      object = object.name
    }

    println object
  }
}

tasks.register("brlttyListProperties") {
  group "help"
  description "Lists all of brltty's properties."

  doLast {
    listProperties(rootProject.brltty, "brltty")
  }
}