-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
136 lines (112 loc) · 3.58 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
plugins {
id 'java-library'
id 'com.diffplug.spotless' version '6.+'
id 'maven-publish'
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
group = 'com.alumiboti5590'
version = getTagName();
def getTagName() {
String ref = System.getenv('GITHUB_REF') ?: "dev";
return ref.split('/').last();
}
java {
withSourcesJar()
withJavadocJar()
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = "sources"
}
repositories {
mavenCentral()
maven {
url "https://frcmaven.wpi.edu/artifactory/release/"
}
maven {
url "https://maven.revrobotics.com/"
}
maven {
url "https://maven.ctr-electronics.com/release/"
}
}
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 5.
dependencies {
// FRC WPILib dependencies
implementation("edu.wpi.first.hal:hal-java:${wpilibVersion}")
implementation("edu.wpi.first.wpilibj:wpilibj-java:${wpilibVersion}")
implementation("edu.wpi.first.wpiutil:wpiutil-java:${wpilibVersion}")
implementation("edu.wpi.first.wpimath:wpimath-java:${wpilibVersion}")
implementation("edu.wpi.first.ntcore:ntcore-jni:${wpilibVersion}")
implementation("edu.wpi.first.ntcore:ntcore-java:${wpilibVersion}")
implementation "edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:${wpilibVersion}"
// RevRobotics dependency (Spark Max, Neos, etc...)
implementation "com.revrobotics.frc:REVLib-java:${revRoboticsVersion}"
// CTRE dependency (Talon SRX, etc...)
implementation "com.ctre.phoenix:api-java:${ctreVersion}"
implementation "com.ctre.phoenix:wpiapi-java:${ctreVersion}"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat "full" // default is "short"
events "passed", "skipped", "failed"
}
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}
// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}
// Configure the linting and style-enforcement of the project
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
java {
importOrder()
removeUnusedImports()
palantirJavaFormat()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
licenseHeader '/* $YEAR Written by Alumiboti FRC 5590 */'
}
}
publishing {
// Configure our package for when it gets published
publications {
maven(MavenPublication) {
artifactId = 'eye-of-providence'
from components.java
pom {
name = 'Eye of Providence'
description = 'Collection of reusable code for the FRC robots maintained by the Alumiboti.'
url = 'https://github.com/alumiboti5590/eye-of-providence'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://github.com/alumiboti5590/eye-of-providence/blob/main/LICENSE.md'
}
}
developers {
developer {
id = 'dstarner'
name = 'Dan Starner'
email = 'alumiboti@danstarner.com'
}
}
}
}
}
}