forked from SpongePowered/SpongeForge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
123 lines (107 loc) · 3.46 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
// Gradle repositories and dependencies
buildscript {
repositories {
mavenCentral()
maven {
name = 'sonatype-nexus-public'
url = 'https://oss.sonatype.org/content/repositories/public/'
}
maven {
name = 'forge-repo'
url = 'http://files.minecraftforge.net/maven/'
}
jcenter()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
// Default tasks
defaultTasks 'build', 'licenseFormat'
// Apply plugin
apply plugin: 'forge'
apply plugin: 'license'
apply plugin: 'maven'
apply plugin: 'checkstyle'
// Basic project information
group = 'org.spongepowered'
archivesBaseName = 'sponge'
// Version -> Minecraft-MinecraftForge-Ours(If any?)
version = '1.7.10-10.13.1.1213-SNAPSHOT'
// Define variables
ext.buildNumber = project.hasProperty("buildNumber") ? buildNumber : '0'
ext.ciSystem = project.hasProperty("ciSystem") ? ciSystem : 'unknown'
ext.commit = project.hasProperty("commit") ? commit : 'unknown'
// Minimum version of Java required
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
repositories { mavenLocal() }
// MinecraftForge version
minecraft {
version = "1.7.10-10.13.1.1214-new"
}
// Project dependencies
dependencies {
compile project(':SpongeAPI')
testCompile 'junit:junit:4.11'
}
// Filter, process, and include resources
processResources {
inputs.property "version", version
inputs.property "mcversion", project.minecraft.version
// Include in final JAR
from 'LICENSE.txt'
// Replace variables
from('src/main/resources/mcmod.info') {
expand 'modid': project.name.toLowerCase(),
'name': project.name,
'description': project.description,
'version': version,
'buildNumber': buildNumber,
'mcversion': minecraft.version,
'url': url,
'authorList': organization
}
}
jar {
// Jar shading and packaging configuration
from { project("SpongeAPI").sourceSets.main.output.files }
// JAR manifest configuration
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": name,
"Implementation-Version": version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit,
"Implementation-Vendor": url,
"FMLCorePlugin": "org.spongepowered.mod.SpongeCoremod")
}
// License header formatting
license {
ext.name = project.name
ext.organization = project.organization
ext.url = project.url
ext.year = project.inceptionYear
exclude "**/*.info"
exclude "assets/**"
header new File(project("SpongeAPI").getProjectDir(), "HEADER.txt")
sourceSets = project.sourceSets
ignoreFailures false
strictCheck true
}
checkstyle {
configProperties = [
"name" : project.name,
"organization" : project.organization,
"url" : project.url,
"year" : project.inceptionYear
]
configFile = new File(project("SpongeAPI").getProjectDir(),"checkstyle.xml")
}
tasks.reobf.dependsOn "check"
// Source compiler configuration
tasks.withType(JavaCompile) {
options.compilerArgs += [ '-Xlint:all', '-Xlint:-path' ]
options.deprecation = true
options.encoding = 'utf8'
}