generated from itsmeow/BaseMod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,11 @@ | ||
buildscript { | ||
repositories { | ||
maven { | ||
url = "https://plugins.gradle.org/m2/" | ||
} | ||
maven { | ||
url = 'https://files.minecraftforge.net/maven' | ||
} | ||
mavenCentral() | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true | ||
} | ||
} | ||
apply plugin: net.minecraftforge.gradle.mcp.MCPPlugin | ||
apply plugin: net.minecraftforge.gradle.userdev.UserDevPlugin | ||
apply plugin: 'eclipse' | ||
version = "${project.mc_version}-${project.mod_version}" | ||
group = "${project.maven_group}" | ||
archivesBaseName = "${project.mod_id}" | ||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' | ||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
apply from: 'https://maven.itsmeow.dev/scripts/fg3.gradle' | ||
apply from: 'https://maven.itsmeow.dev/scripts/imdlib.gradle' | ||
repositories { | ||
flatDir { | ||
dirs 'libs' | ||
} | ||
maven { | ||
name = "itsmeow maven" | ||
url = "https://maven.itsmeow.dev/" | ||
} | ||
maven { | ||
url = "https://maven.theillusivec4.top/" | ||
} | ||
} | ||
minecraft { | ||
mappings channel: project.mappings_channel, version: "${project.mappings_version}-${project.mappings_mc_version}" | ||
runs { | ||
client { | ||
workingDirectory project.file('run') | ||
property 'forge.logging.console.level', 'info' | ||
mods.create("${project.mod_id}").source(sourceSets.main); | ||
} | ||
server { | ||
workingDirectory project.file('run') | ||
property 'forge.logging.console.level', 'info' | ||
mods.create("${project.mod_id}").source(sourceSets.main); | ||
} | ||
} | ||
} | ||
dependencies { | ||
minecraft "net.minecraftforge:forge:${project.mc_version}-${project.forge_version}" | ||
runtimeOnly fg.deobf("top.theillusivec4.curios:curios:FORGE-${curios_version}") | ||
compileOnly fg.deobf("top.theillusivec4.curios:curios:FORGE-${curios_version}:api") | ||
} | ||
jar { | ||
manifest { | ||
mainAttributes( | ||
"Maven-Artifact": "${project.maven_group}:${project.archivesBaseName}:${project.version}", | ||
"Specification-Title": archivesBaseName, | ||
"Specification-Vendor": "its_meow", | ||
"Specification-Version": "1", | ||
"Implementation-Title": archivesBaseName, | ||
"Implementation-Version": "${project.mod_version}", | ||
"Implementation-Vendor": "its_meow", | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), | ||
"Built-On-Java": "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", | ||
"Built-On": "${project.mc_version}-${project.forge_version}" | ||
) | ||
} | ||
} | ||
task sourceJar(type: Jar, dependsOn: classes) { | ||
description = 'Creates a JAR containing the source code.' | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
manifest { | ||
mainAttributes( | ||
"Maven-Artifact": "${project.maven_group}:${project.archivesBaseName}:${project.version}", | ||
"Specification-Title": archivesBaseName, | ||
"Specification-Vendor": "its_meow", | ||
"Specification-Version": "1", | ||
"Implementation-Title": archivesBaseName + '-sources', | ||
"Implementation-Version": "${project.mod_version}", | ||
"Implementation-Vendor": "its_meow", | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), | ||
"Built-On-Java": "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", | ||
"Built-On": "${project.mc_version}-${project.forge_version}" | ||
) | ||
} | ||
} | ||
apply from: 'https://maven.itsmeow.dev/scripts/maven.gradle' | ||
import groovy.json.JsonSlurper | ||
import groovy.json.JsonOutput | ||
processResources { | ||
doLast { | ||
def jsonMinifyStart = System.currentTimeMillis() | ||
def jsonMinified = 0 | ||
def jsonBytesSaved = 0 | ||
fileTree(dir: outputs.files.asPath, include: '**/*.json').each { | ||
File file = it | ||
jsonMinified++ | ||
def oldLength = file.length() | ||
file.text = JsonOutput.toJson(new JsonSlurper().parse(file)) | ||
jsonBytesSaved += oldLength - file.length() | ||
} | ||
println('Minified ' + jsonMinified + ' json files. Saved ' + jsonBytesSaved + ' bytes. Took ' + (System.currentTimeMillis() - jsonMinifyStart) + 'ms.') | ||
} | ||
} | ||
apply from: 'https://maven.itsmeow.dev/scripts/imdlib.gradle' | ||
} |