forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of the new extension selection algorithm as proposed in …
- Loading branch information
1 parent
e76ae7c
commit 5b3803a
Showing
9 changed files
with
433 additions
and
57 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
20 changes: 20 additions & 0 deletions
20
devtools/common/src/main/java/io/quarkus/cli/commands/AddExtensionResult.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,20 @@ | ||
package io.quarkus.cli.commands; | ||
|
||
public class AddExtensionResult { | ||
|
||
private final boolean updated; | ||
private final boolean succeeded; | ||
|
||
public AddExtensionResult(boolean updated, boolean succeeded) { | ||
this.updated = updated; | ||
this.succeeded = succeeded; | ||
} | ||
|
||
public boolean isUpdated() { | ||
return updated; | ||
} | ||
|
||
public boolean succeeded() { | ||
return succeeded; | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
devtools/common/src/main/java/io/quarkus/cli/commands/SelectionResult.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,34 @@ | ||
package io.quarkus.cli.commands; | ||
|
||
import java.util.Set; | ||
|
||
import io.quarkus.dependencies.Extension; | ||
|
||
public class SelectionResult { | ||
|
||
private final Set<Extension> extensions; | ||
private final boolean matches; | ||
|
||
public SelectionResult(Set<Extension> extensions, boolean matches) { | ||
this.extensions = extensions; | ||
this.matches = matches; | ||
} | ||
|
||
public Set<Extension> getExtensions() { | ||
return extensions; | ||
} | ||
|
||
public boolean matches() { | ||
return matches; | ||
} | ||
|
||
public Extension getMatch() { | ||
if (matches) { | ||
if (extensions.isEmpty() || extensions.size() > 1) { | ||
throw new IllegalStateException("Invalid selection result"); | ||
} | ||
return extensions.iterator().next(); | ||
} | ||
return null; | ||
} | ||
} |
Oops, something went wrong.