diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 0000000..9aca74a --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,31 @@ +plugins { + //id 'groovy-gradle-plugin' + id 'java' +} + +repositories { + gradlePluginPortal() +} + +def log4jVersion = providers.environmentVariable("LOG4J_VERSION").getOrElse("2.25.0") + +tasks.withType(JavaCompile).configureEach { + // Test compatibility of `compileOnly` dependencies with Java 8 + // + // See: https://github.com/gradle/gradle/issues/33964 + options.release = 8 + options.compilerArgs.add("-Werror") // treat all warnings as errors + options.compilerArgs.add("-Xlint:all") // includes 'classfile' check +} + +dependencies { + implementation gradleApi() + + implementation "org.apache.logging.log4j:log4j-core:${log4jVersion}" + implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}" + implementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}" +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/buildSrc/gradle.properties b/buildSrc/gradle.properties new file mode 100644 index 0000000..e69de29 diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle new file mode 100644 index 0000000..e69de29 diff --git a/buildSrc/src/main/java/org/example/MyCustomTask.java b/buildSrc/src/main/java/org/example/MyCustomTask.java new file mode 100644 index 0000000..6b690e4 --- /dev/null +++ b/buildSrc/src/main/java/org/example/MyCustomTask.java @@ -0,0 +1,27 @@ +/* + * 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. + */ +package org.example; + +import org.gradle.api.DefaultTask; +import org.gradle.api.tasks.TaskAction; + +public class MyCustomTask extends DefaultTask { + @TaskAction + public void run() { + System.out.println("Custom task executed!"); + } +} \ No newline at end of file diff --git a/log4j-samples-gradle-metadata/settings.gradle b/log4j-samples-gradle-metadata/settings.gradle new file mode 100644 index 0000000..e69de29