plugins {
	id "net.fabricmc.fabric-loom" version "${loom_version}"
	id "maven-publish"
}

version = project.mod_version
group = project.maven_group

repositories {
}

loom {
	splitEnvironmentSourceSets()

	mods {
		"spiderman" {
			sourceSet sourceSets.main
			sourceSet sourceSets.client
		}
	}
}

dependencies {
	minecraft "com.mojang:minecraft:${project.minecraft_version}"
	implementation "net.fabricmc:fabric-loader:${project.loader_version}"
	implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
}

processResources {
	def version = project.version
	inputs.property "version", version

	filesMatching("fabric.mod.json") {
		expand "version": version
	}
}

tasks.withType(JavaCompile).configureEach {
	it.options.release = 25
}

java {
	withSourcesJar()

	sourceCompatibility = JavaVersion.VERSION_25
	targetCompatibility = JavaVersion.VERSION_25
}

jar {
	def projectName = project.name
	inputs.property "projectName", projectName

	from("../../license.txt") {
		rename { "${it}_${projectName}" }
	}
}

publishing {
	publications {
		create("mavenJava", MavenPublication) {
			from components.java
		}
	}

	repositories {
	}
}
