mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-30 21:23:00 +00:00 
			
		
		
		
	 f881c0ced0
			
		
	
	f881c0ced0
	
	
	
		
			
			Okay, listen. I started writing a few more gametests (see #1682), and
then thought I'd do a cheeky Gradle update. However, that broke
vanilla-extract[^1], and also triggered a load of deprecation warnings,
and at that point it was too late to separate the too.
[^1]: 8975ed5a7b
		
	
		
			
				
	
	
		
			54 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			54 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| // SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers
 | |
| //
 | |
| // SPDX-License-Identifier: MPL-2.0
 | |
| 
 | |
| plugins {
 | |
|     id("cc-tweaked.java-convention")
 | |
|     application
 | |
| }
 | |
| 
 | |
| val lwjglNatives = Unit.run {
 | |
|     val name = System.getProperty("os.name")!!
 | |
|     val arch = System.getProperty("os.arch")
 | |
|     when {
 | |
|         arrayOf("Linux", "FreeBSD", "SunOS", "Unit").any { name.startsWith(it) } -> when {
 | |
|             arrayOf("arm", "aarch64").any { arch.startsWith(it) } -> "natives-linux${if (arch.contains("64") || arch.startsWith("armv8")) "-arm64" else "-arm32"}"
 | |
|             else -> "natives-linux"
 | |
|         }
 | |
| 
 | |
|         arrayOf("Mac OS X", "Darwin").any { name.startsWith(it) } ->
 | |
|             "natives-macos${if (arch.startsWith("aarch64")) "-arm64" else ""}"
 | |
| 
 | |
|         arrayOf("Windows").any { name.startsWith(it) } -> when {
 | |
|             arch.contains("64") -> "natives-windows${if (arch.startsWith("aarch64")) "-arm64" else ""}"
 | |
|             else -> "natives-windows-x86"
 | |
|         }
 | |
| 
 | |
|         else -> throw GradleException("Unrecognized or unsupported platform.")
 | |
|     }
 | |
| }
 | |
| 
 | |
| dependencies {
 | |
|     implementation(project(":core"))
 | |
|     implementation(libs.commonsCli)
 | |
|     implementation(libs.slf4j)
 | |
|     runtimeOnly(libs.slf4j.simple)
 | |
| 
 | |
|     implementation(platform(libs.lwjgl.bom))
 | |
|     implementation(libs.lwjgl.core)
 | |
|     implementation(libs.lwjgl.glfw)
 | |
|     implementation(libs.lwjgl.opengl)
 | |
|     runtimeOnly(variantOf(libs.lwjgl.core) { classifier(lwjglNatives) })
 | |
|     runtimeOnly(variantOf(libs.lwjgl.glfw) { classifier(lwjglNatives) })
 | |
|     runtimeOnly(variantOf(libs.lwjgl.opengl) { classifier(lwjglNatives) })
 | |
| }
 | |
| 
 | |
| application {
 | |
|     mainClass = "cc.tweaked.standalone.Main"
 | |
| }
 | |
| 
 | |
| tasks.named("run", JavaExec::class.java) {
 | |
|     workingDir = rootProject.projectDir
 | |
|     args = listOf("-r", project(":core").layout.projectDirectory.dir("src/main/resources").asFile.absolutePath)
 | |
| }
 |