forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8f1436
commit f11c573
Showing
18 changed files
with
808 additions
and
203 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
62 changes: 62 additions & 0 deletions
62
devtools/maven/src/main/java/io/quarkus/maven/ExtensionDevModeJvmArgFilter.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,62 @@ | ||
package io.quarkus.maven; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import io.quarkus.maven.dependency.ArtifactCoordsPattern; | ||
import io.quarkus.maven.dependency.ArtifactKey; | ||
|
||
public class ExtensionDevModeJvmArgFilter { | ||
|
||
private boolean disableAll; | ||
|
||
private List<String> disableFor = List.of(); | ||
private List<ArtifactCoordsPattern> disableForPatterns; | ||
|
||
public boolean isDisableAll() { | ||
return disableAll; | ||
} | ||
|
||
public void setDisableAll(boolean disableAll) { | ||
this.disableAll = disableAll; | ||
resetPatterns(); | ||
} | ||
|
||
public List<String> getDisableFor() { | ||
return disableFor; | ||
} | ||
|
||
public void setDisableFor(List<String> disableFor) { | ||
this.disableFor = disableFor; | ||
resetPatterns(); | ||
} | ||
|
||
private void resetPatterns() { | ||
disableForPatterns = null; | ||
} | ||
|
||
List<ArtifactCoordsPattern> getDisableForPatterns() { | ||
if (disableFor.isEmpty()) { | ||
return List.of(); | ||
} | ||
if (disableForPatterns == null) { | ||
var result = new ArrayList<ArtifactCoordsPattern>(disableFor.size()); | ||
for (var s : disableFor) { | ||
result.add(ArtifactCoordsPattern.of(s)); | ||
} | ||
disableForPatterns = result; | ||
} | ||
return disableForPatterns; | ||
} | ||
|
||
boolean isDisabled(ArtifactKey extensionKey) { | ||
for (var pattern : getDisableForPatterns()) { | ||
if (pattern.matches(extensionKey.getGroupId(), extensionKey.getArtifactId(), extensionKey.getClassifier(), "jar", | ||
null)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
} |
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
Oops, something went wrong.