diff --git a/README.md b/README.md index 20a83016f8..011717c124 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ framework. ###### Gradle ``` -testImplementation 'com.tngtech.archunit:archunit:0.13.1' +testImplementation 'com.tngtech.archunit:archunit:0.14.0' ``` ###### Maven @@ -26,7 +26,7 @@ testImplementation 'com.tngtech.archunit:archunit:0.13.1' com.tngtech.archunit archunit - 0.13.1 + 0.14.0 test ``` diff --git a/build-steps/release/expected/archunit-junit5-engine-api.pom b/build-steps/release/expected/archunit-junit5-engine-api.pom index 41789c1395..0e2c3c2004 100644 --- a/build-steps/release/expected/archunit-junit5-engine-api.pom +++ b/build-steps/release/expected/archunit-junit5-engine-api.pom @@ -51,7 +51,7 @@ org.junit.platform junit-platform-engine - 1.5.2 + 1.6.2 compile diff --git a/build.gradle b/build.gradle index 2e5724edb1..1aa8076b7c 100644 --- a/build.gradle +++ b/build.gradle @@ -122,7 +122,7 @@ ext { allprojects { group = 'com.tngtech.archunit' - version = '0.14.0-SNAPSHOT' + version = '0.14.0' repositories { mavenCentral() @@ -141,7 +141,7 @@ task clean { } } -subprojects { +configure(subprojects.findAll {it.name != 'docs'}) { apply plugin: 'java-library' description createModuleDescription(rootProject.description, project) diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 39e1941693..2ab06dc117 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -8,7 +8,7 @@ main: - title: "User Guide" url: /userguide/html/000_Index.html - title: "API" - url: https://javadoc.io/doc/com.tngtech.archunit/archunit/0.13.1 + url: https://javadoc.io/doc/com.tngtech.archunit/archunit/0.14.0 - title: "About" url: /about diff --git a/docs/_pages/getting-started.md b/docs/_pages/getting-started.md index 8ce84102bc..6b7a3e6d12 100644 --- a/docs/_pages/getting-started.md +++ b/docs/_pages/getting-started.md @@ -15,7 +15,7 @@ ArchUnit can be obtained from Maven Central. com.tngtech.archunit archunit - 0.13.1 + 0.14.0 test ``` @@ -23,7 +23,7 @@ ArchUnit can be obtained from Maven Central. #### Gradle ```groovy dependencies { - testImplementation 'com.tngtech.archunit:archunit:0.13.1' + testImplementation 'com.tngtech.archunit:archunit:0.14.0' } ``` diff --git a/docs/_posts/2020-05-24-release-v0.14.0.markdown b/docs/_posts/2020-05-24-release-v0.14.0.markdown new file mode 100644 index 0000000000..78bf411c19 --- /dev/null +++ b/docs/_posts/2020-05-24-release-v0.14.0.markdown @@ -0,0 +1,8 @@ +--- +layout: splash +title: "New release of ArchUnit (v0.14.0)" +date: 2020-05-24 01:00:00 +categories: news release +--- + +A new release of ArchUnit (v0.14.0) is out. For details see [the release on GitHub](https://github.com/TNG/ArchUnit/releases/tag/v0.14.0 "ArchUnit v0.14.0 on GitHub"). diff --git a/docs/build.gradle b/docs/build.gradle index ed6caaf992..5cdb7eba39 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -1,9 +1,9 @@ plugins { - id "org.asciidoctor.convert" version "1.5.3" + id "org.asciidoctor.convert" version "2.4.0" } dependencies { - asciidoctor 'org.asciidoctor:asciidoctorj-diagram:1.5.11' + asciidoctor 'org.asciidoctor:asciidoctorj-diagram:2.0.2' } task cleanUserGuide(type: Delete) { @@ -12,7 +12,8 @@ task cleanUserGuide(type: Delete) { asciidoctor { backends 'html' - attributes 'source-highlighter': 'highlightjs', + attributes 'revnumber': project.version, + 'source-highlighter': 'highlightjs', 'highlightjs-theme': 'mono-blue', 'stylesheet': 'archunit.css' sourceDir file('userguide') @@ -25,9 +26,8 @@ asciidoctor { } asciidoctorj { - version = '1.5.8.1' + version = '2.3.0' } asciidoctor.dependsOn cleanUserGuide - -defaultTasks 'asciidoctor' +task renderUserGuide(dependsOn: asciidoctor) diff --git a/docs/userguide/000_Index.adoc b/docs/userguide/000_Index.adoc index c4a2c48e5c..4c3d0a25a4 100644 --- a/docs/userguide/000_Index.adoc +++ b/docs/userguide/000_Index.adoc @@ -7,7 +7,6 @@ ifndef::env-site[:toc: left] :page-layout: splash :page-description: {description} :page-keywords: {keywords} -:version: 0.13.1 :icons: font :source-highlighter: coderay :prewrap!: diff --git a/docs/userguide/002_Installation.adoc b/docs/userguide/002_Installation.adoc index 71ac0c9c06..bc15bf05b5 100644 --- a/docs/userguide/002_Installation.adoc +++ b/docs/userguide/002_Installation.adoc @@ -11,22 +11,22 @@ http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.tngtech.archunit%22[Maven To use ArchUnit in combination with JUnit 4, include the following dependency from Maven Central: -[source,xml,options="nowrap"] +[source,xml,options="nowrap",subs="verbatim,attributes"] .pom.xml ---- com.tngtech.archunit archunit-junit4 - 0.13.1 + {revnumber} test ---- -[source,options="nowrap"] +[source,options="nowrap",subs="verbatim,attributes"] .build.gradle ---- dependencies { - testImplementation 'com.tngtech.archunit:archunit-junit4:0.13.1' + testImplementation 'com.tngtech.archunit:archunit-junit4:{revnumber}' } ---- @@ -39,22 +39,22 @@ artifact transitively including both API and engine with the correct scope, whic as a test compile dependency. Thus to include ArchUnit's JUnit 5 support, simply add the following dependency from Maven Central: -[source,xml,options="nowrap"] +[source,xml,options="nowrap",subs="verbatim,attributes"] .pom.xml ---- com.tngtech.archunit archunit-junit5 - 0.13.1 + {revnumber} test ---- -[source,options="nowrap"] +[source,options="nowrap",subs="verbatim,attributes"] .build.gradle ---- dependencies { - testImplementation 'com.tngtech.archunit:archunit-junit5:0.13.1' + testImplementation 'com.tngtech.archunit:archunit-junit5:{revnumber}' } ---- @@ -63,22 +63,22 @@ dependencies { ArchUnit works with any test framework that executes Java code. To use ArchUnit in such a context, include the core ArchUnit dependency from Maven Central: -[source,xml,options="nowrap"] +[source,xml,options="nowrap",subs="verbatim,attributes"] .pom.xml ---- com.tngtech.archunit archunit - 0.13.1 + {revnumber} test ---- -[source,options="nowrap"] +[source,options="nowrap",subs="verbatim,attributes"] .build.gradle ---- dependencies { - testImplementation 'com.tngtech.archunit:archunit:0.13.1' + testImplementation 'com.tngtech.archunit:archunit:{revnumber}' } ---- diff --git a/docs/userguide/html/000_Index.html b/docs/userguide/html/000_Index.html index cc59c1235a..1818634879 100644 --- a/docs/userguide/html/000_Index.html +++ b/docs/userguide/html/000_Index.html @@ -2,9 +2,9 @@ - + - + ArchUnit User Guide @@ -448,6 +448,9 @@
-
classes().that().areAssignableTo(EntityManager.class)
+
classes().that().areAssignableTo(EntityManager.class)
     .should().onlyBeAccessed().byAnyPackage("..persistence..")
@@ -926,7 +929,7 @@

4.5
-
classes().that().areAssignableTo(EntityManager.class)
+
classes().that().areAssignableTo(EntityManager.class)
     .should().onlyBeAccessed().byClassesThat().areAnnotatedWith(Transactional.class)
@@ -940,7 +943,7 @@

4.6. Layer Ch
-
layeredArchitecture()
+
layeredArchitecture()
     .layer("Controller").definedBy("..controller..")
     .layer("Service").definedBy("..service..")
     .layer("Persistence").definedBy("..persistence..")
@@ -960,7 +963,7 @@ 

4.7. Cycle Ch

-
slices().matching("com.myapp.(*)..").should().beFreeOfCycles()
+
slices().matching("com.myapp.(*)..").should().beFreeOfCycles()
@@ -995,7 +998,7 @@

5.1. Core

-
JavaClasses classes = new ClassFileImporter().importPackages("com.mycompany.myapp");
+
JavaClasses classes = new ClassFileImporter().importPackages("com.mycompany.myapp");
@@ -1019,7 +1022,7 @@

5.2. Lang

-
ArchRule rule =
+
ArchRule rule =
     classes().that().resideInAPackage("..service..")
         .should().onlyBeAccessed().byAnyPackage("..controller..", "..service..");
@@ -1029,7 +1032,7 @@

5.2. Lang

-
JavaClasses importedClasses = new ClassFileImporter().importPackage("com.myapp");
+
JavaClasses importedClasses = new ClassFileImporter().importPackage("com.myapp");
 ArchRule rule = // define the rule
 rule.check(importedClasses);
@@ -1066,7 +1069,7 @@

6.1. Import

-
JavaClasses classes = new ClassFileImporter().importClasspath();
+
JavaClasses classes = new ClassFileImporter().importClasspath();
@@ -1075,7 +1078,7 @@

6.1. Import

-
JavaClasses classes = new ClassFileImporter().importPath("/some/path/to/classes");
+
JavaClasses classes = new ClassFileImporter().importPath("/some/path/to/classes");
@@ -1089,7 +1092,7 @@

6.1. Import

-
ImportOption ignoreTests = new ImportOption() {
+
ImportOption ignoreTests = new ImportOption() {
     @Override
     public boolean includes(Location location) {
         return !location.contains("/test/"); // ignore any URI to sources that contains '/test/'
@@ -1119,7 +1122,7 @@ 

6.1. Import

-
new ClassFileImporter()
+
new ClassFileImporter()
     .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_JARS)
     .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS)
     .importClasspath();
@@ -1251,7 +1254,7 @@

@@ -1321,7 +1324,7 @@

-
Set<JavaClass> services = new HashSet<>();
+
Set<JavaClass> services = new HashSet<>();
 for (JavaClass clazz : classes) {
     // choose those classes with FQN with infix '.service.'
     if (clazz.getName().contains(".service.")) {
@@ -1357,7 +1360,7 @@ 

-
ArchRule rule = ArchRuleDefinition.noClasses()
+
ArchRule rule = ArchRuleDefinition.noClasses()
     .that().resideInAPackage("..service..")
     .should().accessClassesThat().resideInAPackage("..controller..");
 
@@ -1372,7 +1375,7 @@ 

-
java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] -
+
java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] -
 Rule 'no classes that reside in a package '..service..'
 should access classes that reside in a package '..controller..'' was violated (1 times):
 Method <some.pkg.service.SomeService.callController()>
@@ -1387,7 +1390,7 @@ 

-
noClasses()
+
noClasses()
     .that().resideInAPackage("..service..")
     .or().resideInAPackage("..persistence..")
     .should().accessClassesThat().resideInAPackage("..controller..")
@@ -1407,7 +1410,7 @@ 

-
ArchRule rule = ArchRuleDefinition.methods()
+
ArchRule rule = ArchRuleDefinition.methods()
     .that().arePublic()
     .and().areDeclaredInClassesThat().resideInAPackage("..controller..")
     .should().beAnnotatedWith(Secured.class);
@@ -1427,7 +1430,7 @@ 

-
classes that ${PREDICATE} should ${CONDITION}
+
classes that ${PREDICATE} should ${CONDITION}
@@ -1438,7 +1441,7 @@

-
DescribedPredicate<JavaClass> resideInAPackageService = // define the predicate
+
DescribedPredicate<JavaClass> resideInAPackageService = // define the predicate
 ArchCondition<JavaClass> accessClassesThatResideInAPackageController = // define the condition
 
 noClasses().that(resideInAPackageService)
@@ -1452,7 +1455,7 @@ 

@@ -1507,7 +1510,7 @@

@@ -1533,7 +1536,7 @@

-
// Does not compile, because type(..) targets a subtype of HasName
+
// Does not compile, because type(..) targets a subtype of HasName
 HasName.Predicates.name("").and(JavaClass.Predicates.type(Serializable.class))
 
 // Does compile, because name(..) targets a supertype of JavaClass
@@ -1555,7 +1558,7 @@ 

@@ -1595,7 +1598,7 @@

@@ -1689,7 +1692,7 @@

archunit_ignore_patterns.txt
-
# There are many known violations where LegacyService is involved; we'll ignore them all
+
# There are many known violations where LegacyService is involved; we'll ignore them all
 .*some\.pkg\.LegacyService.*

@@ -1711,7 +1714,7 @@

8.1. Archit

-
com.tngtech.archunit.library.Architectures
+
com.tngtech.archunit.library.Architectures
@@ -1734,7 +1737,7 @@

8

-
onionArchitecture()
+
onionArchitecture()
         .domainModels("com.myapp.domain.model..")
         .domainServices("com.myapp.domain.service..")
         .applicationServices("com.myapp.application..")
@@ -1790,7 +1793,7 @@ 

8.2. Slices

-
com.tngtech.archunit.library.dependencies.SlicesRuleDefinition
+
com.tngtech.archunit.library.dependencies.SlicesRuleDefinition
@@ -1799,7 +1802,7 @@

8.2. Slices

-
// sort classes by the first package after 'myapp'
+
// sort classes by the first package after 'myapp'
 // then check those slices for cyclic dependencies
 SlicesRuleDefinition.slices().matching("..myapp.(*)..").should().beFreeOfCycles()
 
@@ -1819,7 +1822,7 @@ 

8.2. Slices

-
SliceAssignment legacyPackageStructure = new SliceAssignment() {
+
SliceAssignment legacyPackageStructure = new SliceAssignment() {
     // this will specify which classes belong together in the same slice
     @Override
     public SliceIdentifier getIdentifierOf(JavaClass javaClass) {
@@ -1854,7 +1857,7 @@ 

8.2.1. Co
archunit.properties
-
# This will limit the maximum number of cycles to detect and thus required CPU and heap.
+
# This will limit the maximum number of cycles to detect and thus required CPU and heap.
 # default is 100
 cycles.maxNumberToDetect=50
 
@@ -1877,7 +1880,7 @@ 

<

-
com.tngtech.archunit.library.GeneralCodingRules
+
com.tngtech.archunit.library.GeneralCodingRules
@@ -1902,7 +1905,7 @@

-
URL myDiagram = getClass().getResource("my-diagram.puml");
+
URL myDiagram = getClass().getResource("my-diagram.puml");
 
 classes().should(adhereToPlantUmlDiagram(myDiagram, consideringAllDependencies()));
@@ -1919,7 +1922,7 @@

-
// considers all dependencies possible (including java.lang, java.util, ...)
+
// considers all dependencies possible (including java.lang, java.util, ...)
 classes().should(adhereToPlantUmlDiagram(
         mydiagram, consideringAllDependencies())
 
@@ -1960,7 +1963,7 @@ 

8.4.1

-
// there are further ignore flavors available
+
// there are further ignore flavors available
 classes().should(adhereToPlantUmlDiagram(mydiagram).ignoreDependencies(predicate))
@@ -2019,7 +2022,7 @@

8.5.1. Usage

-
ArchRule rule = FreezingArchRule.freeze(classes().should()./*complete ArchRule*/);
+
ArchRule rule = FreezingArchRule.freeze(classes().should()./*complete ArchRule*/);
@@ -2039,7 +2042,7 @@

8.5.2. Conf
archunit.properties
-
freeze.store.default.path=/some/path/in/a/vcs/repo
+
freeze.store.default.path=/some/path/in/a/vcs/repo
@@ -2048,7 +2051,7 @@

8.5.2. Conf
archunit.properties
-
# must be set to true to allow the creation of a new violation store
+
# must be set to true to allow the creation of a new violation store
 # default is false
 freeze.store.default.allowStoreCreation=true
 
@@ -2068,7 +2071,7 @@ 

8.5.2. Conf

-
-Darchunit.freeze.store.default.allowStoreCreation=true
+
-Darchunit.freeze.store.default.allowStoreCreation=true
@@ -2091,7 +2094,7 @@
Violati

-
FreezingArchRule.freeze(rule).persistIn(customViolationStore);
+
FreezingArchRule.freeze(rule).persistIn(customViolationStore);
@@ -2099,7 +2102,7 @@
Violati
-
freeze.store=fully.qualified.name.of.MyCustomViolationStore
+
freeze.store=fully.qualified.name.of.MyCustomViolationStore
@@ -2108,7 +2111,7 @@
Violati
-
freeze.store.propOne=valueOne
+
freeze.store.propOne=valueOne
 freeze.store.propTwo=valueTwo
@@ -2117,7 +2120,7 @@
Violati

-
propOne=valueOne
+
propOne=valueOne
 propTwo=valueTwo
@@ -2132,7 +2135,7 @@
-
FreezingArchRule.freeze(rule).associateViolationLinesVia(customLineMatcher);
+
FreezingArchRule.freeze(rule).associateViolationLinesVia(customLineMatcher);

@@ -2160,7 +2163,7 @@

9. JUnit Su

-
@Test
+
@Test
 public void rule1() {
     JavaClasses importedClasses = new ClassFileImporter().importClasspath();
 
@@ -2199,7 +2202,7 @@ 

9.1.1. Writ

-
@RunWith(ArchUnitRunner.class) // Remove this line for JUnit 5!!
+
@RunWith(ArchUnitRunner.class) // Remove this line for JUnit 5!!
 @AnalyzeClasses(packages = "com.myapp")
 public class ArchitectureTest {
 
@@ -2237,7 +2240,7 @@ 

-
@AnalyzeClasses(packages = {"com.myapp.subone", "com.myapp.subone"})
+
@AnalyzeClasses(packages = {"com.myapp.subone", "com.myapp.subone"})

@@ -2254,7 +2257,7 @@

@@ -2478,7 +2481,7 @@

archunit.properties
-
enableMd5InClassSources=true
+
enableMd5InClassSources=true

@@ -2486,15 +2489,15 @@

-
javaClass.getSource().get().getMd5sum()
+
javaClass.getSource().get().getMd5sum()

- - + + \ No newline at end of file diff --git a/docs/userguide/html/class-naming-deps.png b/docs/userguide/html/class-naming-deps.png index 3768d47466..6b263e4e5e 100644 Binary files a/docs/userguide/html/class-naming-deps.png and b/docs/userguide/html/class-naming-deps.png differ diff --git a/docs/userguide/html/class-package-contain.png b/docs/userguide/html/class-package-contain.png index 6b3e88b7ea..57427037a1 100644 Binary files a/docs/userguide/html/class-package-contain.png and b/docs/userguide/html/class-package-contain.png differ diff --git a/docs/userguide/html/cycle-check.png b/docs/userguide/html/cycle-check.png index d3551dc93d..908c03ddfa 100644 Binary files a/docs/userguide/html/cycle-check.png and b/docs/userguide/html/cycle-check.png differ diff --git a/docs/userguide/html/diamond-example.png b/docs/userguide/html/diamond-example.png index 5645eee1ae..891ee258c6 100644 Binary files a/docs/userguide/html/diamond-example.png and b/docs/userguide/html/diamond-example.png differ diff --git a/docs/userguide/html/domain-overview.png b/docs/userguide/html/domain-overview.png index 2ed172bb2c..7b7d57d9a2 100644 Binary files a/docs/userguide/html/domain-overview.png and b/docs/userguide/html/domain-overview.png differ diff --git a/docs/userguide/html/import-vs-lang.png b/docs/userguide/html/import-vs-lang.png index 35985153b9..3087d7bf12 100644 Binary files a/docs/userguide/html/import-vs-lang.png and b/docs/userguide/html/import-vs-lang.png differ diff --git a/docs/userguide/html/inheritance-access-check.png b/docs/userguide/html/inheritance-access-check.png index c17ae1f3fd..e44934bb1a 100644 Binary files a/docs/userguide/html/inheritance-access-check.png and b/docs/userguide/html/inheritance-access-check.png differ diff --git a/docs/userguide/html/inheritance-annotation-check.png b/docs/userguide/html/inheritance-annotation-check.png index 762ca11edf..60da19e79b 100644 Binary files a/docs/userguide/html/inheritance-annotation-check.png and b/docs/userguide/html/inheritance-annotation-check.png differ diff --git a/docs/userguide/html/inheritance-naming-check.png b/docs/userguide/html/inheritance-naming-check.png index 528d537ca9..f0e145ffb3 100644 Binary files a/docs/userguide/html/inheritance-naming-check.png and b/docs/userguide/html/inheritance-naming-check.png differ diff --git a/docs/userguide/html/layer-check.png b/docs/userguide/html/layer-check.png index 46891d3e32..494b83d17a 100644 Binary files a/docs/userguide/html/layer-check.png and b/docs/userguide/html/layer-check.png differ diff --git a/docs/userguide/html/onion-architecture-check.png b/docs/userguide/html/onion-architecture-check.png index aae91f6dee..577bb5eb9e 100644 Binary files a/docs/userguide/html/onion-architecture-check.png and b/docs/userguide/html/onion-architecture-check.png differ diff --git a/docs/userguide/html/package-deps-no-access.png b/docs/userguide/html/package-deps-no-access.png index 96381eb5a5..9769384e37 100644 Binary files a/docs/userguide/html/package-deps-no-access.png and b/docs/userguide/html/package-deps-no-access.png differ diff --git a/docs/userguide/html/package-deps-only-access.png b/docs/userguide/html/package-deps-only-access.png index fb9275845a..d6f26df943 100644 Binary files a/docs/userguide/html/package-deps-only-access.png and b/docs/userguide/html/package-deps-only-access.png differ diff --git a/docs/userguide/html/resolution-example.png b/docs/userguide/html/resolution-example.png index 87b091fad4..d879ee4d1b 100644 Binary files a/docs/userguide/html/resolution-example.png and b/docs/userguide/html/resolution-example.png differ diff --git a/docs/userguide/html/resolution-overview.png b/docs/userguide/html/resolution-overview.png index 3534e0ea8c..63216d73c5 100644 Binary files a/docs/userguide/html/resolution-overview.png and b/docs/userguide/html/resolution-overview.png differ diff --git a/docs/userguide/html/simple-plantuml-archrule-example.png b/docs/userguide/html/simple-plantuml-archrule-example.png index 9dcb93ccc5..73a4e9a6fe 100644 Binary files a/docs/userguide/html/simple-plantuml-archrule-example.png and b/docs/userguide/html/simple-plantuml-archrule-example.png differ diff --git a/settings.gradle b/settings.gradle index 7dbee14b3a..b7c4dcecfe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,7 +4,7 @@ plugins { include 'archunit', 'archunit-example', 'archunit-integration-test', 'archunit-junit', 'archunit-junit4', 'archunit-junit5-api','archunit-junit5-engine-api','archunit-junit5-engine', 'archunit-junit5', - 'archunit-example:example-plain', 'archunit-example:example-junit4', 'archunit-example:example-junit5' + 'archunit-example:example-plain', 'archunit-example:example-junit4', 'archunit-example:example-junit5', 'docs' project(':archunit-junit4').projectDir = file('archunit-junit/junit4') project(':archunit-junit5-api').projectDir = file('archunit-junit/junit5/api') @@ -17,4 +17,4 @@ gradleEnterprise { termsOfServiceUrl = "https://gradle.com/terms-of-service" termsOfServiceAgree = "yes" } -} \ No newline at end of file +}