Skip to content

Commit 93deb38

Browse files
author
phit
committed
rough port to 1.14
1 parent 979b620 commit 93deb38

14 files changed

Lines changed: 365 additions & 268 deletions

build.gradle

Lines changed: 132 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,149 @@
11
buildscript {
22
repositories {
3+
maven { url = 'https://files.minecraftforge.net/maven' }
34
jcenter()
4-
maven { url = "http://files.minecraftforge.net/maven" }
5+
mavenCentral()
56
}
67
dependencies {
7-
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
8+
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
89
}
910
}
11+
apply plugin: 'net.minecraftforge.gradle'
12+
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
13+
apply plugin: 'eclipse'
14+
apply plugin: 'maven-publish'
1015

11-
apply plugin: 'net.minecraftforge.gradle.forge'
16+
version = '1.0'
17+
group = 'simpleircbridge' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
18+
archivesBaseName = 'simpleircbridge'
1219

13-
version = "1.12.2_1.2.0"
14-
group = "simpleircbridge"
15-
archivesBaseName = "SimpleIRCBridge"
20+
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
1621

17-
sourceCompatibility = targetCompatibility = '1.8'
18-
compileJava {
19-
sourceCompatibility = targetCompatibility = '1.8'
22+
minecraft {
23+
// The mappings can be changed at any time, and must be in the following format.
24+
// snapshot_YYYYMMDD Snapshot are built nightly.
25+
// stable_# Stables are built at the discretion of the MCP team.
26+
// Use non-default mappings at your own risk. they may not always work.
27+
// Simply re-run your setup task after changing the mappings to update your workspace.
28+
mappings channel: 'snapshot', version: '20190719-1.14.3'
29+
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
30+
31+
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
32+
33+
// Default run configurations.
34+
// These can be tweaked, removed, or duplicated as needed.
35+
runs {
36+
client {
37+
workingDirectory project.file('run')
38+
39+
// Recommended logging data for a userdev environment
40+
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
41+
42+
// Recommended logging level for the console
43+
property 'forge.logging.console.level', 'debug'
44+
45+
mods {
46+
examplemod {
47+
source sourceSets.main
48+
}
49+
}
50+
}
51+
52+
server {
53+
workingDirectory project.file('run')
54+
55+
// Recommended logging data for a userdev environment
56+
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
57+
58+
// Recommended logging level for the console
59+
property 'forge.logging.console.level', 'debug'
60+
61+
mods {
62+
examplemod {
63+
source sourceSets.main
64+
}
65+
}
66+
}
67+
68+
data {
69+
workingDirectory project.file('run')
70+
71+
// Recommended logging data for a userdev environment
72+
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
73+
74+
// Recommended logging level for the console
75+
property 'forge.logging.console.level', 'debug'
76+
77+
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
78+
79+
mods {
80+
examplemod {
81+
source sourceSets.main
82+
}
83+
}
84+
}
85+
}
2086
}
2187

22-
minecraft {
23-
version = "1.12.2-14.23.1.2555"
24-
runDir = "run"
25-
mappings = "snapshot_20171003"
88+
dependencies {
89+
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
90+
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
91+
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
92+
minecraft 'net.minecraftforge:forge:1.14.4-28.0.49'
93+
94+
// You may put jars on which you depend on in ./libs or you may define them like so..
95+
// compile "some.group:artifact:version:classifier"
96+
// compile "some.group:artifact:version"
97+
98+
// Real examples
99+
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
100+
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
101+
102+
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
103+
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
104+
105+
// These dependencies get remapped to your current MCP mappings
106+
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
107+
108+
// For more info...
109+
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
110+
// http://www.gradle.org/docs/current/userguide/dependency_management.html
111+
26112
}
27113

28-
processResources {
29-
inputs.property "version", project.version
30-
inputs.property "mcversion", project.minecraft.version
114+
// Example for how to get properties into the manifest for reading by the runtime..
115+
jar {
116+
manifest {
117+
attributes([
118+
"Specification-Title": "simpleircbridge",
119+
"Specification-Vendor": "simpleircbridge",
120+
"Specification-Version": "1", // We are version 1 of ourselves
121+
"Implementation-Title": project.name,
122+
"Implementation-Version": "${version}",
123+
"Implementation-Vendor" :"simpleircbridge",
124+
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
125+
])
126+
}
127+
}
31128

32-
from(sourceSets.main.resources.srcDirs) {
33-
include 'mcmod.info'
34-
expand 'version':project.version, 'mcversion':project.minecraft.version
129+
// Example configuration to allow publishing using the maven-publish task
130+
// we define a custom artifact that is sourced from the reobfJar output task
131+
// and then declare that to be published
132+
// Note you'll need to add a repository here
133+
def reobfFile = file("$buildDir/reobfJar/output.jar")
134+
def reobfArtifact = artifacts.add('default', reobfFile) {
135+
type 'jar'
136+
builtBy 'reobfJar'
137+
}
138+
publishing {
139+
publications {
140+
mavenJava(MavenPublication) {
141+
artifact reobfArtifact
142+
}
35143
}
36-
37-
from(sourceSets.main.resources.srcDirs) {
38-
exclude 'mcmod.info'
144+
repositories {
145+
maven {
146+
url "file:///${project.projectDir}/mcmodsrepo"
147+
}
39148
}
40-
}
149+
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
22
# This is required to provide enough memory for the Minecraft decompilation process.
33
org.gradle.jvmargs=-Xmx3G
4+
org.gradle.daemon=false

gradle/wrapper/gradle-wrapper.jar

2.38 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Mon Sep 14 12:28:28 PDT 2015
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip

gradlew

Lines changed: 43 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 4 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)