|
@@ -1,134 +1,51 @@
|
|
|
plugins {
|
|
|
- id 'fabric-loom' version '0.5-SNAPSHOT'
|
|
|
- id 'com.github.johnrengelman.shadow' version '6.1.0'
|
|
|
- id 'maven-publish'
|
|
|
+ id 'fabric-loom' version '0.5-SNAPSHOT' apply false
|
|
|
}
|
|
|
|
|
|
-sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
-targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
+subprojects {
|
|
|
+ apply plugin: "fabric-loom"
|
|
|
|
|
|
-archivesBaseName = project.archives_base_name
|
|
|
-version = project.mod_version
|
|
|
-group = project.maven_group
|
|
|
+ sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
+ targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
|
|
-sourceSets {
|
|
|
- testMod {
|
|
|
- compileClasspath += main.compileClasspath
|
|
|
- runtimeClasspath += main.runtimeClasspath
|
|
|
- annotationProcessorPath += main.annotationProcessorPath
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-repositories {
|
|
|
- maven {
|
|
|
- url "https://maven.shedaniel.me/"
|
|
|
- }
|
|
|
- maven {
|
|
|
- url "https://maven.terraformersmc.com/"
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-dependencies {
|
|
|
- // --- Main ---
|
|
|
- minecraft("com.mojang:minecraft:${project.minecraft_version}")
|
|
|
- mappings("net.fabricmc:yarn:${project.yarn_mappings}:v2")
|
|
|
- modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
|
|
|
-
|
|
|
- modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
|
|
|
- exclude(group: "net.fabricmc.fabric-api")
|
|
|
- }
|
|
|
-
|
|
|
- // Using modApi because api does not include dependency inside Maven pom file (see https://github.com/FabricMC/fabric-loom/issues/200)
|
|
|
- modApi("org.spongepowered:configurate-hocon:${project.configurate_version}")
|
|
|
- shadow("org.spongepowered:configurate-hocon:${project.configurate_version}")
|
|
|
+ group = rootProject.maven_group
|
|
|
+ archivesBaseName = "${rootProject.archives_base_name}-${project.name}"
|
|
|
+ version = rootProject.mod_version
|
|
|
|
|
|
- compileOnly("org.projectlombok:lombok:${project.lombok_version}")
|
|
|
- annotationProcessor("org.projectlombok:lombok:${project.lombok_version}")
|
|
|
+ processResources {
|
|
|
+ inputs.property "version", project.version
|
|
|
|
|
|
- // --- Test ---
|
|
|
- testImplementation("org.junit.jupiter:junit-jupiter:${project.junit_version}")
|
|
|
- testImplementation("org.assertj:assertj-core:${project.assertj_version}")
|
|
|
- testImplementation("org.mockito:mockito-inline:${project.mockito_version}")
|
|
|
- testImplementation("org.mockito:mockito-junit-jupiter:${project.mockito_junit_version}")
|
|
|
- testImplementation("io.github.hakky54:logcaptor:${project.logcaptor_version}")
|
|
|
- testImplementation("com.google.jimfs:jimfs:${project.jimfs_version}")
|
|
|
+ filesMatching("fabric.mod.json") {
|
|
|
+ expand "version": project.version
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- // --- Test Mod ---
|
|
|
- testModImplementation(sourceSets.main.output)
|
|
|
- modImplementation("com.terraformersmc:modmenu:${project.modmenu_version}")
|
|
|
-}
|
|
|
-
|
|
|
-processResources {
|
|
|
- inputs.property "version", project.version
|
|
|
-
|
|
|
- filesMatching("fabric.mod.json") {
|
|
|
- expand "version": project.version
|
|
|
- }
|
|
|
-}
|
|
|
+ tasks.withType(JavaCompile).configureEach {
|
|
|
+ // ensure that the encoding is set to UTF-8, no matter what the system default is
|
|
|
+ // this fixes some edge cases with special characters not displaying correctly
|
|
|
+ // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
|
|
+ it.options.encoding = "UTF-8"
|
|
|
+ }
|
|
|
|
|
|
-tasks.withType(JavaCompile).configureEach {
|
|
|
- // ensure that the encoding is set to UTF-8, no matter what the system default is
|
|
|
- // this fixes some edge cases with special characters not displaying correctly
|
|
|
- // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
|
|
- it.options.encoding = "UTF-8"
|
|
|
-}
|
|
|
+ repositories {
|
|
|
+ maven {
|
|
|
+ url "https://maven.shedaniel.me/"
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-java {
|
|
|
- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
|
|
- // if it is present.
|
|
|
- withSourcesJar()
|
|
|
-}
|
|
|
+ dependencies {
|
|
|
+ minecraft("com.mojang:minecraft:${rootProject.minecraft_version}")
|
|
|
+ mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2")
|
|
|
+ modImplementation("net.fabricmc:fabric-loader:${rootProject.loader_version}")
|
|
|
|
|
|
-jar {
|
|
|
- from "LICENSE"
|
|
|
-}
|
|
|
-
|
|
|
-shadowJar {
|
|
|
- configurations = [project.configurations.shadow]
|
|
|
- archiveClassifier = "shadow"
|
|
|
-}
|
|
|
-
|
|
|
-remapJar {
|
|
|
- dependsOn(shadowJar)
|
|
|
- input.set(shadowJar.archiveFile)
|
|
|
-}
|
|
|
-
|
|
|
-test {
|
|
|
- useJUnitPlatform()
|
|
|
-}
|
|
|
-
|
|
|
-javadoc {
|
|
|
- options {
|
|
|
- source = "8"
|
|
|
- encoding = "UTF-8"
|
|
|
- charSet = "UTF-8"
|
|
|
- memberLevel = JavadocMemberLevel.PROTECTED
|
|
|
- // Disable the crazy super-strict doclint tool in Java 8
|
|
|
- addStringOption("Xdoclint:none", "-quiet")
|
|
|
- }
|
|
|
- source = sourceSets.main.allJava
|
|
|
- failOnError false
|
|
|
-}
|
|
|
-
|
|
|
-task javadocJar(type: Jar) {
|
|
|
- dependsOn javadoc
|
|
|
- from javadoc.destinationDir
|
|
|
- archiveClassifier = "javadoc"
|
|
|
-}
|
|
|
+ modApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_version}") {
|
|
|
+ exclude(group: "net.fabricmc.fabric-api")
|
|
|
+ }
|
|
|
|
|
|
-build.dependsOn javadocJar
|
|
|
+ // Using modApi because api does not include dependency inside Maven pom file (see https://github.com/FabricMC/fabric-loom/issues/200)
|
|
|
+ modApi("org.spongepowered:configurate-hocon:${rootProject.configurate_version}")
|
|
|
|
|
|
-// configure the maven publication
|
|
|
-publishing {
|
|
|
- publications {
|
|
|
- mavenJava(MavenPublication) {
|
|
|
- artifact(remapJar) {
|
|
|
- builtBy remapJar
|
|
|
- }
|
|
|
- artifact(sourcesJar) {
|
|
|
- builtBy remapSourcesJar
|
|
|
- }
|
|
|
- artifact javadocJar
|
|
|
- }
|
|
|
- }
|
|
|
+ compileOnly("org.projectlombok:lombok:${rootProject.lombok_version}")
|
|
|
+ annotationProcessor("org.projectlombok:lombok:${rootProject.lombok_version}")
|
|
|
+ }
|
|
|
}
|