Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16629 from aloubyansky/cli-bom-import
Refactoring of the MavenProjectBuildFile to make it usable by the CLI
- Loading branch information
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.