-
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.
OciImageDefinition.capabilities SetProperty<String> -> <Capability>
- Loading branch information
Showing
3 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/main/kotlin/io/github/sgtsilvio/gradle/oci/dsl/Capability.kt
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,18 @@ | ||
package io.github.sgtsilvio.gradle.oci.dsl | ||
|
||
/** | ||
* @author Silvio Giebl | ||
*/ | ||
data class Capability(val group: String, val name: String, val version: String) { | ||
init { | ||
require(group.isNotEmpty()) { "capability group must not be empty" } | ||
require(name.isNotEmpty()) { "capability name must not be empty" } | ||
require(version.isNotEmpty()) { "capability version must not be empty" } | ||
} | ||
} | ||
|
||
internal fun Capability.toMapNotation() = mapOf("group" to group, "name" to name, "version" to version) | ||
|
||
interface CapabilityFactories { | ||
fun capability(group: String, name: String, version: String) = Capability(group, name, 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
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