From 21c7a134e34e9c8e14d21d1289b9659a4f3b6f3b Mon Sep 17 00:00:00 2001 From: Jenkins Date: Thu, 26 Sep 2024 06:50:08 +0000 Subject: [PATCH] Release 2.6.0 --- README.md | 29 +++++++++++++++-------------- RELEASE_NOTES.md | 31 +++++++++++++++++-------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 204db39..9b41096 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=2.5.1-develop&color=blue)](https://search.maven.org/artifact/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.5.1-develop/jar) -[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/de.skuzzle.restrictimports?versionSuffix=2.5.1-develop)](https://plugins.gradle.org/plugin/de.skuzzle.restrictimports/2.5.1-develop) +[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=2.6.0&color=blue)](https://search.maven.org/artifact/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.6.0/jar) +[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/de.skuzzle.restrictimports?versionSuffix=2.6.0)](https://plugins.gradle.org/plugin/de.skuzzle.restrictimports/2.6.0) [![Coverage Status](https://coveralls.io/repos/github/skuzzle/restrict-imports-enforcer-rule/badge.svg?branch=master)](https://coveralls.io/github/skuzzle/restrict-imports-enforcer-rule?branch=master) [![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/ProjectPolly) @@ -17,7 +17,7 @@ Supported source files: Compatibility: - Works with Java 8+ -- Tested against _maven-enforcer-plugin_ versions `1.4.1` and `3.4.1`. +- Tested against _maven-enforcer-plugin_ versions `1.4.1` and `3.5.0`. ## Maven quick start This is a minimal usage example. Please scroll down for detailed configuration @@ -27,12 +27,12 @@ information or have a look at the [Full configuration example](#full-configurati org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 de.skuzzle.enforcer restrict-imports-enforcer-rule - 2.5.1-develop + 2.6.0 @@ -69,7 +69,7 @@ information or have a look at the [Full configuration example](#full-configurati ### ... with Groovy DSL ``` plugins { - id("de.skuzzle.restrictimports") version("2.5.1-develop") + id("de.skuzzle.restrictimports") version("2.6.0") } restrictImports { @@ -81,7 +81,7 @@ restrictImports { ### ... with Kotlin DSL ``` plugins { - id("de.skuzzle.restrictimports") version("2.5.1-develop") + id("de.skuzzle.restrictimports") version("2.6.0") } restrictImports { @@ -715,19 +715,20 @@ considerably slower. ## Package Patterns Package patterns are dot separated strings that can be compared case sensitively part by part. Every part must adhere to -the java identifier rules with the exception of a some special literals: +the java identifier rules except some special literals: 1. `*` matches every package part but exactly one. 2. `**` matches multiple package parts but at least one. 3. `'*'` matches a literal `*` in an import statement. +4. `*SomeString` matches every package part that ends with `SomeString`. +5. `SomeString*` matches every package part that starts with `SomeString`. +6. `*SomeString*` matches every package part that contains `SomeString`. The pattern `java.util.*` matches `java.util.ArrayList` but not `java.util.regex.Pattern`. -Likewise the pattern `java.util.**` matches all classes and subclasses contained in -`java.util`. Double wildcards are supported everywhere within a pattern. `**.DumbName` -would match every import which ends in `DumbName`. Wildcards are forbidden to be used in -combination with other characters within a single part, like in `com.foo**`. Also parts -within a package must not be empty like in `foo..bar`. +Likewise, the pattern `java.util.**` matches all classes and subclasses contained in`java.util`. +Double wildcards are supported everywhere within a pattern. `**.*DumbName` would match every import which ends in `DumbName`. +Parts within a package must not be empty like in `foo..bar`. If a pattern does not contain any wildcards, matching degrades to a simple String comparison. @@ -742,7 +743,7 @@ String split operations and only reading each source file up until a non-import discovered. We cover a set of esoteric edge cases, for example block comments within a single import statement and the like. -> [!NOTE] +> !NOTE] > Plus side to this approach is, that we are mostly agnostic to the Java version you are using. Our parser doesn't > need updates even if you want to use latest Java language features in your code base. diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index f1fb2c8..44f62d3 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,28 +1,30 @@ -[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=2.5.1-develop&color=blue)](https://search.maven.org/artifact/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.5.1-develop/jar) -[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/de.skuzzle.restrictimports?versionSuffix=2.5.1-develop)](https://plugins.gradle.org/plugin/de.skuzzle.restrictimports/2.5.1-develop) - -> [!NOTE] -> This is the first release after migrating our build to Gradle and which uses shaded dependencies. -> If you encounter any irregularities with this version, please do not hesitate to file an issue. +[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=2.6.0&color=blue)](https://search.maven.org/artifact/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.6.0/jar) +[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/de.skuzzle.restrictimports?versionSuffix=2.6.0)](https://plugins.gradle.org/plugin/de.skuzzle.restrictimports/2.6.0) ### Features -* [#38](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/38) Dependencies are shaded into plugin artifacts -* [#59](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/59) Provide a Gradle plugin -* [#118](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/118) Print absolute paths in exception messages to make IntelliJ render clickable links +* [#177](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/177) Support matching prefix, suffix and infix +parts within a package pattern. + +### Dependency coordinates +
+ Maven dependency declaration -maven ```xml de.skuzzle.enforcer restrict-imports-enforcer-rule - 2.5.1-develop + 2.6.0 ``` +
+ +
+ Gradle dependency declaration Gradle plugin DSL ```groovy plugins { - id("de.skuzzle.restrictimports") version "2.5.1-develop" + id("de.skuzzle.restrictimports") version "2.6.0" } ``` @@ -35,7 +37,7 @@ buildscript { } } dependencies { - classpath("de.skuzzle.enforcer:restrict-imports-gradle-plugin:2.5.1-develop") + classpath("de.skuzzle.enforcer:restrict-imports-gradle-plugin:2.6.0") } } @@ -45,5 +47,6 @@ apply(plugin = "de.skuzzle.restrictimports") Gradle version catalog (Toml) ```toml [plugins] -restrictImports = { id = "de.skuzzle.restrictimports", version = "2.5.1-develop" } +restrictImports = { id = "de.skuzzle.restrictimports", version = "2.6.0" } ``` +