Fix some IDE's (vsc) not detecting the correct java version to compile for.
This commit is contained in:
		
							parent
							
								
									a126c7916a
								
							
						
					
					
						commit
						ad0752fe78
					
				@ -3,6 +3,9 @@ plugins {
 | 
				
			|||||||
	id 'maven-publish'
 | 
						id 'maven-publish'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sourceCompatibility = JavaVersion.VERSION_1_8
 | 
				
			||||||
 | 
					targetCompatibility = JavaVersion.VERSION_1_8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
archivesBaseName = project.archives_base_name
 | 
					archivesBaseName = project.archives_base_name
 | 
				
			||||||
version = project.mod_version
 | 
					version = project.mod_version
 | 
				
			||||||
group = project.maven_group
 | 
					group = project.maven_group
 | 
				
			||||||
@ -41,9 +44,6 @@ tasks.withType(JavaCompile).configureEach {
 | 
				
			|||||||
	def targetVersion = 8
 | 
						def targetVersion = 8
 | 
				
			||||||
	if (JavaVersion.current().isJava9Compatible()) {
 | 
						if (JavaVersion.current().isJava9Compatible()) {
 | 
				
			||||||
		 it.options.release = targetVersion
 | 
							 it.options.release = targetVersion
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		 it.sourceCompatibility = JavaVersion.toVersion(targetVersion)
 | 
					 | 
				
			||||||
		 it.targetCompatibility = JavaVersion.toVersion(targetVersion)
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user