You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2021/02/02 07:23:00 UTC

[isis] branch master updated: ISIS-2516: forces jdk version to 11 for tooling

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new dae92de  ISIS-2516: forces jdk version to 11 for tooling
dae92de is described below

commit dae92de23c11d59893e12f2fbf58616593e747fb
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Feb 2 07:19:59 2021 +0000

    ISIS-2516: forces jdk version to 11 for tooling
    
    IntelliJ kept reverting back to jdk8 for these ...).
    
    Also, adds some log4j2.xml config files, trying to avoid noisy messages to stdout (no luck so far)
---
 log4j2.xml                                         | 26 ++++++++++++++
 tooling/cli/src/main/resources/log4j2.xml          | 26 ++++++++++++++
 .../org/apache/isis/tooling/j2adoc/J2AdocUnit.java | 42 +++++++++++-----------
 tooling/pom.xml                                    | 28 ++++++++-------
 4 files changed, 88 insertions(+), 34 deletions(-)

diff --git a/log4j2.xml b/log4j2.xml
new file mode 100644
index 0000000..02f72cb
--- /dev/null
+++ b/log4j2.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you 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 http://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. -->
+<Configuration status="warn">
+    <Appenders>
+        <Console name="console" target="SYSTEM_OUT">
+            <PatternLayout   pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" />
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Logger name="org.apache.isis.tooling" level="info" additivity="false">
+            <appender-ref ref="console" />
+        </Logger>
+        <Root level="warn" additivity="false">
+            <appender-ref ref="console" />
+        </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file
diff --git a/tooling/cli/src/main/resources/log4j2.xml b/tooling/cli/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..02f72cb
--- /dev/null
+++ b/tooling/cli/src/main/resources/log4j2.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you 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 http://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. -->
+<Configuration status="warn">
+    <Appenders>
+        <Console name="console" target="SYSTEM_OUT">
+            <PatternLayout   pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" />
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Logger name="org.apache.isis.tooling" level="info" additivity="false">
+            <appender-ref ref="console" />
+        </Logger>
+        <Root level="warn" additivity="false">
+            <appender-ref ref="console" />
+        </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file
diff --git a/tooling/java2adoc/src/main/java/org/apache/isis/tooling/j2adoc/J2AdocUnit.java b/tooling/java2adoc/src/main/java/org/apache/isis/tooling/j2adoc/J2AdocUnit.java
index c15dd21..6999bf3 100644
--- a/tooling/java2adoc/src/main/java/org/apache/isis/tooling/j2adoc/J2AdocUnit.java
+++ b/tooling/java2adoc/src/main/java/org/apache/isis/tooling/j2adoc/J2AdocUnit.java
@@ -46,7 +46,7 @@ import lombok.extern.log4j.Log4j2;
 @RequiredArgsConstructor
 @Log4j2
 public final class J2AdocUnit {
-    
+
     //TODO not namespace aware yet
     @Value
     public static class LookupKey implements Comparable<LookupKey> {
@@ -79,23 +79,23 @@ public final class J2AdocUnit {
             // ignore package files
             return Stream.empty();
         }
-        
+
         try {
-            
+
             // remove 'tag::' and 'end::' lines
             // remove '// <.>' foot note references
             val source = AsciiDocIncludeTagFilter.read(sourceFile);
 
             val cu = StaticJavaParser.parse(source);
-            
+
             cu.getPackageDeclaration();
-            
-            
+
+
             return Stream.of(cu)
             .flatMap(CompilationUnits::streamTypeDeclarations)
             .filter(AnyTypeDeclaration::hasIndexDirective)
             .map(atd->{
-               
+
                 val resourceCoordinates = ResourceCoordinates.builder()
                 .friendlyName(atd.getName().stream()
                         .collect(Collectors.joining(".")))
@@ -106,9 +106,9 @@ public final class J2AdocUnit {
                 .namespace(PackageDeclarations.namespace(atd.getPackageDeclaration()))
                 .name(atd.getName())
                 .build();
-                
+
                 return new J2AdocUnit(resourceCoordinates, atd);
-                
+
             });
 
         } catch (Exception e) {
@@ -117,47 +117,47 @@ public final class J2AdocUnit {
         }
 
     }
-    
+
     public String getCanonicalName() {
         return resourceCoordinates.getNameAsString();
     }
-    
+
     /**
-     * Returns the recursively resolved (nested) type name. 
-     * Same as {@link #getSimpleName()} if type is not nested. 
+     * Returns the recursively resolved (nested) type name.
+     * Same as {@link #getSimpleName()} if type is not nested.
      */
     public Can<String> getName() {
         return resourceCoordinates.getName();
     }
-    
+
     public String getFriendlyName() {
         return resourceCoordinates.getFriendlyName();
     }
-    
+
     public String getSimpleName() {
         return resourceCoordinates.getSimpleName();
     }
-    
+
     public Can<String> getNamespace() {
         return resourceCoordinates.getNamespace();
     }
-    
+
     public String getDeclarationKeywordFriendlyName() {
         return _Strings.capitalize(typeDeclaration.getKind().name().toLowerCase());
     }
-    
+
     public String getDeclarationKeyword() {
         return typeDeclaration.getKind().getJavaKeyword();
     }
-    
+
     @Getter(lazy = true)
     private final Optional<Javadoc> javadoc = typeDeclaration.getJavadoc();
-    
+
     public String getAsciiDocXref(
             final @NonNull J2AdocContext j2aContext) {
         return j2aContext.getConverter().xref(this);
     }
-    
+
     public Document toAsciiDoc(
             final @NonNull J2AdocContext j2aContext) {
         return j2aContext.getFormatter().apply(this);
diff --git a/tooling/pom.xml b/tooling/pom.xml
index a91f634..38992e0 100644
--- a/tooling/pom.xml
+++ b/tooling/pom.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you 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 http://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 
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional
+	information regarding copyright ownership. The ASF licenses this file to
+	you 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 http://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. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -26,7 +26,7 @@
 
 	<name>Apache Isis - Tooling</name>
 	<description>
-        Libraries and tools not depending on the _Apache Isis Core_ ecosystem, 
+        Libraries and tools not depending on the _Apache Isis Core_ ecosystem,
         eg. code mining, automated documentation.
         (Targeted for JVM 11+)
     </description>
@@ -36,6 +36,8 @@
 	<properties>
 
 		<maven.compiler.release>11</maven.compiler.release>
+		<maven.compiler.source>11</maven.compiler.source>
+		<maven.compiler.target>11</maven.compiler.target>
 
 		<jar-plugin.automaticModuleName>org.apache.isis.tooling</jar-plugin.automaticModuleName>
 		<git-plugin.propertiesDir>org/apache/isis/tooling</git-plugin.propertiesDir>
@@ -193,7 +195,7 @@
 				<artifactId>isis-tooling-javamodel</artifactId>
 				<version>${project.version}</version>
 			</dependency>
-			
+
 			<dependency>
 				<groupId>org.apache.isis.tooling</groupId>
 				<artifactId>isis-tooling-java2adoc</artifactId>
@@ -280,8 +282,8 @@
 
 		<!-- LOGGING -->
 
-		<!-- Add Log4j2 Dependency, as a replacement for Spring's default 'logback'. 
-			This requires for the 'spring-boot-starter' to exclude the default logging 
+		<!-- Add Log4j2 Dependency, as a replacement for Spring's default 'logback'.
+			This requires for the 'spring-boot-starter' to exclude the default logging
 			artifact 'org.springframework.boot:spring-boot-starter-logging' see https://www.callicoder.com/spring-boot-log4j-2-example/ -->
 		<dependency>
 			<groupId>org.springframework.boot</groupId>