Skip to content

Instantly share code, notes, and snippets.

@Asherslab
Created June 2, 2018 05:50
Show Gist options
  • Save Asherslab/7647e60e4a1b9e6d4019641ecf076db7 to your computer and use it in GitHub Desktop.
Save Asherslab/7647e60e4a1b9e6d4019641ecf076db7 to your computer and use it in GitHub Desktop.
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
}
}
plugins {
id 'io.franzbecker.gradle-lombok' version '1.12'
id 'net.ltgt.apt' version '0.10'
id 'com.github.johnrengelman.shadow' version '2.0.4'
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: "net.minecraftforge.gradle.forge"
version = modVersion
group = modGroup
archivesBaseName = modBaseName
sourceSets {
api {
java {
srcDir 'src/api/java'
}
}
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
compileClasspath += sourceSets.api.output
}
}
minecraft {
version = project.forgeVersion
runDir = "run"
//srgExtra "PK: com/typesafe/config configurate/typesafe/config"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = project.mcpVersion
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
repositories {
ivy {
name 'Minecolonies TeamCity Repo'
ivyPattern 'http://teamcity.minecolonies.com/guestAuth/repository/download/[module]/[revision]/teamcity-ivy.xml'
artifactPattern 'http://teamcity.minecolonies.com/guestAuth/repository/download/[module]/[revision]/[artifact](.[ext])'
}
mavenCentral()
jcenter()
maven {
name 'drnaylor'
url 'http://repo.drnaylor.co.uk/artifactory/list/quickstart'
}
}
dependencies {
compile('org.jetbrains:annotations:15.0')
compile('org.projectlombok:lombok:1.16.18')
apt('org.projectlombok:lombok:1.16.18')
compile('ninja.leaping.configurate:configurate-hocon:3.3')
compile('org.java-websocket:Java-WebSocket:1.3.4')
//compile('com.google.inject:guice:4.0')
//compile('uk.co.drnaylor:quickstart-moduleloader:0.8.2')
//compile('io.github.lukehutch:fast-classpath-scanner')
compile('org:ChatChainConnect_Release:' + chatChainConnectVersion) {
artifact {
name = 'chatchainconnect-0.0.1.' + chatChainConnectVersion + '-all'
type = 'jar'
}
artifact {
name = 'chatchainconnect-0.0.1.' + chatChainConnectVersion + '-sources'
type = 'jar'
}
}
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", '1.0'
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"
// replace version and mcversion
expand "version": project.version, "mcversion": project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
}
shadowJar {
from sourceSets.api.output
from sourceSets.main.output
exclude 'dummyThing'
exclude 'META-INF'
relocate('com.typesafe.config', 'configurate.typesafe.config')
}
task apiJar(type: Jar) {
from sourceSets.api.output
classifier = 'api'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment