{"id":27915056,"url":"https://github.com/kyoripowered/mammoth","last_synced_at":"2025-05-06T15:33:49.990Z","repository":{"id":42500788,"uuid":"338757169","full_name":"KyoriPowered/mammoth","owner":"KyoriPowered","description":"Helpful API for writing Gradle plugins","archived":false,"fork":false,"pushed_at":"2025-04-17T22:57:30.000Z","size":515,"stargazers_count":4,"open_issues_count":6,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-18T12:32:00.142Z","etag":null,"topics":["gradle","gradle-plugin-development"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KyoriPowered.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-14T08:05:53.000Z","updated_at":"2025-04-05T19:55:05.000Z","dependencies_parsed_at":"2023-10-12T14:50:25.200Z","dependency_job_id":"b1aceb9b-2092-41bd-bafe-24a71664c223","html_url":"https://github.com/KyoriPowered/mammoth","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyoriPowered%2Fmammoth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyoriPowered%2Fmammoth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyoriPowered%2Fmammoth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyoriPowered%2Fmammoth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KyoriPowered","download_url":"https://codeload.github.com/KyoriPowered/mammoth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252713092,"owners_count":21792426,"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","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":["gradle","gradle-plugin-development"],"created_at":"2025-05-06T15:33:49.171Z","updated_at":"2025-05-06T15:33:49.977Z","avatar_url":"https://github.com/KyoriPowered.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mammoth\n\n![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/KyoriPowered/mammoth/build.yml?branch=main) [![MIT License](https://img.shields.io/badge/license-MIT-blue)](license.txt)\n\n## Plugin Utilities\n\nThe main component of `mammoth` is utility functions for developing Gradle plugins in java, plus `ProjectPlugin`, an interface for plugins for `Project` instances.\n\n## Functional Testing\n\nMammoth provides test fixtures to enable functional testing of Gradle plugins. This architecture is designed for Java tests using JUnit 5, with the buildscripts for tested builds stored as classpath resources. This stands in contrast to Groovy functional tests, where the buildscript is written as a string directly in the test class.\n\n### Annotations\n\nAnnotation                  | Purpose\n--------------------------- | ------------------------------------------\n`@GradleFunctionalTest` | Mark a test method as a functional test\n`@GradleParameters`      | Pass parameters to every Gradle invocation\n`@TestVariant`            | Declare a single variant of a tent, with a specific gradle version and extra parameters. Repeatable\n`@TestVariantResource`  | Declare a classpath resource to read additional variants from. Each line in the file is one variant, in the format `\u003cversion\u003e[:\u003cargs...\u003e]`\n\n### Usage\n\n\u003cdetails\u003e\n\u003csummary\u003eExample\u003c/summary\u003e\n\nAssuming there are files at `src/test/resources/com/example/myplugin/simpleBuild/in/build.gradle` and `src/test/resources/com/example/myplugin/simpleBuild/in/settings.gradle`, the following sets up a simple test that will run on both Gradle 6.9 and 7.1:\n\n**com/example/myplugin/MyPluginTest.java**:\n\n```java\n/**\n * A \u003cem\u003emeta-annotation\u003c/em\u003e containing our test configuration.\n */\n@GradleFunctionalTest\n@GradleParameters({\"--warning-mode\", \"all\", \"--stacktrace\"}) // parameters for all variants\n@TestVariant(gradleVersion = \"6.9\")\n@TestVariant(gradleVersion = \"7.1\")\n@Documented\n@Retention(RetentionPolicy.RUNTIME)\n@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})\npublic @interface MyPluginTest {\n}\n```\n\n**com/example/myplugin/MyPluginFunctionalTest.java**\n```java\n\nclass MyPluginFunctionalTest {\n\n  @MyPluginTest\n  void simpleBuild(final TestContext ctx) {\n    ctx.copyInput(\"build.gradle\");\n    ctx.copyInput(\"settings.gradle\");\n\n    final BuildResult result = ctx.build(\"build\"); // or anoher\n\n    assertEquals(TaskOutcome.SUCCESS, result.task(\":build\").getOutcome());\n    \n    // Use any other methods on TestContext to help validate output.\n  }\n}\n```\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyoripowered%2Fmammoth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyoripowered%2Fmammoth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyoripowered%2Fmammoth/lists"}