{"id":19184649,"url":"https://github.com/gatoreducator/gatorgradle","last_synced_at":"2025-10-06T00:50:23.206Z","repository":{"id":46415585,"uuid":"122250349","full_name":"GatorEducator/gatorgradle","owner":"GatorEducator","description":":electric_plug: Gradle Plugin to Enable Running GatorGrader as a Gradle Task","archived":false,"fork":false,"pushed_at":"2022-07-25T23:09:02.000Z","size":1670,"stargazers_count":7,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T00:04:16.488Z","etag":null,"topics":["gatorgrader","gradle","gradle-plugin","java","plugin"],"latest_commit_sha":null,"homepage":"https://gatoreducator.github.io/gatorgradle/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GatorEducator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-20T20:12:59.000Z","updated_at":"2022-01-19T17:06:01.000Z","dependencies_parsed_at":"2022-09-26T18:00:34.915Z","dependency_job_id":null,"html_url":"https://github.com/GatorEducator/gatorgradle","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/GatorEducator/gatorgradle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GatorEducator%2Fgatorgradle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GatorEducator%2Fgatorgradle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GatorEducator%2Fgatorgradle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GatorEducator%2Fgatorgradle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GatorEducator","download_url":"https://codeload.github.com/GatorEducator/gatorgradle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GatorEducator%2Fgatorgradle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278542673,"owners_count":26004061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gatorgrader","gradle","gradle-plugin","java","plugin"],"created_at":"2024-11-09T11:07:44.871Z","updated_at":"2025-10-06T00:50:23.169Z","avatar_url":"https://github.com/GatorEducator.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GatorGradle: GatorGrader Gradle Integration\n\nGatorGradle integrates [GatorGrader](https://github.com/GatorEducator/gatorgrader)\ninto a Gradle project.\n\n[![build](https://github.com/GatorEducator/gatorgradle/workflows/build/badge.svg?branch=master)](https://github.com/GatorEducator/gatorgradle/actions?query=workflow%3A%22build%22+branch%3Amaster)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b9a2cb353e5042d0a28a1f0750385f48)](https://www.codacy.com/gh/GatorEducator/gatorgradle/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=GatorEducator/gatorgradle\u0026utm_campaign=Badge_Grade)\n[![Known Vulnerabilities](https://snyk.io/test/github/GatorEducator/gatorgradle/badge.svg?targetFile=build.gradle)](https://snyk.io/test/github/GatorEducator/gatorgradle?targetFile=build.gradle)\n[![Javadocs](https://gatoreducator.github.io/gatorgradle/docs/docs-status-badge.svg)](https://gatoreducator.github.io/gatorgradle/docs)\n\n## Running Checks\n\nGrading checks can be performed as specified in a configuration file. To run\nthe GatorGrader checks, use the `grade` task, like so:\n\n```bash\ngradle grade\n```\n\nTo run the GatorGrader checks and collect grade report to a configured endpoint,\nfirst store the endpoint and API key in environment variables with `GATOR_ENDPOINT`\nand `GATOR_API_KEY`, then use the `report` task, like so:\n\n```bash\ngradle --continue grade report\n```\n\n## Installing Dependencies\n\nGatorGradle requires that [Git](https://git-scm.com/), a version of\n[Python](https://www.python.org/) greater than 3.6, and\n[Pipenv](https://pipenv.readthedocs.io/en/latest) are installed -- it will\nautomatically bootstrap a valid GatorGrader installation from there.\nAdditionally, [Gradle 5.0+](https://gradle.org/) is required to actually use\nGatorGradle (GatorGradle is compatible with 4.0+ as well, but Gradle 7.3+ is\nrecommended). A complete example configuration of Gradle and GatorGradle is\navailable in the [Java Sample Assignment](https://github.com/GatorEducator/java-assigment-starter)\nrepository.\n\nNOTE: GatorGradle will **ONLY** automatically install GatorGrader.\n\n## Configuring Checks\n\nThe `grade` task reads the configuration provided in `config/gatorgrader.yml`\n(to possibly be renamed to `config/gatorgradle.yml` at some point in the\nfuture) by default, and then performs the specified commands. Execution of\nchecks is parallelized, so execution order is not guaranteed. Generally, commands\nwhich run faster are finished earlier, however. An example of a configuration file\nis given below.\n\n```yaml\n# comments are possible by using `#`\n---\n# Specify the name of this assignment, displayed in the output\nname: gatorgrader-samplelab\n# Should we break the build if any checks fail?\nbreak: true\n# Should we break the build as soon as a single check fails?\nfastfail: false\n# Specify an indentation level in spaces to be used in this file\nindent: 4\n# Command to get user info/id\n# default is 'git config --global user.email'\nidcommand: echo $GITHUB_REPOSITORY_OWNER\n# Specify a reference to checkout to in GatorGrader (must be before v1.1.0)\nversion: v1.0.0\n# Specify 'executables' that can be run as checks\nexecutables: cat, markdownlint-cli2\n# Specify a script or executable to run on startup\nstartup: ./config/startup.sh\n# Specify the path to the reflection file\nreflection: writing/reflection.md\n---\n# Form paths with these tree-like structures: they will\n# be used to determine where and to what file a given check is tested against\nsrc/main:\n    java:\n        samplelab/SampleLabMain.java:\n            # Specify checks by simply writing arguments to GatorGrader\n            ConfirmFileExists\n            CountSingleLineComments --count 1 --language Java\n            CountMultipleLineComments --count 3 --language Java\n            MatchFileFragment --fragment \"println(\" --count 2\n            --description \"Create exactly two new objects\" MatchFileRegex --regex \"new\\s+\\S+?\\(.*?\\)\" --count 2 --exact\n        samplelab/DataClass.java:\n            --description \"Create DataClass.java\" ConfirmFileExists\n            --description \"Add a single-line comment\" CountSingleLineComments --count 1 --language Java\n            --description \"Add a multi-line comment\" CountMultipleLineComments --count 1 --language Java\n            --description \"Add an int member variable\" MatchFileFragment --fragment \"int \" --count 1\n\nwriting:\n    # A pure check is simply a call-out to the OS to run\n    # whatever program you desire; the working directory\n    # is set by the context (in this case, 'writing/')\n    (pure) ../config/writing-check.sh reflection.md param2\n    reflection.md:\n        # for checks that are 'executables' the context\n        # is given after the executable: this check results\n        # in executing 'markdownlint-cli2 writing/reflection.md'\n        markdownlint-cli2\n        cat\n        --description \"Write two paragraphs in writing/reflection.md\" CountFileParagraphs --count 2\n        --description \"Write at least 6 words in each paragraph in writing/reflection.md\" CountParagraphWords --count 30\n\n# Any checks outside of the tree structure will not have\n# a file or directory based context; if a directory is needed\n# it will be the base project directory\nCountCommits --count 18\n```\n\n## Output Summary\n\nThe `grade` task outputs a summary of all commands run once it has finished.\nIt uses a similar structure to GatorGrader's own output, providing descriptions\nand diagnostics for grading criterion. An example output from running `gradle grade`\non the [Sample Lab](https://github.com/GatorEducator/gatorgrader-samplelab) is shown\nbelow. Color is also added for easier visibility on a terminal screen, with red `✘`s\nfor failed criterion and green `✔`s for passing ones. Diagnostics get a bold yellow\n`➔` along with colored text for added visibility. Finally, the large status box at\nthe end of the output is colored according to the overall success (100%)/failure\nof the grading.\n\n```text\n[...]\n\n✔  Create DataClass.java\n✘  Write two paragraphs in writing/reflection.md\n✘  The SampleLabMain.java in src/main/java/samplelab has at least 3 multiple-line Java comment(s)\n✔  [../config/writing-check.sh reflection.md param2] executes\n✔  The file writing/reflection.md passes cat\n✔  Add a single-line comment\n✔  The SampleLabMain.java in src/main/java/samplelab has at least 1 single-line Java comment(s)\n✔  Add an int member variable\n✘  Write at least 6 words in each paragraph in writing/reflection.md\n✔  Add a multi-line comment\n✔  The SampleLabMain.java in src/main/java/samplelab has at least 2 of the 'println(' fragment\n✔  The file writing/reflection.md passes markdownlint-cli2\n✔  The repository has at least 18 commit(s)\n✔  The file SampleLabMain.java exists in the src/main/java/samplelab directory\n✘  Create exactly two new objects\n\n\n-~-  FAILURES  -~-\n\n✘  Write two paragraphs in writing/reflection.md\n   ➔  Found 1 paragraph(s) in the reflection.md file\n✘  The SampleLabMain.java in src/main/java/samplelab has at least 3 multiple-line Java comment(s)\n   ➔  Found 2 comment(s) in the SampleLabMain.java or the output\n✘  Write at least 6 words in each paragraph in writing/reflection.md\n   ➔  Found 4 word(s) in the first paragraph of file reflection.md\n✘  Create exactly two new objects\n   ➔  Found 1 match(es) of the regular expression in output or SampleLabMain.java\n\n\n        ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n        ┃ Passed 11/15 (73%) of checks for gatorgrader-samplelab! ┃\n        ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n\n```\n\n### Including GatorGradle in your project\n\nIncluding GatorGradle in your project is simple. If no extra configuration is\nrequired, simply insert the following code block at the beginning of your\n`build.gradle` to use version `1.0.0`. Find out what version is current by\nvisiting the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/org.gatored.gatorgradle).\nOther configuration and installation information is also available there,\nincluding a different script that will always use the most recent version!\n\n```groovy\nplugins {\n  id \"org.gatored.gatorgradle\" version \"1.0.0\"\n}\n```\n\n### Contributing\n\nIf you'd like to contribute, the javadoc for all existing code is available:\n\n[![javadocs](https://gatoreducator.github.io/gatorgradle/docs/docs-status-badge.svg)](https://gatoreducator.github.io/gatorgradle/docs)\n\n#### Testing\n\nTo run the plugin on a local gradle project, first run `gradle install` inside\nyour cloned GatorGradle repository. Then, add the groovy code below to your\nlocal gradle project, replacing the `plugin` block.\n\n```groovy\nbuildscript{\n  repositories {\n    mavenLocal()\n    dependencies {\n      classpath 'org.gatored:gatorgradle:+'\n    }\n  }\n}\n\napply plugin: 'org.gatored.gatorgradle'\n\n```\n\n#### Publishing\n\nFirst, log into the Gradle Plugin Portal with `gradle login`; this will add your\npublishing key and secret in the following format to `~/.gradle/gradle.properties`:\n\n```text\n#Updated secret and key with server message: Generated key 'walle' for 'michionlion'\n#Tue, 20 Aug 2019 20:40:22 -0400\n\ngradle.publish.key=\u003ckey\u003e\ngradle.publish.secret=\u003csecret\u003e\n```\n\nYou'll need to request the key and secret from the maintainer if you are not\npublishing to your own account. Next, ensure that the project is entirely built\nand tested with `gradle clean build check`, and then execute `gradle publishPlugins`\nto publish the plugin to the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/org.gatored.gatorgradle).\nFinally, publish the Javadocs by running `gradle publishJavadocs`. Throughout this\nentire process, ensure you have no unstaged changes and the remote repository\nis completely identical to the one your are publishing from your local machine.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgatoreducator%2Fgatorgradle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgatoreducator%2Fgatorgradle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgatoreducator%2Fgatorgradle/lists"}