forked from team5499/MonkeyLib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
177 lines (142 loc) · 3.91 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
import org.gradle.api.tasks.options.Option
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
id "edu.wpi.first.GradleRIO" version "2020.1.2"
id 'java-library'
id 'maven-publish'
id 'jacoco'
id 'maven'
id 'org.jetbrains.dokka' version '0.10.0'
id 'idea'
}
repositories {
mavenLocal()
mavenCentral()
maven {
url "http://devsite.ctr-electronics.com/maven/release/"
}
maven {
url 'https://frcmaven.wpi.edu/artifactory/release/'
}
}
dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib:1.3.50'
api 'org.jetbrains.kotlin:kotlin-reflect:1.3.50'
compile wpi.deps.wpilib()
compile wpi.deps.vendor.java()
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.0.42-beta'
testCompile 'org.powermock:powermock-module-junit4:1.6.6'
testCompile 'org.powermock:powermock-api-mockito2:1.6.6'
testCompile group: 'org.knowm.xchart', name: 'xchart', version: '3.5.4'
}
group = 'org.team5419'
version = '4.1.7'
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"
inputs.dir 'src/main/kotlin'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from "$buildDir/javadoc"
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/htmldoc"
}
test {
dependsOn 'cleanTest'
useJUnit()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED'
showStandardStreams true
}
afterSuite { desc, result ->
if (!desc.parent) {
println "\nTest result: ${result.resultType}"
println "Test summary: ${result.testCount} tests, " +
"${result.successfulTestCount} succeeded, " +
"${result.failedTestCount} failed, " +
"${result.skippedTestCount} skipped"
}
}
}
jacoco {
toolVersion = '0.8.2'
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
task tox {
doLast {
exec {
executable 'tox'
}
}
}
test.finalizedBy 'tox'
task install_hooks(dependsOn: 'tox')
publishing {
publications {
library(MavenPublication) {
artifactId = 'fault'
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'Fault'
description = 'Commonly used utilities in FRC Team 5419\'s codebase'
url = 'https://github.com/team5419/fault'
}
}
}
repositories {
maven{
}
}
}
class PublishToMavenRepositoryWithCreds extends PublishToMavenRepository {
@Option(option="username", description="username of the user")
public String username
void setUsername(String username) {
this.username = username
}
String getUsername() {
return this.username
}
@Option(option="password", description="password of the user")
public String password
void setPassword(String password) {
this.password = password
}
String getPassword() {
return this.password
}
@Option(option="url", description="url to deploy to")
public String url
void setUrl(String url) {
this.url = url
}
String getUrl() {
return this.url
}
}
task publishToTeamRepo(type: PublishToMavenRepositoryWithCreds) {
doFirst {
publishing.repositories.maven.credentials.username = username
publishing.repositories.maven.credentials.password = password
publishing.repositories.maven.url = url
}
publication = publishing.publications.library
repository = publishing.repositories.maven
}