File tree Expand file tree Collapse file tree 4 files changed +22
-8
lines changed 
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ public class ElasticsearchJavaBasePlugin implements Plugin<Project> {
5858
5959    @ Override 
6060    public  void  apply (Project  project ) {
61-         project .getRootProject ().getPlugins ().apply (GlobalBuildInfoPlugin .class );
6261        // make sure the global build info plugin is applied to the root project 
6362        project .getRootProject ().getPluginManager ().apply (GlobalBuildInfoPlugin .class );
6463        buildParams  = project .getRootProject ().getExtensions ().getByType (BuildParameterExtension .class );
Original file line number Diff line number Diff line change @@ -20,11 +20,20 @@ dependencies {
2020  testImplementation project(' :modules:rest-root'  )
2121}
2222
23- tasks . named( " compileJava " ) . configure  {
23+ java  {
2424  targetCompatibility =  JavaVersion . VERSION_1_8 
2525  sourceCompatibility =  JavaVersion . VERSION_1_8 
2626}
2727
28+ tasks. named(" compileTestJava"  ). configure  {
29+   targetCompatibility =  buildParams. getMinimumRuntimeVersion()
30+   sourceCompatibility =  buildParams. getMinimumRuntimeVersion()
31+ }
32+ 
33+ tasks. named(" test"  ). configure  {
34+   //  reset the unit test classpath as using the shadow jar won't work due to relocated packages
35+   classpath =  sourceSets. test. runtimeClasspath
36+ }
2837
2938tasks. named(" shadowJar"  ). configure  {
3039  relocate ' com.fasterxml'  , ' shadow.fasterxml' 
@@ -34,7 +43,3 @@ tasks.named("shadowJar").configure {
3443  }
3544}
3645
37- tasks. named(" test"  ). configure  {
38-   //  reset the unit test classpath as using the shadow jar won't work due to relocated packages
39-   classpath =  sourceSets. test. runtimeClasspath
40- }
Original file line number Diff line number Diff line change @@ -12,11 +12,16 @@ dependencies {
1212  testImplementation(testArtifact(project(xpackModule(' core'  ))))
1313}
1414
15- tasks . named( " compileJava " ) . configure  {
15+ java  {
1616  targetCompatibility =  JavaVersion . VERSION_1_8 
1717  sourceCompatibility =  JavaVersion . VERSION_1_8 
1818}
1919
20+ tasks. named(" compileTestJava"  ). configure  {
21+   targetCompatibility =  buildParams. getMinimumRuntimeVersion()
22+   sourceCompatibility =  buildParams. getMinimumRuntimeVersion()
23+ }
24+ 
2025tasks. named(' forbiddenApisMain'  ). configure  {
2126  //  does not depend on core, so only jdk and http signatures should be checked
2227  replaceSignatureFiles ' jdk-signatures' 
Original file line number Diff line number Diff line change @@ -16,11 +16,16 @@ dependencies {
1616  }
1717}
1818
19- tasks . named( " compileJava " ) . configure  {
19+ java  {
2020  targetCompatibility =  JavaVersion . VERSION_1_8 
2121  sourceCompatibility =  JavaVersion . VERSION_1_8 
2222}
2323
24+ tasks. named(" compileTestJava"  ). configure  {
25+   targetCompatibility =  buildParams. getMinimumRuntimeVersion()
26+   sourceCompatibility =  buildParams. getMinimumRuntimeVersion()
27+ }
28+ 
2429tasks. named(' forbiddenApisMain'  ). configure  {
2530  // sql does not depend on server, so only jdk signatures should be checked
2631  replaceSignatureFiles ' jdk-signatures' 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments