-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
154 lines (130 loc) · 4.57 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
buildscript {
repositories {
// maven { url = 'https://files.minecraftforge.net/maven' }
maven { url = 'https://maven.minecraftforge.net/' }
// jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
//Magic 1.17 port plugin
//apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'
version = "$mc_version-$mod_version"
group = "mod.technomancer.essentials"
archivesBaseName = "essentials"
//compileJava.options.encoding = 'UTF-8'
//Exclude python scripts from the build
sourceSets.main.java.exclude('**/python/**')
//tasks.withType(JavaCompile) {
// options.encoding = 'UTF-8'
//}
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '17' // Need this here so eclipse task generates correctly.
minecraft {
mappings channel: "$mcp_channel", version: "$mcp_version"
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
// Make patchouli work
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
essentials {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
// Make patchouli work
properties 'mixin.env.disableRefMap': 'true'
mods {
essentials {
source sourceSets.main
}
}
}
}
}
repositories {
// maven { url "https://dvs1.progwml6.com/files/maven" } //JEI
maven { url "https://maven.blamejared.com" } //Patchouli, JEI
maven { url "https://squiddev.cc/maven/" } //CC Tweaked
}
dependencies {
minecraft "net.minecraftforge:forge:$mc_version-$fg_version"
//JEI
//Compile against APIs
compileOnly fg.deobf("mezz.jei:jei-$jei_mc_version-common-api:$jei_version")
compileOnly fg.deobf("mezz.jei:jei-$jei_mc_version-forge-api:$jei_version")
//Run with the full versions
runtimeOnly fg.deobf("mezz.jei:jei-$jei_mc_version-forge:$jei_version")
//Patchouli
compileOnly(fg.deobf("vazkii.patchouli:Patchouli:$patchouli_version-FORGE"))
runtimeOnly(fg.deobf("vazkii.patchouli:Patchouli:$patchouli_version-FORGE"))
//CC Tweaked
// compileOnly(fg.deobf("org.squiddev:cc-tweaked-${mc_version}:${cctweaked_version}"))
// runtimeOnly(fg.deobf("org.squiddev:cc-tweaked-${mc_version}:${cctweaked_version}"))
compileOnly("cc.tweaked:cc-tweaked-${mc_version}-core-api:${cctweaked_version}")
compileOnly(fg.deobf("cc.tweaked:cc-tweaked-${mc_version}-forge-api:${cctweaked_version}"))
// runtimeOnly(fg.deobf("cc.tweaked:cc-tweaked-${mc_version}-forge:${cctweaked_version}"))
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "essentials",
"Specification-Vendor": "Technomancer",
"Specification-Version": "1",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"Technomancer",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
//Compile the sources into a jar- useful for addon development
task jarSources(type: Jar){
from sourceSets.main.allSource
// classifier = 'source'
archiveClassifier.set('source')
}
task jarDev(type: Jar) {
from sourceSets.main.output
// classifier = 'dev'
archiveClassifier.set('dev')
}
//// Example configuration to allow publishing using the maven-publish task
//// we define a custom artifact that is sourced from the reobfJar output task
//// and then declare that to be published
//// Note you'll need to add a repository here
//def reobfFile = file("$buildDir/reobfJar/output.jar")
//def reobfArtifact = artifacts.add('default', reobfFile) {
// type 'jar'
// builtBy 'reobfJar'
//}
//publishing {
// publications {
// mavenJava(MavenPublication) {
// artifact reobfArtifact
// }
// }
// repositories {
// maven {
// url "file:///${project.projectDir}/mcmodsrepo"
// }
// }
//}