Skip to content

Instantly share code, notes, and snippets.

@axieum
Created November 18, 2019 12:10
Show Gist options
  • Save axieum/3a92e67fc8c767cc3fdb094fd0514378 to your computer and use it in GitHub Desktop.
Save axieum/3a92e67fc8c767cc3fdb094fd0514378 to your computer and use it in GitHub Desktop.
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
version = "${MOD_VERSION_MAJOR}.${MOD_VERSION_MINOR}.${MOD_VERSION_REVIS}"
group = "${MOD_CLASS}.${MOD_ID}"
archivesBaseName = "${MOD_ID}-${MINECRAFT_VERSION}"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
minecraft {
mappings channel: "${MAPPINGS_CHANNEL}", version: "${MAPPINGS_VERSION}"
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
"${MOD_ID}" {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
"${MOD_ID}" {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
mods {
"${MOD_ID}" {
source sourceSets.main
}
}
}
}
}
configurations {
shade
compile.extendsFrom shade
}
dependencies {
minecraft "net.minecraftforge:forge:${FORGE_VERSION}"
compile "org.apache.commons:commons-lang3:${LANG3_VERSION}"
shade "net.dv8tion:JDA:${JDA_VERSION}"
shade "com.vdurmont:emoji-java:${EMOJI_JAVA_VERSION}"
}
repositories {
jcenter()
mavenCentral()
}
jar {
configurations.shade.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
manifest {
attributes([
"Specification-Title" : "${MOD_ID}",
"Specification-Vendor" : "${MOD_GROUP}",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "${MOD_GROUP}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment