Skip to content

ChallengeGroup Objects

Paul Ambrose edited this page Jul 27, 2020 · 19 revisions

ChallengeGroup Objects

A ChallengeGroup object is named and created with a group(name) {} call in a LanguageGroup object.

The name appears as title for a group of challenges for a particular language.

A ChallengeGroup object declares Challenge objects.

ChallengeGroups Properties

Name Default Description
packageName "" Directory for the challenge sources
description "" Group description (supports markdown)
includeFiles Include multiple java challenges, that match a filename pattern
includeFilesWithType Include multiple python or kotlin challenges, that match a filename pattern

Description

Group description properties can include markdown.

includeFiles and includeFilesWithType

  • The includeFiles and includeFilesWithType properties make it easy to include multiple challenges using a filename patern. Use includeFiles with Java challenges and includeFilesWithType with Python and Kotlin challenges.

To include all java challenges in a package that start with array*, use:

group("Group 1") {
  packageName = "group1"
  includeFiles = "array*.java"
}

To include all python challenges in a package that start with slice*, use:

group("Group 1") {
  packageName = "group1"
  // All challenges must have the same return type, which in this case is StringType
  includeFilesWithType = "slice*.py" returns StringType   
}
  • Valid return type values are: BooleanType, IntType, StringType, BooleanArrayType, IntArrayType, StringArrayType, BooleanListType, IntListType, StringListType.

  • The includeFiles or includeFilesWithType properties require a Github personal access token when used with a GitHubRepo object.

Clone this wiki locally