-
Notifications
You must be signed in to change notification settings - Fork 332
/
Copy pathbuild.gradle
145 lines (122 loc) · 3.33 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.4'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1"
}
}
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'com.google.protobuf'
apply plugin: 'checkstyle'
apply plugin: 'com.jfrog.bintray'
archivesBaseName = archivesBaseName + '-library'
sourceSets {
main {
proto {
// Need to use custom dir cause Gradle doesn't like us otherwise :(
srcDir 'src/resources/protobuf/src'
include '**/*.proto'
}
}
}
archivesBaseName = 'PokeGOAPI-library'
// Remove all .proto definition from the final build
processResources {
exclude('POGOProtos/')
exclude('signature/Signature.proto')
}
javadoc {
exclude "**/google/common/geometry/**"
}
// Run this task to bundle all needed dependency
task bundle(type: Jar) {
baseName = archivesBaseName + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
jar.finalizedBy(bundle)
protobuf {
// Configure the protoc executable
protoc {
// Download from repositories
artifact = 'com.google.protobuf:protoc:3.7.0'
}
}
def checkstyleOutputDir = "${project.projectDir}/build/reports/checkstyle/"
checkstyle {
toolVersion = '7.0'
configFile = file("${project.projectDir}/config/checkstyle.xml")
configProperties = ["suppressionFile": file("${project.projectDir}/config/suppressions.xml")]
reportsDir = file(checkstyleOutputDir)
ignoreFailures = false
checkstyleMain {
source = sourceSets.main.allSource
}
configurations {
checkstyle
}
dependencies {
checkstyle "com.puppycrawl.tools:checkstyle:${toolVersion}"
}
}
//Abort if any checkstyle warnings
checkstyleMain.doLast {
def outputFile = file(checkstyleOutputDir + "main.xml")
if (outputFile.exists() && outputFile.text.contains("<error ")) {
logger.warn("!!!!-----------------------------------!!!!")
logger.warn("There were checkstyle warnings! For more info check $outputFile")
logger.warn("PLEASE CORRECT BEFORE SUBMITTING A PULLREQUEST")
logger.warn("!!!!-----------------------------------!!!!")
}
}
dependencies {
compile 'svarzee.gps:gpsoauth:0.3'
compile 'com.squareup.okio:okio:2.0.0'
compile 'com.squareup.moshi:moshi:1.6.0'
compile 'com.annimon:stream:1.2.1'
compile 'com.squareup.okhttp3:okhttp:3.11.0'
compile 'com.google.protobuf:protobuf-java:3.7.0'
compile 'io.reactivex:rxjava:1.3.4'
compile 'net.jpountz.lz4:lz4:1.3.0'
compileOnly 'org.projectlombok:lombok:1.18.2'
}
idea {
module {
sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java");
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
javadoc.failOnError(false);
javadoc.source = sourceSets.main.allJava
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
Properties properties = new Properties()
try {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
} catch (Exception ignore) {
}
bintray {
user = properties.getProperty('user')
key = properties.getProperty('apiKey')
configurations = ['archives']
pkg {
repo = 'maven'
name = 'PokeGOAPI'
userOrg = user
licenses = ['GPL-3.0']
vcsUrl = 'https://github.com/Grover-c13/PokeGOAPI-Java.git'
publish = true
}
}