Skip to content

Commit

Permalink
Updated gradle script (might help with #376)
Browse files Browse the repository at this point in the history
  • Loading branch information
quiqueck committed Jan 19, 2022
1 parent 5d765d3 commit 2892e6f
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ buildscript {
}

plugins {
id 'idea'
id 'eclipse'
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
}
Expand Down Expand Up @@ -86,24 +84,19 @@ def useApi(String dep) {
}

processResources {
inputs.property "version", project.version
duplicatesStrategy = 'WARN'

from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}

from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
println "Version: ${project.version}"
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

// 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
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
it.options.release = 17
}

javadoc {
Expand All @@ -123,6 +116,13 @@ task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}

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()
}

jar {
from "LICENSE"
}
Expand Down Expand Up @@ -159,21 +159,21 @@ task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
}

// configure the maven publication
//publishing {
// publications {
// mavenJava(MavenPublication) {
// artifact(remapJar) {
// builtBy remapJar
// }
// artifact(sourcesJar) {
// builtBy remapSourcesJar
// }
// }
// }
//
// // select the repositories you want to publish to
// repositories {
// // uncomment to publish to the local maven
// // mavenLocal()
// }
//}
publishing {
publications {
mavenJava(MavenPublication) {
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}

0 comments on commit 2892e6f

Please sign in to comment.