Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
107 lines (89 loc) · 3.15 KB
/
Copy pathbuild.gradle
File metadata and controls
107 lines (89 loc) · 3.15 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
buildscript {
repositories {
maven { url = "https://files.minecraftforge.net/maven" }
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
// 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'
def baseVersion = project.findProperty("mod_version") ?: "0.0.0"
def buildType = project.findProperty("buildType") ?: "snapshot"
def buildNumber = project.findProperty("buildNumber") ?: "local"
def versionName
if (buildType == "release") {
versionName = baseVersion
} else if (buildType == "beta") {
versionName = "${baseVersion}-beta+build.${buildNumber}"
} else {
def timestamp = new Date().format("yyyyMMdd.HHmm")
versionName = "${baseVersion}-SNAPSHOT+build.${buildNumber}.${timestamp}"
}
version = versionName
group = 'de.julianweinelt.pathfinder' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'pathfinder'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
version = "1.12.2-14.23.5.2768"
runDir = "run"
mappings = "snapshot_20171003"
}
dependencies {
// hier kommen weitere Abhängigkeiten hin, falls du welche brauchst
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", "1.12.2"
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version,
'mcversion': "1.12.2"
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
manifest {
attributes(
'FMLCorePluginContainsFMLMod': 'true',
'Specification-Title': archivesBaseName,
'Specification-Vendor': 'YourNameHere',
'Specification-Version': version,
'Implementation-Title': archivesBaseName,
'Implementation-Version': version,
'Implementation-Vendor': 'YourNameHere'
)
}
}
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
publishing {
publications {
//mavenJava(MavenPublication) {
// artifact jar
//}
mavenJava(MavenPublication) {
from components.java
groupId = 'de.julianweinelt.pathfinder'
artifactId = 'PathFinderAPI'
version = '1.1.1'
}
}
repositories {
maven {
url = uri("https://repo.codeblocksmc.de/releases")
credentials {
username = project.findProperty("repoUser")
password = project.findProperty("repoPassword")
}
}
}
}