{"id":29086452,"url":"https://github.com/surpsg/offlins-gradle-plugin","last_synced_at":"2025-07-16T01:11:53.858Z","repository":{"id":38301190,"uuid":"488744178","full_name":"SurpSG/offlins-gradle-plugin","owner":"SurpSG","description":"JaCoCo Gradle plugin ","archived":false,"fork":false,"pushed_at":"2025-06-24T14:12:36.000Z","size":429,"stargazers_count":11,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T00:07:48.845Z","etag":null,"topics":["coverage","gradle","gradle-plugin","jacoco","jacoco-offline-instrumentation","jacoco-plugin","jacoco-reports","powermock"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/SurpSG.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2022-05-04T21:10:33.000Z","updated_at":"2025-02-17T20:14:25.000Z","dependencies_parsed_at":"2024-04-16T22:41:25.374Z","dependency_job_id":"1dcb01d8-c9a1-4e5c-a256-853b81076c27","html_url":"https://github.com/SurpSG/offlins-gradle-plugin","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/SurpSG/offlins-gradle-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SurpSG%2Fofflins-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SurpSG%2Fofflins-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SurpSG%2Fofflins-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SurpSG%2Fofflins-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SurpSG","download_url":"https://codeload.github.com/SurpSG/offlins-gradle-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SurpSG%2Fofflins-gradle-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265472916,"owners_count":23772002,"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":["coverage","gradle","gradle-plugin","jacoco","jacoco-offline-instrumentation","jacoco-plugin","jacoco-reports","powermock"],"created_at":"2025-06-28T00:07:48.990Z","updated_at":"2025-07-16T01:11:53.807Z","avatar_url":"https://github.com/SurpSG.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# offlins-gradle-plugin\n\n[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/io.github.surpsg/offlins-gradle-plugin/maven-metadata.xml.svg?label=Gradle%20Plugin%20Portal)](https://plugins.gradle.org/plugin/io.github.surpsg.offlins)\n[![Main branch](https://github.com/SurpSG/offlins-gradle-plugin/actions/workflows/main-branch.yml/badge.svg)](https://github.com/SurpSG/offlins-gradle-plugin/actions/workflows/main-branch.yml)\n[![codecov](https://codecov.io/gh/SurpSG/offlins-gradle-plugin/branch/main/graph/badge.svg?token=08EKXE7agx)](https://codecov.io/gh/SurpSG/offlins-gradle-plugin)\n[![GitHub issues](https://img.shields.io/github/issues/SurpSG/offlins-gradle-plugin)](https://github.com/SurpSG/offlins-gradle-plugin/issues)\n[![GitHub stars](https://img.shields.io/github/stars/SurpSG/offlins-gradle-plugin?style=flat-square)](https://github.com/SurpSG/offlins-gradle-plugin/stargazers)\n\n`Offlins` is similar to standard Gradle [JaCoCo plugin](https://docs.gradle.org/current/userguide/jacoco_plugin.html)\nbut uses [JaCoCo](https://www.eclemma.org/jacoco/) tool\nin [offline instrumentation](https://www.jacoco.org/jacoco/trunk/doc/offline.html) mode.\nThis plugin is useful if [PowerMock](https://github.com/powermock/powermock) is used in tests.\n\n## Compatibility\n\nCompatibility table:\n\n| Offlins plugin | Gradle              |\n|----------------|---------------------|\n| **0.6.0**      | **8.11** - **8.12** |\n| **0.5.0**      | **8.11** - **8.12** |\n| **0.4.0**      | **6.1** - **8.7**   |\n| **0.3.0**      | **6.1** - **8.7**   |\n| **0.2.1.+**    | **5.1** - **7.6**   |\n\n## Installation\n\nThe plugin is published to [Gradle plugins](https://plugins.gradle.org/plugin/io.github.surpsg.offlins).\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\u003cb\u003eGroovy\u003c/b\u003e\u003c/summary\u003e\n\n```groovy\nplugins {\n    id \"io.github.surpsg.offlins\" version \"0.6.0\"\n}\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eKotlin\u003c/b\u003e\u003c/summary\u003e\n\n```kotlin\nplugins {\n    id(\"io.github.surpsg.offlins\") version \"0.6.0\"\n}\n```\n\n\u003c/details\u003e\n\n## Configuration\n\nAll properties are **optional** but have the following defaults:\n\n* JaCoCo version `0.8.12`\n* *HTML* report is **disabled** with dafault path `build/reports/jacoco/html`\n* *XML* report is **disabled** with dafault path `build/reports/jacoco/report.xml`\n* *CSV* report is **disabled** with dafault path `build/reports/jacoco/report.csv`\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e\u003cb\u003eKotlin\u003c/b\u003e\u003c/summary\u003e\n\n```kotlin\nconfigure\u003cio.github.surpsg.offlins.OfflinsExtension\u003e {\n    jacocoVersion = \"0.8.7\" // Optional. By default `0.8.12`\n\n    reports {\n        html.enabled.set(true) // Optional. By default `true`\n        html.location.set(project.file(\"build/custom/html\")) // Optional. By default `build/reports/jacoco/html`\n\n        xml.enabled.set(true) // Optional. By default `false`\n        xml.location.set(project.file(\"build/custom/xmlCoverage.xml\")) // Optional. By default `build/reports/jacoco/coverageReport.xml`\n\n        csv.enabled.set(true) // Optional. By default `false`\n        csv.location.set(project.file(\"build/custom/csvCoverage.csv\")) // Optional. By default `build/reports/jacoco/coverageReport.csv`    \n\n        // Optional. By default `emptyList()`\n        excludeClasses.set(\n          listOf(\n            \"**/path/to/*/ExcludedClass*\", \n            \"**/ExcludedClass2.class\"\n          )\n        ) \n    }\n}\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eGroovy\u003c/b\u003e\u003c/summary\u003e\n\n\n```groovy\nofflinsCoverage {\n    jacocoVersion = '0.8.7' // Optional. By default `0.8.12`\n\n    reports {\n        html.enabled.set true // Optional. By default `true`\n        html.location.set project.file('build/custom/html') // Optional. By default `build/reports/jacoco/html`\n\n        xml.enabled.set true // Optional. By default `false`\n        xml.location.set project.file('build/custom/xmlCoverage.xml')\n        // Optional. By default `build/reports/jacoco/coverageReport.xml`\n\n        csv.enabled.set true // Optional. By default `false`\n        csv.location.set project.file('build/custom/csvCoverage.csv')\n        // Optional. By default `build/reports/jacoco/coverageReport.csv`    \n    }\n}\n```\n\n\u003c/details\u003e\n\n## Excecute\n\nRun tests by task `test` and generate reports by taks `coverageReport`:\n\n```bash\n ./gradlew test coverageReport\n```\n\n## Tasks description\n\n* `instrumentClassesOffline` - instruments `.class` files\n    * Inputs: class files generated by `classes` task\n    * Outputs: instrumented classes in `build/classes-instrumented`\n    * Depends on `classes` task\n* `assembleInstrumentedJar` - generates jar file from instrumented classes\n    * Inputs: insrumented class files generated by `instrumentClassesOffline` task\n    * Outputs: jar file classes in `libs/\u003cproject-name\u003e-instrumented.jar`\n    * Depends on `instrumentClassesOffline` task\n* `coverageReport` - generates coverage reports\n    * Inputs: `.exec` file generated by `test` task\n    * Outputs: HTML, XML, CSV reports(depends on [plugin configuration](#configuration))\n\n`Offlins` plugin modifies\ndefault [test task](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html)\nfrom [Java plugin](https://docs.gradle.org/current/userguide/java_plugin.html):\n\n* Sets the `test` task to dependend on `instrumentClassesOffline`\n* Adds **org.jacoco:org.jacoco.agent** artifact to classpath\n* Replaces a project `.class` files with instrumented classes in classpath\n* Replaces jars(dependecies on subprojects) with instrumented jars in classpath\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurpsg%2Fofflins-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurpsg%2Fofflins-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurpsg%2Fofflins-gradle-plugin/lists"}