-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
121 lines (106 loc) · 2.98 KB
/
build.gradle
File metadata and controls
121 lines (106 loc) · 2.98 KB
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
buildscript {
repositories {
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
name = "Scala CI dependencies"
url = "https://repo1.maven.org/maven2/"
}
maven {
name = "jitpack"
url = "https://jitpack.io"
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.13'
}
}
plugins {
id 'idea'
id 'maven-publish'
id 'scala'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
apply plugin: 'forge'
version = "1.0"
group= "fr.crazycat256"
archivesBaseName = "cipher-client"
sourceCompatibility = 1.8
targetCompatibility = 1.8
minecraft {
version = "1.7.10-10.13.4.1614-1.7.10"
runDir = "run"
replace "@VERSION@", project.version
}
sourceSets {
converter {
java {
srcDir 'src/converter/java'
}
}
injector {
java {
srcDir 'src/injector/java'
}
}
}
repositories {
maven {
name = "Overmind forge repo mirror"
url = "https://gregtech.overminddl1.com/"
}
}
dependencies {
// This must not be used if the client is injected
implementation ('net.bytebuddy:byte-buddy-agent:1.14.18') {
exclude group: 'org.ow2.asm'
}
injectorImplementation 'net.bytebuddy:byte-buddy-agent:1.14.18'
}
tasks.register('genInjectorResources', JavaExec) {
doFirst {
delete 'src/injector/resources'
mkdir 'src/injector/resources'
copy {
from 'src/main/resources'
into 'src/injector/resources'
}
}
dependsOn jar
main = 'fr.crazycat256.cipherclient.converter.Converter'
classpath = sourceSets.converter.runtimeClasspath
args = ['build/libs/cipher-client-' + version + '.jar', 'src/injector/resources/cipher-client.bin']
}
tasks.register('injectorJar', ShadowJar) {
dependsOn genInjectorResources
from sourceSets.injector.output
archiveClassifier.set('injector')
configurations = [project.configurations.injectorResolvableImplementation]
manifest {
attributes (
'Main-Class': 'fr.crazycat256.cipherclient.injector.Main',
'Agent-Class': 'fr.crazycat256.cipherclient.injector.Agent',
'Can-Redefine-Classes': true,
'Can-Retransform-Classes': true
)
}
}
configurations {
injectorImplementation
injectorResolvableImplementation.extendsFrom injectorImplementation
}
tasks.build.finalizedBy('genInjectorResources', 'injectorJar')
processResources {
from (sourceSets.main.resources.srcDirs) {
include '**/*.info'
expand 'version':project.version, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) { exclude '**/*.info' }
}