forked from FXMisc/RichTextFX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
137 lines (117 loc) · 5.62 KB
/
build.gradle
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
dependencies {
compile project(":richtextfx")
}
jar {
manifest {
attributes(
'Specification-Title': 'RichTextFX Demos',
'Specification-Version': project.specificationVersion,
'Implementation-Title': 'RichTextFX Demos',
'Implementation-Version': project.version)
}
}
task fatJar(type: Jar, dependsOn: classes) {
appendix = 'fat'
from sourceSets.main.output
from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
}
assemble.dependsOn fatJar
task demos(description: "Lists the names and the descriptions of the demos that can be run via a Gradle task") {
doLast {
// sort the demos first, so they can be added in the build file in any order
def list = []
tasks.withType(JavaExec) {
if (it.name.endsWith("Demo")) {
list.add(it)
}
}
list.sort { first, next -> first.name <=> next.name }
.each {
println " ${it.name} - ${it.description}"
}
}
}
// To add a task for a demo, use the following template:
/*
task ClassNameDemo(type: JavaExec, dependsOn: classes,
description: "A description of what the demo does") {
main = 'org.fxmisc.richtext.demo.ClassNameDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
*/
task JavaKeywordsDemo(type: JavaExec, dependsOn: classes,
description: "A CodeArea with Java syntax highlighting that is computed on the JavaFX Application Thread") {
main = 'org.fxmisc.richtext.demo.JavaKeywordsDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task JavaKeywordsAsyncDemo(type: JavaExec, dependsOn: classes,
description: "A CodeArea with Java syntax highlighting that is computed on a background thread") {
main = 'org.fxmisc.richtext.demo.JavaKeywordsAsyncDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task XMLEditorDemo(type: JavaExec, dependsOn: classes,
description: "An area with XML syntax highlighting") {
main = 'org.fxmisc.richtext.demo.XMLEditorDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task ManualHighlightingDemo(type: JavaExec, dependsOn: classes,
description: "Manually highlight various parts of the text in an area via buttons") {
main = 'org.fxmisc.richtext.demo.ManualHighlightingDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task RichTextDemo(type: JavaExec, dependsOn: classes,
description: "An area showing a large number of RichTextFX's features: " +
"inlined images, rich text (e.g. text alignment and background colors, etc.), and save/load capabilities") {
main = 'org.fxmisc.richtext.demo.richtext.RichTextDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task PopupDemo(type: JavaExec, dependsOn: classes,
description: "A popup that follows the caret and selection when they move") {
main = 'org.fxmisc.richtext.demo.PopupDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task TooltipDemo(type: JavaExec, dependsOn: classes,
description: "Tells you the letter over which the mouse is hovering") {
main = 'org.fxmisc.richtext.demo.TooltipDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task HyperlinkAreaDemo(type: JavaExec, dependsOn: classes,
description: "An area with hyperlinks that open to their corresponding link") {
main = 'org.fxmisc.richtext.demo.hyperlink.HyperlinkDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task LineIndicatorDemo(type: JavaExec, dependsOn: classes,
description: "Line numbers appear to left of each paragraph and a triangle appears on the same paragraph as the caret") {
main = 'org.fxmisc.richtext.demo.lineindicator.LineIndicatorDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task CloneDemo(type: JavaExec, dependsOn: classes,
description: "Two areas that can modify and show the same underlying document") {
main = 'org.fxmisc.richtext.demo.CloneDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task FontSizeSwitcherDemo(type: JavaExec, dependsOn: classes,
description: "Change the font size of the entire area.") {
main = 'org.fxmisc.richtext.demo.FontSizeSwitcherDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task MultiCaretAndSelectionNameDemo(type: JavaExec, dependsOn: classes,
description: "Add and display multiple carets and selections with different style classes in the same area") {
main = 'org.fxmisc.richtext.demo.MultiCaretAndSelectionDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task OverrideBehaviorDemo(type: JavaExec, dependsOn: classes,
description: "Overrides the area's default behavior and demonstrates some things of which to be aware") {
main = 'org.fxmisc.richtext.demo.OverrideBehaviorDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task ShowLineDemo(type: JavaExec, dependsOn: classes,
description: "Force a specific part of the underlying document to be rendered to the screen.") {
main = 'org.fxmisc.richtext.demo.ShowLineDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}
task SpellCheckingDemo(type: JavaExec, dependsOn: classes,
description: "Shows how to add a red squiggle underneath misspelled words") {
main = 'org.fxmisc.richtext.demo.SpellCheckingDemo'
classpath = files(sourceSets.main.output, configurations.runtime)
}