Run tests against gradle 7 and fail on deprecation. Fix gradle 8 support again.
This commit is contained in:
		
							parent
							
								
									2070aeb94a
								
							
						
					
					
						commit
						46957df360
					
				
					 9 changed files with 28 additions and 15 deletions
				
			
		
							
								
								
									
										14
									
								
								.github/workflows/test-push.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/test-push.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -4,7 +4,7 @@ jobs: | ||||||
|   gradle: |   gradle: | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         gradle: [4.9, 4.10.2, 6.8.0] |         gradle: [4.9, 4.10.2, 6.8.2] | ||||||
|         java: [jdk8, jdk11, jdk15] |         java: [jdk8, jdk11, jdk15] | ||||||
|         exclude: # Dont run older gradle versions on newer java |         exclude: # Dont run older gradle versions on newer java | ||||||
|           - java: jdk15 |           - java: jdk15 | ||||||
|  | @ -23,3 +23,15 @@ jobs: | ||||||
|       - uses: actions/checkout@v1 |       - uses: actions/checkout@v1 | ||||||
|       - uses: gradle/wrapper-validation-action@v1 |       - uses: gradle/wrapper-validation-action@v1 | ||||||
|       - run: gradle build check test --stacktrace |       - run: gradle build check test --stacktrace | ||||||
|  | 
 | ||||||
|  |   gradle_pre_release: | ||||||
|  |     runs-on: ubuntu-20.04 | ||||||
|  |     container: | ||||||
|  |       image: openjdk:8-jdk | ||||||
|  |       options: --user root | ||||||
|  |     steps: | ||||||
|  |       - uses: actions/checkout@v1 | ||||||
|  |       - run: ./gradlew wrapper --gradle-version=7.0-milestone-1 | ||||||
|  |       - run: ./gradlew build check test --stacktrace --warning-mode fail | ||||||
|  |         env: | ||||||
|  |           TEST_WARNING_MODE: fail | ||||||
							
								
								
									
										11
									
								
								build.gradle
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								build.gradle
									
									
									
									
									
								
							|  | @ -6,6 +6,7 @@ plugins { | ||||||
| 	id 'eclipse' | 	id 'eclipse' | ||||||
| 	id 'groovy' | 	id 'groovy' | ||||||
| 	id 'checkstyle' | 	id 'checkstyle' | ||||||
|  | 	id "org.cadixdev.licenser" version "0.5.0" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| sourceCompatibility = 1.8 | sourceCompatibility = 1.8 | ||||||
|  | @ -84,7 +85,7 @@ dependencies { | ||||||
| 
 | 
 | ||||||
| jar { | jar { | ||||||
| 	manifest { | 	manifest { | ||||||
| 		attributes 'Implementation-Version': version + ' Build(' + build + ')' | 		attributes 'Implementation-Version': project.version + ' Build(' + build + ')' | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -98,9 +99,9 @@ task javadocJar(type: Jar, dependsOn: javadoc) { | ||||||
| 	from javadoc.destinationDir | 	from javadoc.destinationDir | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/license.gradle' |  | ||||||
| 
 |  | ||||||
| license { | license { | ||||||
|  | 	header rootProject.file("HEADER") | ||||||
|  | 	include "**/*.java" | ||||||
| 	exclude '**/loom/util/DownloadUtil.java' | 	exclude '**/loom/util/DownloadUtil.java' | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -109,10 +110,6 @@ checkstyle { | ||||||
| 	toolVersion = '8.39' | 	toolVersion = '8.39' | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| checkstyleMain { |  | ||||||
| 	logging.setLevel(LogLevel.LIFECYCLE) |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| gradlePlugin { | gradlePlugin { | ||||||
| 	plugins { | 	plugins { | ||||||
| 		fabricLoom { | 		fabricLoom { | ||||||
|  |  | ||||||
|  | @ -81,6 +81,7 @@ public final class CompileConfiguration { | ||||||
| 
 | 
 | ||||||
| 		project.getConfigurations().maybeCreate(Constants.Configurations.MAPPINGS); | 		project.getConfigurations().maybeCreate(Constants.Configurations.MAPPINGS); | ||||||
| 		project.getConfigurations().maybeCreate(Constants.Configurations.MAPPINGS_FINAL); | 		project.getConfigurations().maybeCreate(Constants.Configurations.MAPPINGS_FINAL); | ||||||
|  | 		project.getConfigurations().maybeCreate(Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES); | ||||||
| 
 | 
 | ||||||
| 		for (RemappedConfigurationEntry entry : Constants.MOD_COMPILE_ENTRIES) { | 		for (RemappedConfigurationEntry entry : Constants.MOD_COMPILE_ENTRIES) { | ||||||
| 			Configuration compileModsConfig = project.getConfigurations().maybeCreate(entry.getSourceConfiguration()); | 			Configuration compileModsConfig = project.getConfigurations().maybeCreate(entry.getSourceConfiguration()); | ||||||
|  | @ -105,6 +106,8 @@ public final class CompileConfiguration { | ||||||
| 		extendsFrom(Constants.Configurations.MINECRAFT_NAMED, Constants.Configurations.LOADER_DEPENDENCIES, project); | 		extendsFrom(Constants.Configurations.MINECRAFT_NAMED, Constants.Configurations.LOADER_DEPENDENCIES, project); | ||||||
| 
 | 
 | ||||||
| 		extendsFrom(JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, Constants.Configurations.MAPPINGS_FINAL, project); | 		extendsFrom(JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, Constants.Configurations.MAPPINGS_FINAL, project); | ||||||
|  | 
 | ||||||
|  | 		extendsFrom(JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES, project); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
|  |  | ||||||
|  | @ -79,9 +79,9 @@ public class LaunchProvider extends DependencyProvider { | ||||||
| 		writeLog4jConfig(); | 		writeLog4jConfig(); | ||||||
| 		FileUtils.writeStringToFile(getExtension().getDevLauncherConfig(), launchConfig.asString(), StandardCharsets.UTF_8); | 		FileUtils.writeStringToFile(getExtension().getDevLauncherConfig(), launchConfig.asString(), StandardCharsets.UTF_8); | ||||||
| 
 | 
 | ||||||
| 		addDependency(Constants.Dependencies.DEV_LAUNCH_INJECTOR + Constants.Dependencies.Versions.DEV_LAUNCH_INJECTOR, JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME); | 		addDependency(Constants.Dependencies.DEV_LAUNCH_INJECTOR + Constants.Dependencies.Versions.DEV_LAUNCH_INJECTOR, Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES); | ||||||
| 		addDependency(Constants.Dependencies.TERMINAL_CONSOLE_APPENDER + Constants.Dependencies.Versions.TERMINAL_CONSOLE_APPENDER, JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME); | 		addDependency(Constants.Dependencies.TERMINAL_CONSOLE_APPENDER + Constants.Dependencies.Versions.TERMINAL_CONSOLE_APPENDER, Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES); | ||||||
| 		annotationDependency = addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, "compileOnly"); | 		annotationDependency = addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME); | ||||||
| 
 | 
 | ||||||
| 		postPopulationScheduler.accept(this::writeRemapClassPath); | 		postPopulationScheduler.accept(this::writeRemapClassPath); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -76,6 +76,7 @@ public class Constants { | ||||||
| 		public static final String MAPPINGS = "mappings"; | 		public static final String MAPPINGS = "mappings"; | ||||||
| 		public static final String MAPPINGS_FINAL = "mappingsFinal"; | 		public static final String MAPPINGS_FINAL = "mappingsFinal"; | ||||||
| 		public static final String LOADER_DEPENDENCIES = "loaderLibraries"; | 		public static final String LOADER_DEPENDENCIES = "loaderLibraries"; | ||||||
|  | 		public static final String LOOM_DEVELOPMENT_DEPENDENCIES = "loomDevelopmentDependencies"; | ||||||
| 		@Deprecated // Not to be used in gradle 7+ | 		@Deprecated // Not to be used in gradle 7+ | ||||||
| 		public static final String COMPILE = "compile"; | 		public static final String COMPILE = "compile"; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -35,7 +35,7 @@ class EmptyBuildFunctionalTest extends Specification { | ||||||
| 		when: | 		when: | ||||||
| 		def result = GradleRunner.create() | 		def result = GradleRunner.create() | ||||||
| 				.withProjectDir(testProjectDir.root) | 				.withProjectDir(testProjectDir.root) | ||||||
| 				.withArguments('build',"--stacktrace") | 				.withArguments('build',"--stacktrace", "--warning-mode", System.getenv().TEST_WARNING_MODE ?: 'all') | ||||||
| 				.withPluginClasspath() | 				.withPluginClasspath() | ||||||
| 				.forwardOutput() | 				.forwardOutput() | ||||||
| 				.build() | 				.build() | ||||||
|  |  | ||||||
|  | @ -35,7 +35,7 @@ class EmptyBuildMojangFunctionalTest extends Specification { | ||||||
| 		when: | 		when: | ||||||
| 		def result = GradleRunner.create() | 		def result = GradleRunner.create() | ||||||
| 				.withProjectDir(testProjectDir.root) | 				.withProjectDir(testProjectDir.root) | ||||||
| 				.withArguments('build',"--stacktrace") | 				.withArguments('build',"--stacktrace", "--warning-mode", System.getenv().TEST_WARNING_MODE ?: 'all') | ||||||
| 				.withPluginClasspath() | 				.withPluginClasspath() | ||||||
| 				.forwardOutput() | 				.forwardOutput() | ||||||
| 				.build() | 				.build() | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ class MixinBuildFunctionalTest extends Specification { | ||||||
| 		when: | 		when: | ||||||
| 		def result = GradleRunner.create() | 		def result = GradleRunner.create() | ||||||
| 				.withProjectDir(testProjectDir.root) | 				.withProjectDir(testProjectDir.root) | ||||||
| 				.withArguments('build','--stacktrace') | 				.withArguments('build','--stacktrace', "--warning-mode", System.getenv().TEST_WARNING_MODE ?: 'all') | ||||||
| 				.withPluginClasspath() | 				.withPluginClasspath() | ||||||
| 				.forwardOutput() | 				.forwardOutput() | ||||||
| 				.build() | 				.build() | ||||||
|  |  | ||||||
|  | @ -45,7 +45,7 @@ class SimpleBuildFunctionalTest extends Specification { | ||||||
| 		when: | 		when: | ||||||
| 		def result = GradleRunner.create() | 		def result = GradleRunner.create() | ||||||
| 				.withProjectDir(testProjectDir.root) | 				.withProjectDir(testProjectDir.root) | ||||||
| 				.withArguments('build',"--stacktrace") | 				.withArguments('build',"--stacktrace", "--warning-mode", System.getenv().TEST_WARNING_MODE ?: 'all') | ||||||
| 				.withPluginClasspath() | 				.withPluginClasspath() | ||||||
| 				.forwardOutput() | 				.forwardOutput() | ||||||
| 				.withDebug(true) | 				.withDebug(true) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue