-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
163 lines (140 loc) · 4.66 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath group: 'com.github.rodionmoiseev.gradle.plugins', name: 'idea-utils', version: '0.2'
}
}
import groovy.json.*
configurations {
compile
deployJars
}
apply plugin: "forge"
apply plugin: "maven"
apply plugin: "idea-utils"
group = "net.doubledoordev.d3log"
version = "0.1.0"
targetCompatibility = 1.7
sourceCompatibility = 1.7
archivesBaseName = 'D3Log'
def githuborg = 'DoubleDoorDevelopment'
def description = 'Logging mod for Forge'
minecraft {
version = "1.7.10-10.13.4.1448-1.7.10"
runDir = "jars"
}
repositories {
mavenCentral()
}
dependencies {
compile group: "org.apache.commons", name: "commons-dbcp2", version: "2.0.1"
compile group: "mysql", name: "mysql-connector-java", version: "5.1.34"
}
if (System.getenv().BUILD_NUMBER != null) version += "." + System.getenv().BUILD_NUMBER
def builder = new groovy.json.JsonBuilder()
builder (version: version, mcversion: project.minecraft.version, apiversion: project.minecraft.apiVersion)
new File("versions.json").write(builder.toPrettyString())
processResources {
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
expand 'version':project.version, 'mcversion':project.minecraft.version, 'modid':project.archivesBaseName, 'githuborg':githuborg, 'description':description
}
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
}
}
task sourcesJar(type: Jar) {
from "LICENSE.txt"
from sourceSets.main.allSource
classifier = 'src'
appendix = project.minecraft.version
manifest {
attributes 'FMLAT': 'D3Log_at.cfg'
}
}
task deobfJar(type: Jar) {
from "LICENSE.txt"
from sourceSets.main.output
classifier = 'dev'
appendix = project.minecraft.version
manifest {
attributes 'FMLAT': 'D3Log_at.cfg'
}
}
jar {
from "LICENSE.txt"
appendix = project.minecraft.version
from configurations.runtime.asFileTree.files.collect { zipTree(it) }
manifest {
attributes 'FMLAT': 'D3Log_at.cfg'
}
}
artifacts {
archives jar
archives sourcesJar
archives deobfJar
}
idea {
project {
copyright {
name = 'New BSD License'
license = file('LICENSE.txt')
}
}
}
uploadArchives {
if (project.hasProperty("dddUser") && project.hasProperty("dddUrl") && project.hasProperty("dddPass")) {
repositories {
mavenDeployer {
repository(url: dddUrl) {
authentication(userName: dddUser, password: dddPass)
}
pom {
groupId = project.group
version = project.minecraft.version + "-" + project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description = description
url 'https://github.com/' + githuborg + '/' + project.archivesBaseName
scm {
url 'https://github.com/' + githuborg + '/' + project.archivesBaseName
connection 'scm:git:git://github.com/' + githuborg + '/' + project.archivesBaseName + '.git'
developerConnection 'scm:git:[email protected]:' + githuborg + '/' + project.archivesBaseName + '.git'
}
issueManagement {
system 'github'
url 'https://github.com/' + githuborg + '/' + project.archivesBaseName + '/issues'
}
licenses {
license {
name 'New BSD License'
url 'https://raw.github.com/' + githuborg + '/' + project.archivesBaseName + '/master/LICENCE.txt'
distribution 'repo'
}
}
developers {
developer {
id 'Dries007'
name 'Dries007'
roles { role 'developer' }
}
}
}
}
}
}
}
}