-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMaven.hx
127 lines (121 loc) · 4.12 KB
/
Maven.hx
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
/*
* SPDX-FileCopyrightText: © Sebastian Thomschke and contributors
* SPDX-FileContributor: Sebastian Thomschke
* SPDX-License-Identifier: MIT
* SPDX-ArtifactOfProjectHomePage: https://github.com/sebthom/more-clink-completions
*/
package more_clink_completions.completions;
import clink.api.LineState;
import clink.api.ArgMatcher;
import clink.api.Clink;
import clink.util.Suggest;
class Maven {
public static function register() {
Clink.argMatcher("mvn").setDelayedInitializer(registerNow);
}
static final MAVEN_GOALS = [
"pre-clean",
"clean",
"post-clean",
//
"install",
"validate",
"initialize",
"generate-sources",
"process-sources",
"generate-resources",
"process-resources",
"compile",
"process-classes",
"generate-test-sources",
"process-test-sources",
"generate-test-resources",
"process-test-resources",
"test-compile",
"process-test-classes",
"test",
"prepare-package",
"package",
"pre-integration-test",
"integration-test",
"post-integration-test",
"verify",
"install",
"deploy",
//
"pre-site",
"site",
"post-site",
"site-deploy",
//
"archetype:generate",
"dependency:tree",
"exec:exec",
"help:active-profiles",
"help:all-profiles",
"help:describe",
"help:effective-pom",
"help:effective-settings",
"help:evaluate",
"help:expressions",
"help:help",
"help:system",
"plugin:help",
"versions:display-dependency-updates",
"versions:display-plugin-updates"
];
static function colorizeMavenGoals(argIndex:Int, word:String, wordIndex:Int, lineState:LineState, classifications:WordClassifications) {
if (MAVEN_GOALS.contains(word)) {
classifications.classifyWord(wordIndex, ARGUMENT);
}
}
static function registerNow(parser:ArgMatcher, commandWord:String) {
parser //
.addFlags(["-am", "--also-make"])
.addFlags(["-amd", "--also-make-dependents"])
.addFlags(["-B", "--batch-mode"])
.addFlags(["-b", "--builder"], "")
.addFlags(["-C", "--strict-checksums"])
.addFlags(["-c", "--lax-checksums"])
.addFlags(["-D", "--define"], "")
.addFlags(["-e", "--errors"])
.addFlags(["-emp", "--encrypt-master-password"], "")
.addFlags(["-ep", "--encrypt-password"], "")
.addFlags(["-f", "--file"], Suggest.filesEndingWith(".xml"))
.addFlags(["-fae", "--fail-at-end"])
.addFlags(["-ff", "--fail-fast"])
.addFlags(["-fn", "--fail-never"])
.addFlags(["-gs", "--global-settings"], Suggest.filesEndingWith(".xml"))
.addFlags(["-gt", "--global-toolchains"], Suggest.filesEndingWith(".xml"))
.addFlags(["-h", "--help"])
.addFlags(["-l", "--log-file"], Suggest.files)
.addFlags(["-llr", "--legacy-local-repository"])
.addFlags(["-N", "--non-recursive"])
.addFlags(["-npr", "--no-plugin-registry"])
.addFlags(["-npu", "--no-plugin-updates"])
.addFlags(["-nsu", "--no-snapshot-updates"])
.addFlags(["-ntp", "--no-transfer-progress"])
.addFlags(["-o", "--offline"])
.addFlags(["-P", "--active-profiles"], "")
.addFlags(["-pl", "--projects"], "")
.addFlags(["-rf", "--resume-from"], "")
.addFlags(["-q", "--quiet"])
.addFlags(["-s", "--settings"], Suggest.filesEndingWith(".xml"))
.addFlags(["-t", "--toolchains"], Suggest.filesEndingWith(".xml"))
.addFlags(["-T", "--threads"], [Suggest.range(1, 9)])
.addFlags(["-U", "--update-snapshots"])
.addFlags(["-up", "--update-plugins"])
.addFlags(["-v", "--version"])
.addFlags(["-V", "--show-version"])
.addFlags(["-X", "--debug"])
//
.addFlags(["-DskipITs"])
.addFlags(["-DskipTests"])
.addFlags(["-Dmaven.test.skip=true"])
//
.addArg(MAVEN_GOALS) //
.setClassifier(colorizeMavenGoals)
.loop(1)
.noFiles();
}
}