Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring of the MavenProjectBuildFile that is moved to the devtools
common so that it can be used by the CLI. The implementation is backed by the artifact descriptor.
- Loading branch information
1 parent
ab00a99
commit ca0ff4c
Showing
25 changed files
with
552 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
devtools/cli/src/main/java/io/quarkus/cli/QuarkusCliUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package io.quarkus.cli; | ||
|
||
import java.nio.file.Path; | ||
|
||
import io.quarkus.cli.core.QuarkusCliVersion; | ||
import io.quarkus.devtools.messagewriter.MessageWriter; | ||
import io.quarkus.devtools.project.BuildTool; | ||
import io.quarkus.devtools.project.QuarkusProject; | ||
import io.quarkus.devtools.project.QuarkusProjectHelper; | ||
import io.quarkus.devtools.project.buildfile.MavenProjectBuildFile; | ||
|
||
public class QuarkusCliUtils { | ||
|
||
static QuarkusProject getQuarkusProject(Path projectRoot) { | ||
return getQuarkusProject(QuarkusProject.resolveExistingProjectBuildTool(projectRoot), projectRoot); | ||
} | ||
|
||
static QuarkusProject getQuarkusProject(BuildTool buildTool, Path projectRoot) { | ||
if (BuildTool.MAVEN.equals(buildTool)) { | ||
return MavenProjectBuildFile.getProject(projectRoot.toAbsolutePath(), MessageWriter.info(), | ||
() -> QuarkusCliVersion.version()); | ||
} | ||
if (BuildTool.GRADLE.equals(buildTool)) { | ||
return getNonMavenProject(projectRoot, BuildTool.GRADLE); | ||
} | ||
if (BuildTool.GRADLE_KOTLIN_DSL.equals(buildTool)) { | ||
return getNonMavenProject(projectRoot, BuildTool.GRADLE_KOTLIN_DSL); | ||
} | ||
throw new IllegalArgumentException("Unexpected build tool " + buildTool); | ||
} | ||
|
||
private static QuarkusProject getNonMavenProject(Path projectRoot, BuildTool buildTool) { | ||
return QuarkusProjectHelper.getProject(projectRoot, buildTool, | ||
QuarkusCliVersion.version()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
218 changes: 0 additions & 218 deletions
218
devtools/maven/src/main/java/io/quarkus/maven/MavenProjectBuildFile.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.