-
Notifications
You must be signed in to change notification settings - Fork 184
/
build.gradle
123 lines (107 loc) · 3.94 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
import java.time.Instant
plugins {
id 'java'
id 'maven-publish'
id 'com.github.johnrengelman.shadow'
}
// Get mod version from CI, else suffix a timestamp (calculated here bc timestamp can change if done separately in each subproject)
mod_version = System.getenv("AUTO_GENERATED_VERSION") ?: "${mod_version}.${Instant.now().getEpochSecond()}"
group = 'mrtjp'
version = "${mc_version}-${mod_version}"
println "Starting build of ${name}, Version: ${mod_version}"
println "Using Forge: ${forge_version}, for Minecraft: ${mc_version}, with Mappings: ${mcp_mappings}"
// Common submodule configurations
subprojects { p ->
// Needs to be force-applied here to allow below configuration
apply plugin: 'java'
// Select Java version
java.toolchain.languageVersion = JavaLanguageVersion.of(java_lang_version)
// Copy properties from root
group = rootProject.group
mod_version = rootProject.mod_version
version = rootProject.version
// ForgeGradle version settings
archivesBaseName = rootProject.name
// Jar settings
jar {
archiveClassifier = p.name
}
// Add datagen resources to source set
sourceSets.main.resources.srcDirs += "src/main/generated"
// Add default repositories
repositories {
mavenLocal()
maven { url = "https://proxy-maven.covers1624.net/" }
maven { url = "https://squiddev.cc/maven/" }
maven { url = "https://maven.blamejared.com/" }
}
// Replace version tokens in mods.toml
processResources {
inputs.property 'mod_version', mod_version
inputs.property 'mc_version', mc_version
filesMatching('META-INF/mods.toml') {
expand 'file': ['jarVersion': mod_version],
'mc_version': mc_version,
'forge_version': forge_version,
'lang_version': forge_version.split('\\.')[0],
'ccl_version': ccl_version,
'cbm_version': cbm_version,
'cct_version': cct_version
}
}
}
// Defined explicitly so publishing can access shadowJar property
project(':fabrication') {
apply plugin: 'com.github.johnrengelman.shadow'
}
publishing {
repositories {
maven {
url "https://nexus.covers1624.net/repository/maven-releases/"
credentials {
username System.getenv('MAVEN_USER')
password System.getenv('MAVEN_PASS')
}
}
}
publications {
ProjectRed(MavenPublication) {
artifact project(':api').jar
artifact project(':core').jar
artifact project(':expansion').jar
artifact project(':exploration').jar
artifact project(':fabrication').shadowJar
artifact project(':illumination').jar
artifact project(':integration').jar
artifact project(':transmission').jar
pom {
name = rootProject.name
description = rootProject.name
url = 'https://github.com/MrTJP/ProjectRed'
scm {
url = 'https://github.com/MrTJP/ProjectRed'
connection = 'scm:git:git://github.com/MrTJP/ProjectRed.git'
connection = 'scm:git:[email protected]:MrTJP/ProjectRed.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/MrTJP/ProjectRed/issues'
}
developers {
developer {
id = 'mrtjp'
name = 'mrtjp'
}
developer {
id = 'Chicken-Bones'
name = 'Chicken-Bones'
}
developer {
id = 'covers1624'
name = 'covers1624'
}
}
}
}
}
}