@@ -235,6 +235,17 @@ fun Task.evaluate(expression: String) =
235235fun Task.getRawMaybe (propertyName : String ) =
236236 taskGroup.subs.getRawMaybe(propertyName, entry = entry)
237237
238+ /* *
239+ * Returns true if the given property exists in the [Subs] object's [SubProperties] instance
240+ * for the given context.
241+ *
242+ * This function is run in a task context, using the [entry] and [release] values for this task.
243+ *
244+ * @param propertyName The property to find.
245+ */
246+ fun Task.propertyExists (propertyName : String ) =
247+ taskGroup.subs.propertyExists(propertyName, entry = entry)
248+
238249/* *
239250 * Searches for the given property in the [Subs] object's [SubProperties] instance,
240251 * and returns the raw string.
@@ -500,6 +511,20 @@ open class Subs(val project: Project) : ItemGroupContext() {
500511 fun getRawMaybe (propertyName : String , entry : String = "") =
501512 properties.match(propertyName, entry = entry, release = release.get())
502513
514+ /* *
515+ * Returns true if the given property exists in the [Subs] object's [SubProperties] instance
516+ * for the given context.
517+ *
518+ * This function is run outside of a task context, using only [release] for lookup
519+ * unless an entry is manually specified.
520+ *
521+ * @sample myaa.subkt.tasks.samples.subsPropertyExistsSample
522+ * @param propertyName The property to find.
523+ * @param entry Optional manually specified entry for property lookup.
524+ */
525+ fun propertyExists (propertyName : String , entry : String = "") =
526+ getRawMaybe(propertyName, entry = entry) != null
527+
503528 /* *
504529 * Searches for the given property in the [Subs] object's [SubProperties] instance,
505530 * and returns the raw string.
0 commit comments