This project provides a tool to identify architectural mistakes.
The plugin can be applied to all Gradle Intershop projects.
Groovy
In build.gradle:
plugins {
id "com.intershop.gradle.architectural.report" version "5.0.0"
}
architectureReport {
keySelector = ["com.intershop.java.api.violation"]
baselineFile = file("api_definition_baseline.xml")
knownIssuesFile = file("known_issues.xml")
}
Kotlin
In build.gradle.kts:
plugins {
id("com.intershop.gradle.architectural.report") version "5.0.0"
}
architectureReport {
keySelector.set(listOf("com.intershop.java.api.violation"))
baselineFile.set(file("api_definition_baseline.xml"))
knownIssuesFile.set(file("known_issues.xml"))
}
Start the architecture report task:
./gradlew validateArchitecture
Task | Description |
---|---|
validateArchitecture | Task creates API definition, API diffs, list of collected issues |
Key | Description |
---|---|
com.intershop.java.api.violation | API differences to an API baseline |
com.intershop.java.capi.internal | Validate that CAPI doesn't use internal classes |
com.intershop.library.update | New version contains major third party library update |
com.intershop.library.new | New version contains a new third party library |
Key | Type | Default value | Description |
---|---|---|---|
keySelector | ListProperty<String> | Define keys for validation, other issues will be ignored | |
dependenciesFile | RegularFileProperty | <project.buildDir>/architectureReport/dependencies.txt (All transitive Gradle project dependencies like libraries, cartridges will be used) |
(optional) Specifies dependencies TXT-file whereas each line represents a dependency in format:
|
knownIssuesFile | RegularFileProperty | (optional) Read known issues from a XML-file, listed issues will be ignored | |
baselineFile | RegularFileProperty | (optional) API baseline (previously published api_definition.xml of baseline release) | |
useExternalProcess | Property<Boolean> | true |
(optional) Whether to start architecture report tool in external Java process |
additionalJvmArguments | ListProperty<String> | (optional) Additional JVM arguments | |
reportsDirectory | DirectoryProperty | <project.buildDir>/architectureReport |
(optional) Directory to write reports (new_issues, api_definition, resolved_issues) |
File | Description |
---|---|
api_definition.xml | API extraction of current build |
api_violation.xml | Removed API entries (compared to document located at 'baseLineURI') |
fixed_issues.xml | Issues, which are listed at 'knownIssuesFile', but not longer detected |
new_issues.xml | Issues, which are not listed at 'knownIssuesFile', but detected |
See here for details.
Copyright 2014-2023 Intershop Communications.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License 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.