|
| 1 | +plugins { |
| 2 | + id 'fabric-loom' version '1.7.bta' |
| 3 | + id 'java' |
| 4 | +} |
| 5 | + |
| 6 | +import org.gradle.internal.os.OperatingSystem |
| 7 | + |
| 8 | +project.ext.lwjglVersion = "3.3.3" |
| 9 | + |
| 10 | +switch (OperatingSystem.current()) { |
| 11 | + case OperatingSystem.LINUX: |
| 12 | + project.ext.lwjglNatives = "natives-linux" |
| 13 | + break |
| 14 | + case OperatingSystem.WINDOWS: |
| 15 | + project.ext.lwjglNatives = "natives-windows" |
| 16 | + break |
| 17 | + case OperatingSystem.MAC_OS: |
| 18 | + project.ext.lwjglNatives = "natives-macos" |
| 19 | +} |
| 20 | + |
| 21 | +group = project.mod_group |
| 22 | +archivesBaseName = project.mod_name |
| 23 | +version = project.mod_version |
| 24 | + |
| 25 | +loom { |
| 26 | + noIntermediateMappings() |
| 27 | + customMinecraftMetadata.set("https://downloads.betterthanadventure.net/bta-client/${project.bta_channel}/v${project.bta_version}/manifest.json") |
| 28 | +} |
| 29 | + |
| 30 | +repositories { |
| 31 | + mavenCentral() |
| 32 | + maven { url = "https://jitpack.io" } |
| 33 | + maven { |
| 34 | + name = 'Babric' |
| 35 | + url = 'https://maven.glass-launcher.net/babric' |
| 36 | + } |
| 37 | + maven { |
| 38 | + name = 'Fabric' |
| 39 | + url = 'https://maven.fabricmc.net/' |
| 40 | + } |
| 41 | + maven { |
| 42 | + name = 'SignalumMavenInfrastructure' |
| 43 | + url = 'https://maven.thesignalumproject.net/infrastructure' |
| 44 | + } |
| 45 | + maven { |
| 46 | + name = 'SignalumMavenReleases' |
| 47 | + url = 'https://maven.thesignalumproject.net/releases' |
| 48 | + } |
| 49 | + ivy { |
| 50 | + url = "https://github.com/Better-than-Adventure" |
| 51 | + patternLayout { |
| 52 | + artifact "[organisation]/releases/download/v[revision]/[module].jar" |
| 53 | + m2compatible = true |
| 54 | + } |
| 55 | + metadataSources { artifact() } |
| 56 | + } |
| 57 | + ivy { |
| 58 | + url = "https://downloads.betterthanadventure.net/bta-client/${project.bta_channel}/" |
| 59 | + patternLayout { |
| 60 | + artifact "/v[revision]/client.jar" |
| 61 | + m2compatible = true |
| 62 | + } |
| 63 | + metadataSources { artifact() } |
| 64 | + } |
| 65 | + ivy { |
| 66 | + url = "https://downloads.betterthanadventure.net/bta-server/${project.bta_channel}/" |
| 67 | + patternLayout { |
| 68 | + artifact "/v[revision]/server.jar" |
| 69 | + m2compatible = true |
| 70 | + } |
| 71 | + metadataSources { artifact() } |
| 72 | + } |
| 73 | + ivy { |
| 74 | + url = "https://piston-data.mojang.com" |
| 75 | + patternLayout { |
| 76 | + artifact "v1/[organisation]/[revision]/[module].jar" |
| 77 | + m2compatible = true |
| 78 | + } |
| 79 | + metadataSources { artifact() } |
| 80 | + } |
| 81 | + |
| 82 | +} |
| 83 | + |
| 84 | +dependencies { |
| 85 | + minecraft "::${project.bta_version}" |
| 86 | + mappings loom.layered() {} |
| 87 | + |
| 88 | + modRuntimeOnly "objects:client:43db9b498cb67058d2e12d394e6507722e71bb45" // https://piston-data.mojang.com/v1/objects/43db9b498cb67058d2e12d394e6507722e71bb45/client.jar |
| 89 | + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" |
| 90 | + |
| 91 | + // Helper library |
| 92 | + // If you do not need Halplibe you can comment this line out or delete this line |
| 93 | + modImplementation("turniplabs:halplibe:${project.halplibe_version}") |
| 94 | + |
| 95 | + modImplementation("turniplabs:modmenu-bta:${project.mod_menu_version}") |
| 96 | + |
| 97 | + implementation "org.slf4j:slf4j-api:1.8.0-beta4" |
| 98 | + implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0" |
| 99 | + |
| 100 | + implementation 'com.google.guava:guava:33.0.0-jre' |
| 101 | + implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1' |
| 102 | + var log4jVersion = "2.20.0" |
| 103 | + implementation("org.apache.logging.log4j:log4j-core:${log4jVersion}") |
| 104 | + implementation("org.apache.logging.log4j:log4j-api:${log4jVersion}") |
| 105 | + implementation("org.apache.logging.log4j:log4j-1.2-api:${log4jVersion}") |
| 106 | + |
| 107 | + include(implementation("org.apache.commons:commons-lang3:3.12.0")) |
| 108 | + |
| 109 | + modImplementation("com.github.Better-than-Adventure:legacy-lwjgl3:1.0.5") |
| 110 | + implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion") |
| 111 | + |
| 112 | + runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives" |
| 113 | + runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjglNatives" |
| 114 | + runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives" |
| 115 | + runtimeOnly "org.lwjgl:lwjgl-openal::$lwjglNatives" |
| 116 | + runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives" |
| 117 | + runtimeOnly "org.lwjgl:lwjgl-stb::$lwjglNatives" |
| 118 | + implementation "org.lwjgl:lwjgl:$lwjglVersion" |
| 119 | + implementation "org.lwjgl:lwjgl-assimp:$lwjglVersion" |
| 120 | + implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion" |
| 121 | + implementation "org.lwjgl:lwjgl-openal:$lwjglVersion" |
| 122 | + implementation "org.lwjgl:lwjgl-opengl:$lwjglVersion" |
| 123 | + implementation "org.lwjgl:lwjgl-stb:$lwjglVersion" |
| 124 | +} |
| 125 | + |
| 126 | +java { |
| 127 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 128 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 129 | + withSourcesJar() |
| 130 | +} |
| 131 | + |
| 132 | +tasks.withType(JavaCompile).configureEach { |
| 133 | + options.release.set 8 |
| 134 | +} |
| 135 | + |
| 136 | +jar { |
| 137 | + from("LICENSE") { |
| 138 | + rename { "${it}_${archivesBaseName}" } |
| 139 | + } |
| 140 | +} |
| 141 | + |
| 142 | +configurations.configureEach { |
| 143 | + // Removes LWJGL2 dependencies |
| 144 | + exclude group: "org.lwjgl.lwjgl" |
| 145 | +} |
| 146 | + |
| 147 | +processResources { |
| 148 | + inputs.property "version", version |
| 149 | + |
| 150 | + filesMatching("fabric.mod.json") { |
| 151 | + expand "version": version |
| 152 | + } |
| 153 | +} |
0 commit comments