-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
138 lines (118 loc) · 5.34 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
buildscript {
repositories {
mavenCentral()
jcenter()
mavenLocal()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
classpath 'org.ajoberstar:gradle-git:0.10.1'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
plugins {
id 'net.minecraftforge.gradle.forge' version '2.0.2'
id 'com.matthewprenger.cursegradle' version '1.0.7'
}
apply plugin: 'net.minecraftforge.gradle.forge'
//********************************************************************************************************************************
//************************************************************* VERSIONING ************************************************************
//********************************************************************************************************************************
def doCmd(s) {
try {
s.execute(null, file('.')).text.trim()
} catch(e) {
'unspecified'
}
}
version = "${minecraft_version}"
ext.gitRevision = doCmd('git rev-list --count HEAD')
ext.gitHash = doCmd('git rev-parse --short HEAD')
version += "-$gitRevision"
//********************************************************************************************************************************
//************************************************************* CURSE ************************************************************
//********************************************************************************************************************************
curseforge {
apiKey = project.curseforge_key_villageinfo
project {
id = project.curse_projectId
changelog = file('changelog.txt')
releaseType = 'alpha'
}
}
//********************************************************************************************************************************
//*********************************************************** License ************************************************************
//********************************************************************************************************************************
apply plugin: 'license'
license
{
ext.name = project.name
ext.organization = project.organization
ext.url = project.url
ext.year = project.inceptionYear
exclude '**/*.info'
exclude '**/*.json'
exclude '**/*.ma'
exclude '**/*.mb'
exclude '**/*.png'
exclude '**/*.obj'
exclude '**/*.lang'
exclude '**/*.cfg'
header new File(projectDir, 'HEADER.txt')
sourceSets = project.sourceSets
ignoreFailures = false
strictCheck = true
mapping { javascript='JAVADOC_STYLE'}
}
//********************************************************************************************************************************
//*********************************************************** COMPATIBILITY ********************************************************
//********************************************************************************************************************************
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
//********************************************************************************************************************************
//************************************************************ MINECRAFT *********************************************************
//********************************************************************************************************************************
group= "${group}"
archivesBaseName = "${name}"
minecraft
{
version = minecraft_version + '-' + forge_version
runDir = 'run'
mappings = project.mappings
useDepAts = true
replaceIn "references/Reference.java"
replace "@VERSION@", "${mod_version}.${System.getenv("BUILD_NUMBER") ?: 0}"
replaceIn 'references/Reference.java'
if (project.hasProperty('st_keystore_fingerprint'))
{
replace '@FINGERPRINT@', project.st_keystory_fingerprint
}
}
//********************************************************************************************************************************
//************************************************************ RESOURCES *********************************************************
//********************************************************************************************************************************
processResources
{
inputs.property "version", project.version
inputs.property "mcversion", minecraft_version
from 'LICENSE.txt'
from(sourceSets.main.resources.srcDirs)
{
include '**/*.info'
include '**/*.properties'
expand ([
'mod_version': project.version,
'forge_version': forge_version,
'minecraft_version': minecraft_version,
])
}
from(sourceSets.main.resources.srcDirs)
{
exclude '**/*.info'
exclude '**/*.properties'
}
}