-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
102 lines (84 loc) · 3.07 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
buildscript {
repositories {
mavenCentral()
maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
}
dependencies { classpath('com.anatawa12.forge:ForgeGradle:1.2-1.1.+') { changing = true } }
}
apply plugin: 'java'
apply plugin: 'forge'
apply plugin: 'maven-publish'
// For self testing and providing game test tasks
apply from: './gradle/configurations/v1.gradle'
repositories {
mavenCentral()
maven { // Required for patched CCL and CCC, but you can use it for other mods too :)
name 'Gregtech repo'
url 'https://gregtech.overminddl1.com'
}
}
// For self testing and providing game test tasks
configurations {
testImplementation.exclude group: project.group, module: project.name
}
def buildprop = new Properties()
file("build.properties").withInputStream { buildprop.load(it) }
version = buildprop.version
group = buildprop.group
archivesBaseName = project.name
task devJar(type: Jar) {
archiveClassifier = 'dev'
manifest { from project.tasks.jar.manifest }
from sourceSets.main.output
}
artifacts {
archives devJar
}
java {
withSourcesJar()
}
configure([tasks.compileJava, tasks.compileTestJava, tasks.compileApiJava]) {
sourceCompatibility = 16 // for the IDE support
options.release = 8
javaCompiler = javaToolchains.compilerFor { languageVersion = JavaLanguageVersion.of(16) }
}
minecraft {
version = "${buildprop.game_version}-${buildprop.forge_version}-${buildprop.game_version}"
runDir = buildprop.run_dir
replace '@VERSION@', project.version
}
dependencies {
// Just for autosearch test of mappings directory
testRuntimeOnly 'codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev'
testRuntimeOnly 'codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev'
compileOnly "org.jetbrains:annotations:${buildprop.jetbrains_annotations_version}"
testCompileOnly "org.jetbrains:annotations:${buildprop.jetbrains_annotations_version}"
compileOnly "org.projectlombok:lombok:${buildprop.lombok_version}"
annotationProcessor "org.projectlombok:lombok:${buildprop.lombok_version}"
testCompileOnly "org.projectlombok:lombok:${buildprop.lombok_version}"
testAnnotationProcessor "org.projectlombok:lombok:${buildprop.lombok_version}"
annotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:${buildprop.jabel_version}"
testAnnotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:${buildprop.jabel_version}"
}
processResources {
inputs.property 'version', project.version
inputs.property 'mcversion', project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
project.afterEvaluate { p -> tasks.findByName('publishMavenJavaPublicationToMavenLocal').mustRunAfter('build') } // Bruh
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact devJar
artifact sourcesJar
}
}
}