-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
179 lines (149 loc) · 6.87 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
subprojects {
group = 'com.dmdirc'
apply plugin: 'com.dmdirc.git-version'
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'idea'
apply from: '../gradle/coverage.gradle'
idea {
module {
sourceDirs += file('src/main/generated')
testSourceDirs += file('src/test/generated_tests')
generatedSourceDirs = [file('src/main/generated'), file('src/test/generated_tests')]
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
pom.withXml {
def root = asNode()
root.appendNode('inceptionYear', '2006')
root.appendNode('url', 'http://www.dmdirc.com/')
root.appendNode('name', "${group}:${artifactId}")
root.appendNode('description', project.name == 'common'
? 'Framework for building parsers for connecting to chat networks '
: 'IRC library')
def scm = root.appendNode('scm')
scm.appendNode('url', 'https://github.com/DMDirc/parser')
scm.appendNode('connection', 'scm:https://github.com/DMDirc/Parser.git')
scm.appendNode('developerConnection', 'scm:ssh://[email protected]:DMDirc/Parser.git')
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'MIT License')
license.appendNode('url', 'http://www.opensource.org/licenses/mit-license.php')
license.appendNode('distribution', 'repo')
def issues = root.appendNode('issueManagement')
issues.appendNode('system', 'GitHub Issues')
issues.appendNode('url', 'https://github.com/DMDirc/Parser/issues')
def developers = root.appendNode('developers')
def chris = developers.appendNode('developer')
chris.appendNode('name', 'Chris Smith')
chris.appendNode('email', '[email protected]')
def greg = developers.appendNode('developer')
greg.appendNode('name', 'Greg Holmes')
greg.appendNode('email', '[email protected]')
def shane = developers.appendNode('developer')
shane.appendNode('name', 'Shane McCormack')
shane.appendNode('email', '[email protected]')
def dependenciesNode = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
configurations.testCompile.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
dependencyNode.appendNode('scope', 'test')
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/dmdirc/parser")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("PASSWORD")
}
}
maven {
name = "Reposilite"
if (project.version.endsWith('-SNAPSHOT')) {
url = uri("https://artifactory.dmdirc.com/snapshots")
} else {
url = uri("https://artifactory.dmdirc.com/releases")
}
credentials {
username = project.findProperty("reposiliteUser") ?: System.getenv('REPOSILITE_USER')
password = project.findProperty("reposiliteToken") ?: System.getenv('REPOSILITE_TOKEN')
}
authentication {
basic(BasicAuthentication)
}
}
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories.mavenCentral()
dependencies {
compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.5'
compile group: 'com.google.auto.value', name: 'auto-value', version: '1.6'
compile group: 'com.google.auto.value', name: 'auto-value-annotations', version: '1.6'
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.21'
compile group: 'com.squareup.dagger', name: 'dagger', version: '1.2.5'
compile group: 'com.google.guava', name:'guava', version: '19.0'
compile group: 'net.engio', name: 'mbassador', version: '1.3.0'
compile group: 'de.odysseus.juel', name: 'juel-api', version: '2.2.7'
compile group: 'de.odysseus.juel', name: 'juel-impl', version: '2.2.7'
compile group: 'de.odysseus.juel', name: 'juel-spi', version: '2.2.7'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.2.7'
}
task publishSnapshot(dependsOn: 'publishMavenJavaPublicationToReposiliteRepository') << {
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
}
task wrapper(type: Wrapper) {
gradleVersion = '3.1'
}
def find(name) {
if (allprojects.find { it.name == name }) {
project(name)
} else if (allprojects.find { it.name == 'parser-' + name }) {
project('parser-' + name)
} else if (allprojects.find { it.name == 'parser:' + name }) {
project('parser:' + name)
} else if (allprojects.find { it.name == 'modules:parser:' + name }) {
project('modules:parser:' + name)
} else {
println "Couldn't find project $name"
}
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath group: 'com.dmdirc', name: 'git-version', version: '1.0'
classpath group: 'org.kt3k.gradle.plugin', name: 'coveralls-gradle-plugin', version: '2.6.3'
}
}
apply from: 'gradle/coveralls.gradle'