File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed
shared/src/main/kotlin/org/javacs/kt Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -130,10 +130,10 @@ private val mvnCommandFromPath: Path? by lazy {
130
130
findCommandOnPath(" mvn" )
131
131
}
132
132
133
- private fun mvnCommand (pom : Path ) : Path {
134
- return requireNotNull(mvnCommandFromPath ? : findProjectCommandWithName(" mvnw" , pom)?.also {
135
- LOG .info(" Using mvn wrapper (mvnw) in place of mvn command" )
136
- }) { " Unable to find the 'mvn' command or suitable wrapper" }
133
+ private fun mvnCommand (pom : Path ): Path {
134
+ return requireNotNull(mvnCommandFromPath ? : findProjectCommandWithName(" mvnw" , pom)?.also {
135
+ LOG .info(" Using mvn wrapper (mvnw) in place of mvn command" )
136
+ }) { " Unable to find the 'mvn' command or suitable wrapper" }
137
137
}
138
138
139
139
fun parseMavenArtifact (rawArtifact : String , version : String? = null): Artifact {
Original file line number Diff line number Diff line change @@ -34,18 +34,16 @@ private fun findExecutableOnPath(fileName: String): Path? {
34
34
return null
35
35
}
36
36
37
- fun findProjectCommandWithName (name : String , projectFile : Path ) : Path ? {
38
- if (isOSWindows()) {
39
- return findFileRelativeToProjectFile(" $name .cmd" , projectFile)
40
- } else {
41
- return findFileRelativeToProjectFile(name, projectFile)
42
- }
43
- }
37
+ fun findProjectCommandWithName (name : String , projectFile : Path ): Path ? =
38
+ if (isOSWindows()) {
39
+ findFileRelativeToProjectFile(" $name .cmd" , projectFile)
40
+ } else {
41
+ findFileRelativeToProjectFile(name, projectFile)
42
+ }
44
43
45
- private fun findFileRelativeToProjectFile (name : String , projectFile : Path ) : Path ? {
46
- return projectFile.resolveSibling(name).toFile().takeIf { file ->
47
- file.isFile && file.canExecute()
48
- }?.let { file ->
49
- Paths .get(file.absolutePath)
50
- }
51
- }
44
+ private fun findFileRelativeToProjectFile (name : String , projectFile : Path ): Path ? =
45
+ projectFile.resolveSibling(name).toFile().takeIf { file ->
46
+ file.isFile && file.canExecute()
47
+ }?.let { file ->
48
+ Paths .get(file.absolutePath)
49
+ }
You can’t perform that action at this time.
0 commit comments