build.gradle 3.08 KB
Newer Older
Adrian Siekierka committed
1
plugins {
2
	id 'fabric-loom' version '1.6.5'
UpcraftLP committed
3
	id 'maven-publish'
Adrian Siekierka committed
4 5
}

6
version = "${project.mod_version}+${project.minecraft_version}"
UpcraftLP committed
7
group = project.maven_group
Adrian Siekierka committed
8

modmuss committed
9 10 11 12
base {
	archivesName = project.archives_base_name
}

13
repositories {
14 15 16 17 18
	// Add repositories to retrieve artifacts from in here.
	// You should only use this when depending on other mods because
	// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
	// See https://docs.gradle.org/current/userguide/declaring_repositories.html
	// for more information about repositories.
19 20
}

modmuss committed
21
loom {
22
	accessWidenerPath = file("src/main/resources/creaturechat.accesswidener")
modmuss committed
23 24
    splitEnvironmentSourceSets()

25
	mods {
26
		"creaturechat" {
27 28 29 30
			sourceSet sourceSets.main
			sourceSet sourceSets.client
		}
	}
modmuss committed
31 32 33

}

asie committed
34
dependencies {
35
	// To change the versions see the gradle.properties file
36
	minecraft "com.mojang:minecraft:${project.minecraft_version}"
37
	mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
38
	modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
39 40

	// Fabric API. This is technically optional, but you probably want it anyway.
41
	modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modmuss committed
42
	
modmuss50 committed
43 44 45
	// Uncomment the following line to enable the deprecated Fabric API modules. 
	// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
	// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
46 47 48 49 50 51 52 53 54 55 56 57 58

	// Test module dependencies
	testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
	testImplementation 'org.apache.commons:commons-lang3:3.12.0'
	testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
	testImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
	testImplementation 'com.google.code.gson:gson:2.8.8'
	testImplementation 'org.slf4j:slf4j-api:1.7.32'
	testImplementation 'ch.qos.logback:logback-classic:1.2.6'
}

test {
	useJUnitPlatform()
Adrian Siekierka committed
59
}
Adrian Siekierka committed
60

61 62 63
processResources {
	inputs.property "version", project.version

64
	filesMatching("fabric.mod.json") {
65 66 67 68
		expand "version": project.version
	}
}

69
tasks.withType(JavaCompile).configureEach {
modmuss50 committed
70
	it.options.release = 17
71 72
}

73 74 75 76 77
java {
	// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
	// if it is present.
	// If you remove this line, sources will not be generated.
	withSourcesJar()
78 79 80

	sourceCompatibility = JavaVersion.VERSION_17
	targetCompatibility = JavaVersion.VERSION_17
Adrian Siekierka committed
81
}
82 83

jar {
84
	from("LICENSE") {
85
		rename { "${it}_${project.base.archivesName.get()}"}
86
	}
87 88 89 90
}

// configure the maven publication
publishing {
UpcraftLP committed
91 92
	publications {
		mavenJava(MavenPublication) {
modmuss50 committed
93
			from components.java
UpcraftLP committed
94 95
		}
	}
96 97 98 99 100 101 102 103

	// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
	repositories {
		// Add repositories to publish to here.
		// Notice: This block does NOT have the same function as the block in the top level.
		// The repositories here will be used for publishing your artifact, not for
		// retrieving dependencies.
	}
modmuss50 committed
104
}