11plugins {
2- id ' fabric-loom' version " 0.7 -SNAPSHOT" // To use chocoloom, change the version to a commit hash
3- id ' maven-publish '
4- id ' org.ajoberstar.grgit ' version ' 4.1.0 '
2+ id " fabric-loom" version " 1.10 -SNAPSHOT"
3+ id " legacy-looming " version " 1.10-SNAPSHOT "
4+ id " maven-publish "
55}
66
7- sourceCompatibility = JavaVersion . VERSION_1_8
8- targetCompatibility = JavaVersion . VERSION_1_8
7+ version = " $m od_version + $t arget_version "
8+ group = maven_group
99
10- def getVersionMetadata () {
11- // CI builds version numbers
12- def build_id = System . getenv(" RELEASE_NUMBER" )
13- if (build_id != null ) {
14- return build_id + " .0.0"
15- }
16-
17- // Development builds
18- if (grgit == null ) {
19- return " dev"
20- }
21-
22- // Named development builds
23- def id = grgit. head(). abbreviatedId
24- if (! grgit. status(). clean) {
25- id + = " -dirty"
26- }
27-
28- return " rev.${ id} "
10+ base {
11+ archivesName = archives_name
2912}
3013
31- archivesBaseName = " ${ project.mod_id} -${ project.minecraft_version} "
32- version = " ${ getVersionMetadata()} "
33- group = project. maven_group
34-
35- repositories {
36- maven {
37- name = " legacy-fabric"
38- url = " https://maven.legacyfabric.net"
14+ loom {
15+ decompilers {
16+ vineflower {
17+ options. putAll([" mark-corresponding-synthetics" : " 1" , " indent-string" : " " ])
18+ }
3919 }
40- }
41-
42- // Comment out this block if you're using Chocoloom
43- // Comment when using loom 0.10
44- minecraft {
45- intermediaryUrl = {
46- return " https://maven.legacyfabric.net/net/fabricmc/intermediary/" + it + " /intermediary-" + it + " -v2.jar" ;
20+ mixin {
21+ useLegacyMixinAp = false
4722 }
4823}
4924
5025dependencies {
51- minecraft " com.mojang:minecraft:${ project.minecraft_version} "
52- mappings " net.fabricmc:yarn:${ project.yarn_mappings} :v2"
53- modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
54-
55- // Fabric API provides hooks for events, item registration, and more. As most mods will need this, it's included by default.
56- // If you know for a fact you don't, it's not required and can be safely removed.
57- // modImplementation ("net.legacyfabric.legacy-fabric-api:legacy-fabric-api:${fabric_version}") {
58- // exclude module: "fabric-loader-1.8.9"
59- // }
60-
61- // Hacks that make mac os work
62- if (System . getProperty(" os.name" ). toLowerCase(). contains(" mac" )) {
63- implementation ' org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209'
64- implementation ' org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209'
65- implementation ' org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209'
66- }
67- }
68-
69- // More hacks that make mac os work
70- if (System . getProperty(" os.name" ). toLowerCase(). contains(" mac" )) {
71- configurations. all {
72- resolutionStrategy {
73- dependencySubstitution {
74- substitute module(' org.lwjgl.lwjgl:lwjgl_util:2.9.2-nightly-201408222' ) with module(' org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209' )
75- substitute module(' org.lwjgl.lwjgl:lwjgl:2.9.2-nightly-201408222' ) with module(' org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209' )
76- }
77- force ' org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209'
78- }
79- }
26+ minecraft " com.mojang:minecraft:$minecraft_version "
27+ mappings legacy. yarn(minecraft_version, yarn_build)
28+ modImplementation " net.fabricmc:fabric-loader:$loader_version "
8029}
8130
8231processResources {
83- inputs. property " mod_id" , project. mod_id
84- inputs. property " version" , project. version
85-
86- filesMatching(" fabric.mod.json" ) {
87- expand " mod_id" : project. mod_id, " version" : project. version
32+ filesMatching " fabric.mod.json" , {
33+ expand " version" : version
8834 }
8935}
9036
91- // ensure that the encoding is set to UTF-8, no matter what the system default is
92- // this fixes some edge cases with special characters not displaying correctly
93- // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
9437tasks. withType(JavaCompile ). configureEach {
9538 it. options. encoding = " UTF-8"
96- if ( JavaVersion . current() . isJava9Compatible()) it. options. release = 8
39+ it. options. release. set( 8 )
9740}
9841
9942java {
100- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
101- // if it is present.
102- // If you remove this line, sources will not be generated.
43+ sourceCompatibility = targetCompatibility = JavaVersion . VERSION_1_8
10344 withSourcesJar()
10445}
10546
10647jar {
107- from(" LICENSE" ) {
108- rename { " ${ it} _${ project.archivesBaseName} " }
109- }
48+ from " LICENSE"
11049}
111-
112- // configure the maven publication
113- publishing {
114- publications {
115- mavenJava(MavenPublication ) {
116- from components. java
117- }
118- }
119-
120- // select the repositories you want to publish to
121- repositories {
122- // uncomment to publish to the local maven
123- // mavenLocal()
124- }
125- }
0 commit comments