-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.latte
More file actions
88 lines (73 loc) · 2.73 KB
/
Copy pathproject.latte
File metadata and controls
88 lines (73 loc) · 2.73 KB
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
project(group: "org.lattejava", name: "format", version: "0.1.0", licenses: ["MIT"]) {
workflow {
standard()
}
publishWorkflow {
latte()
}
dependencies {
group(name: "compile") {
// JavaParser is dual-licensed under LGPL-3.0 OR Apache-2.0; Latte uses it under
// the Apache-2.0 option, which is compatible with this project's MIT license.
dependency(id: "com.github.javaparser:javaparser-core:3.28.2")
}
group(name: "test-compile", export: false) {
dependency(id: "org.testng:testng:7.10.2")
}
}
publications {
standard()
}
}
// Plugins
dependency = loadPlugin(id: "org.lattejava.plugin:dependency:0.4.0")
file = loadPlugin(id: "org.lattejava.plugin:file:0.4.2")
idea = loadPlugin(id: "org.lattejava.plugin:idea:0.4.1")
java = loadPlugin(id: "org.lattejava.plugin:java:0.4.4")
javaTestNG = loadPlugin(id: "org.lattejava.plugin:java-testng:0.4.0")
release = loadPlugin(id: "org.lattejava.plugin:release-git:0.4.0")
// Plugin settings
java.settings.javaVersion = "25"
javaTestNG.settings.javaVersion = "25"
target(name: "clean", description: "Cleans the project") {
java.clean()
}
target(name: "build", description: "Compiles and JARs the project") {
file.execute("git config core.hooksPath .githooks")
java.compile()
java.jar()
}
target(name: "test", description: "Runs the project's tests", dependsOn: ["build"]) {
javaTestNG.test()
}
target(name: "int", description: "Releases a local integration build of the project", dependsOn: ["test"]) {
dependency.integrate()
}
target(name: "release", description: "Releases a full version of the project", dependsOn: ["clean", "test"]) {
release.release()
}
target(name: "idea", description: "Updates the IntelliJ IDEA module file") {
idea.iml()
}
target(name: "format", description: "Formats this project's Java source using its own IntelliJ code style", dependsOn: ["build"]) {
java.run(
main: "org.lattejava.format.Main",
additionalClasspath: ["build/classes/main"],
arguments: "src",
dependencies: [[group: "compile", transitive: true, fetchSource: false, transitiveGroups: ["compile", "runtime"]]]
)
}
target(name: "bundle", description: "Builds a runnable bundle into `build/bundle`", dependsOn: ["build"]) {
file.copy(to: "build/bundle/lib") {
fileSet(dir: "build/jars", includePatterns: [/format-${project.version}.jar/])
}
file.copy(to: "build/bundle") {
fileSet(dir: "src/main/scripts", includePatterns: [/format.sh/])
}
dependency.copy(to: "build/bundle/lib") {
dependencies(group: "compile", transitive: true, fetchSource: false, transitiveGroups: ["compile", "runtime"])
}
}
target(name: "print-dependency-tree", description: "Prints the dependency tree") {
dependency.printFull()
}