diff --git a/README.md b/README.md index e4bfa3a..e98f519 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,33 @@ In turn this can be used by [Diffblue Cover](https://diffblue.com/cover) to tune Cover Annotations is published in the [Maven central repository](https://central.sonatype.com/artifact/com.diffblue.cover/cover-annotations/overview). In order to use the annotations simply add `cover-annotations` as a dependency to your project, for example copying the snippet for Maven or Gradle from the repository page. +### Maven + +For installation into a Maven project the `provided` scope is recommended so that the annotations are available at compile and test time, but are not bundled with the project output: + +``` + + + com.diffblue.cover + cover-annotations + 1.4.0 + provided + + +``` + +### Gradle + +For installation into a Gradle project the `compileOnly` and `testImplementation` configurations are recommended so that the annotations are available at compile and test time, but are not bundled with the project output: + +``` +dependencies { + compileOnly("com.diffblue.cover:cover-annotations:1.4.0") + + testImplementation("com.diffblue.cover:cover-annotations:1.4.0") +} +``` + ## Usage Annotations placed on packages affect tests for all classes and methods under test in that package. diff --git a/pom.xml b/pom.xml index 820f7cf..97786d6 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 4.0.0 com.diffblue.cover cover-annotations - 1.3.0 + 1.4.0 jar Cover Annotations diff --git a/src/main/java/com/diffblue/cover/annotations/ContributionFromDiffblue.java b/src/main/java/com/diffblue/cover/annotations/ContributionFromDiffblue.java new file mode 100644 index 0000000..244b696 --- /dev/null +++ b/src/main/java/com/diffblue/cover/annotations/ContributionFromDiffblue.java @@ -0,0 +1,23 @@ +/* + * Copyright 2025 Diffblue Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ +package com.diffblue.cover.annotations; + +/** + * Empty interface, required, with the Category annotation, to label JUnit 4 tests in the following + * manner: @Category(ContributionFromDiffblue.class). + * + *

Identifies a test that has contributions from Diffblue. + */ +public interface ContributionFromDiffblue {} diff --git a/src/main/java/com/diffblue/cover/annotations/ManagedByDiffblue.java b/src/main/java/com/diffblue/cover/annotations/ManagedByDiffblue.java new file mode 100644 index 0000000..5887dc9 --- /dev/null +++ b/src/main/java/com/diffblue/cover/annotations/ManagedByDiffblue.java @@ -0,0 +1,21 @@ +/* + * Copyright 2025 Diffblue Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ +package com.diffblue.cover.annotations; + +/** + * Empty interface, identifies a test as managed by Diffblue. Tests annotated with this can be + * removed or updated by Diffblue and so should not be adjusted manually. + */ +public interface ManagedByDiffblue {}