forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
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 quarkusio#24034 from glefloch/feat/gradle-extensio…
…n-capability Add ability to set extension capability from gradle plugin
- Loading branch information
Showing
7 changed files
with
130 additions
and
19 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
19 changes: 19 additions & 0 deletions
19
...e/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/dsl/Capabilities.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,19 @@ | ||
package io.quarkus.extension.gradle.dsl; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Capabilities { | ||
|
||
private List<Capability> capabilities = new ArrayList<>(0); | ||
|
||
public Capability capability(String name) { | ||
Capability capability = new Capability(name); | ||
capabilities.add(capability); | ||
return capability; | ||
} | ||
|
||
public List<Capability> getCapabilities() { | ||
return capabilities; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...dle/gradle-extension-plugin/src/main/java/io/quarkus/extension/gradle/dsl/Capability.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,39 @@ | ||
package io.quarkus.extension.gradle.dsl; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Capability { | ||
|
||
private String name; | ||
|
||
private List<String> onlyIf = new ArrayList<>(0); | ||
|
||
private List<String> onlyIfNot = new ArrayList<>(0); | ||
|
||
public Capability(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Capability onlyIf(List<String> conditions) { | ||
onlyIf.addAll(conditions); | ||
return this; | ||
} | ||
|
||
public List<String> getOnlyIf() { | ||
return onlyIf; | ||
} | ||
|
||
public Capability onlyIfNot(List<String> conditions) { | ||
onlyIfNot.addAll(conditions); | ||
return this; | ||
} | ||
|
||
public List<String> getOnlyIfNot() { | ||
return onlyIfNot; | ||
} | ||
} |
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