forked from aurilisdev/Nuclear-Science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
188 lines (159 loc) · 5.13 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath 'org.ajoberstar:gradle-git:0.6.1'
}
}
import org.ajoberstar.gradle.git.tasks.GitTag
import org.ajoberstar.gradle.git.tasks.GitPush
plugins {
id "com.matthewprenger.cursegradle" version '1.4.0'
}
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'
libsDirName = "../output"
distsDirName = "../output"
def version_minor='3'
def version_revision='0'
def minecraft_version='1.16.5'
def version_build='0'
def version_major='0'
version = minecraft_version+'-'+version_major+'.'+version_minor+'.'+version_revision+'-'+version_build
group = 'nuclearscience' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'Nuclear Science'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: 'snapshot', version: '20201028-1.16.3'
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
nuclearscience {
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'
mods {
nuclearscience {
source sourceSets.main
}
}
}
data {
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'
args '--mod', 'nuclearscience', '--all', '--output', file('src/generated/resources/')
mods {
nuclearscience {
source sourceSets.main
}
}
}
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.16.5-36.0.42'
compile fileTree("C:/AmpzLibz")
/*
Compiles against source code as well as JAR at runtime. Recommend to keep it
*/
compileOnly fg.deobf("mezz.jei:jei-1.16.5:7.7.0.101:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.16.5:7.7.0.101")
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "nuclearscience",
"Specification-Vendor": "aurilisdev",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"aurilisdev",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
jar.finalizedBy('reobfJar')
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier = 'sources'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
artifacts {
archives sourcesJar
archives deobfJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
/*
This needs to stay. It's the Maven repository for JEI along with a fallback!
*/
repositories{
mavenCentral()
maven {
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
name = "ModMaven"
url = "https://modmaven.k-4u.nl"
}
}
ext.gittagnew = 'v'+project.version
task createTag(type: GitTag) {
repoPath = rootDir
tagName = gittagnew
message = "tag ${project.version.toString()}"
}
task pushTag(type: GitPush, dependsOn: createTag) {
namesOrSpecs = [gittagnew]
}
tasks.curseforge.dependsOn jar
tasks.curseforge.dependsOn pushTag
/*
curseforge {
apiKey = System.getenv("CURSEFORGE_KEY")
project {
id = '318646'
changelog = 'You can find changelog at: https://aurilis.dev/'
releaseType = 'release'
addGameVersion minecraft_version
mainArtifact(jar) {
displayName=project.name+' ' + project.version
}
}
}
*/