You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2023/09/15 13:52:55 UTC

[logging-log4j-kotlin] branch main updated: Populate `maven-properties.adoc` from `maven-properties.tmpl.adoc`

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

vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j-kotlin.git


The following commit(s) were added to refs/heads/main by this push:
     new 4acfdd2  Populate `maven-properties.adoc` from `maven-properties.tmpl.adoc`
4acfdd2 is described below

commit 4acfdd2b1d06bfc2ecba1b97681027dad19b5bdc
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Fri Sep 15 15:52:00 2023 +0200

    Populate `maven-properties.adoc` from `maven-properties.tmpl.adoc`
---
 doc/manual.adoc                |  6 ++--
 doc/maven-properties.adoc      | 39 ++++++++++++++++++++++
 doc/maven-properties.tmpl.adoc | 39 ++++++++++++++++++++++
 pom.xml                        | 74 +++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 154 insertions(+), 4 deletions(-)

diff --git a/doc/manual.adoc b/doc/manual.adoc
index 6e0ffd3..4959d4a 100644
--- a/doc/manual.adoc
+++ b/doc/manual.adoc
@@ -15,12 +15,12 @@
     limitations under the License.
 ////
 
-:log4j-kotlin-version: 1.2.0
+include::maven-properties.adoc[]
 :log4j-url: https://logging.apache.org/log4j/2.x
 :log4j-api-url: {log4j-url}/manual/api-separation.html
 
 Log4j Kotlin API provides a Kotlin-friendly interface to log against {log4j-api-url}[the Log4j API].
-The minimum requirements are Java 8 and Kotlin 1.3.
+The minimum requirements are Java {java-version} and Kotlin {kotlin-version}.
 
 [IMPORTANT]
 ====
@@ -38,7 +38,7 @@ You need to have the `org.apache.logging.log4j:log4j-api-kotlin` dependency in y
 <dependency>
   <groupId>org.apache.logging.log4j</groupId>
   <artifactId>log4j-api-kotlin</artifactId>
-  <version>{log4j-kotlin-version}</version>
+  <version>{project-version}</version>
 </dependency>
 ----
 
diff --git a/doc/maven-properties.adoc b/doc/maven-properties.adoc
new file mode 100644
index 0000000..de046bc
--- /dev/null
+++ b/doc/maven-properties.adoc
@@ -0,0 +1,39 @@
+////
+    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.
+////
+
+////
+    ██     ██  █████  ██████  ███    ██ ██ ███    ██  ██████  ██
+    ██     ██ ██   ██ ██   ██ ████   ██ ██ ████   ██ ██       ██
+    ██  █  ██ ███████ ██████  ██ ██  ██ ██ ██ ██  ██ ██   ███ ██
+    ██ ███ ██ ██   ██ ██   ██ ██  ██ ██ ██ ██  ██ ██ ██    ██
+     ███ ███  ██   ██ ██   ██ ██   ████ ██ ██   ████  ██████  ██
+
+    IF THIS FILE IS CALLED `maven-properties.adoc`, DO NOT EDIT IT!
+    ALWAYS EDIT `maven-properties.tmpl.adoc`!
+
+    `maven-properties.adoc` is generated from `maven-properties.tmpl.adoc` by Maven.
+    Hence, you must always
+
+    1. Edit `maven-properties.tmpl.adoc`
+    2. Run `./mvnw generate-resources`
+    3. Commit both `maven-properties.tmpl.adoc` and `maven-properties.adoc`
+
+////
+
+:project-version: 1.3.0-SNAPSHOT
+:java-version: 17.0.8
+:kotlin-version: 1.6.21
diff --git a/doc/maven-properties.tmpl.adoc b/doc/maven-properties.tmpl.adoc
new file mode 100644
index 0000000..907c36c
--- /dev/null
+++ b/doc/maven-properties.tmpl.adoc
@@ -0,0 +1,39 @@
+////
+    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.
+////
+
+////
+    ██     ██  █████  ██████  ███    ██ ██ ███    ██  ██████  ██
+    ██     ██ ██   ██ ██   ██ ████   ██ ██ ████   ██ ██       ██
+    ██  █  ██ ███████ ██████  ██ ██  ██ ██ ██ ██  ██ ██   ███ ██
+    ██ ███ ██ ██   ██ ██   ██ ██  ██ ██ ██ ██  ██ ██ ██    ██
+     ███ ███  ██   ██ ██   ██ ██   ████ ██ ██   ████  ██████  ██
+
+    IF THIS FILE IS CALLED `maven-properties.adoc`, DO NOT EDIT IT!
+    ALWAYS EDIT `maven-properties.tmpl.adoc`!
+
+    `maven-properties.adoc` is generated from `maven-properties.tmpl.adoc` by Maven.
+    Hence, you must always
+
+    1. Edit `maven-properties.tmpl.adoc`
+    2. Run `./mvnw generate-resources`
+    3. Commit both `maven-properties.tmpl.adoc` and `maven-properties.adoc`
+
+////
+
+:project-version: ${project.version}
+:java-version: ${java.version}
+:kotlin-version: ${kotlin.version}
diff --git a/pom.xml b/pom.xml
index f64a194..27950df 100644
--- a/pom.xml
+++ b/pom.xml
@@ -276,8 +276,8 @@
     </pluginManagement>
 
     <plugins>
-      <plugin>
 
+      <plugin>
         <groupId>org.jetbrains.kotlin</groupId>
         <artifactId>kotlin-maven-plugin</artifactId>
         <executions>
@@ -299,6 +299,78 @@
       </plugin>
 
     </plugins>
+
   </build>
 
+  <profiles>
+
+    <!-- populate `doc/maven-properties.adoc` from `doc/maven-properties.tmpl.adoc` -->
+    <profile>
+
+      <id>maven-properties-adoc</id>
+
+      <activation>
+        <file>
+          <exists>doc/maven-properties.tmpl.adoc</exists>
+        </file>
+      </activation>
+
+      <build>
+        <plugins>
+
+          <!-- copy `doc/maven-properties.tmpl.adoc` to `target/doc` -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>copy-doc-maven-properties-tmpl</id>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <phase>generate-sources</phase>
+                <inherited>false</inherited>
+                <configuration>
+                  <target>
+                    <copy overwrite="true" tofile="${project.build.directory}/doc/maven-properties.adoc" verbose="true">
+                      <fileset file="doc/maven-properties.tmpl.adoc" />
+                    </copy>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+          <!-- process `target/doc` and output to `doc` -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-resources-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>filter-doc-maven-properties-tmpl</id>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <phase>process-sources</phase>
+                <inherited>false</inherited>
+                <configuration>
+                  <outputDirectory>doc</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>${project.build.directory}/doc</directory>
+                      <filtering>true</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+        </plugins>
+      </build>
+
+    </profile>
+
+  </profiles>
+
 </project>