File tree Expand file tree Collapse file tree 5 files changed +58
-0
lines changed 
src/main/java/org/example 
log4j-samples-gradle-metadata Expand file tree Collapse file tree 5 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ plugins  {
2+     // id 'groovy-gradle-plugin'
3+     id ' java' 
4+ }
5+ 
6+ repositories  {
7+     gradlePluginPortal()
8+ }
9+ 
10+ def  log4jVersion =  providers. environmentVariable(" LOG4J_VERSION" . getOrElse(" 2.25.0" 
11+ 
12+ tasks. withType(JavaCompile ). configureEach  {
13+     //  Test compatibility of `compileOnly` dependencies with Java 8
14+     // 
15+     //  See: https://github.com/gradle/gradle/issues/33964
16+     options. release =  8 
17+     options. compilerArgs. add(" -Werror" //  treat all warnings as errors
18+     options. compilerArgs. add(" -Xlint:all" //  includes 'classfile' check
19+ }
20+ 
21+ dependencies  {
22+     implementation gradleApi()
23+ 
24+     implementation " org.apache.logging.log4j:log4j-core:${ log4jVersion} " 
25+     implementation " org.apache.logging.log4j:log4j-api:${ log4jVersion} " 
26+     implementation " org.apache.logging.log4j:log4j-slf4j2-impl:${ log4jVersion} " 
27+ }
28+ 
29+ test  {
30+     useJUnitPlatform()
31+ }
Original file line number Diff line number Diff line change 1+ /* 
2+  * Licensed to the Apache Software Foundation (ASF) under one or more 
3+  * contributor license agreements.  See the NOTICE file distributed with 
4+  * this work for additional information regarding copyright ownership. 
5+  * The ASF licenses this file to you under the Apache License, Version 2.0 
6+  * (the "License"); you may not use this file except in compliance with 
7+  * the License.  You may obtain a copy of the License at 
8+  * 
9+  *      http://www.apache.org/licenses/LICENSE-2.0 
10+  * 
11+  * Unless required by applicable law or agreed to in writing, software 
12+  * distributed under the License is distributed on an "AS IS" BASIS, 
13+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
14+  * See the License for the specific language governing permissions and 
15+  * limitations under the License. 
16+  */ 
17+ package  org .example ;
18+ 
19+ import  org .gradle .api .DefaultTask ;
20+ import  org .gradle .api .tasks .TaskAction ;
21+ 
22+ public  class  MyCustomTask  extends  DefaultTask  {
23+     @ TaskAction 
24+     public  void  run () {
25+         System .out .println ("Custom task executed!" );
26+     }
27+ }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments