-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle
More file actions
122 lines (103 loc) · 3.03 KB
/
build.gradle
File metadata and controls
122 lines (103 loc) · 3.03 KB
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
plugins {
id "java"
id 'org.photonvision.tools.WpilibTools' version '2.3.1-photon'
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
id "com.diffplug.spotless" version "8.1.0"
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven { url = "https://maven.photonvision.org/repository/internal/" }
}
wpilibRepositories.addAllReleaseRepositories(it)
wpilibRepositories.addAllDevelopmentRepositories(it)
}
// Configure the version number.
apply from: "versioningHelper.gradle"
ext {
pubVersion = versionString
isDev = pubVersion.startsWith("dev")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
dependencies {
implementation wpilibTools.deps.wpilibOpenCvJava("frc2025", "4.10.0-3")
// Junit
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation wpilibTools.deps.wpilibJava("wpimath")
implementation wpilibTools.deps.wpilibJava("wpiunits")
implementation wpilibTools.deps.wpilibJava("wpiutil")
implementation "com.fasterxml.jackson.core:jackson-annotations:2.15.2"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
java {
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
}
spotless {
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**', '**/build-*/**', '**/src/generated/**', "**/cmake_build/**"
}
toggleOffOn()
googleJavaFormat()
leadingSpacesToTabs(2)
leadingTabsToSpaces(4)
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '**/build/**', '**/build-*/**', "**/cmake_build/**"
}
greclipse()
leadingTabsToSpaces(4)
trimTrailingWhitespace()
endWithNewline()
}
format 'misc', {
target fileTree('.') {
include '**/*.md', '**/.gitignore'
exclude '**/build/**', '**/build-*/**', '**/node_modules/**', "**/cmake_build/**"
}
trimTrailingWhitespace()
leadingTabsToSpaces(2)
endWithNewline()
}
}
def nativeName = wpilibTools.platformMapper.platformPath
ext.outputsFolder = file("$buildDir/outputs")
println("Building for $nativeName")
tasks.register('copyNativeLibrary', Sync) {
from "${projectDir}/cmake_build/bin/"
from "${projectDir}/cmake_build/lib/"
// Hardcode to shared because we're not building static ever
into "${outputsFolder}/${nativeName}/shared/"
include "**/*.dll", "**/*.so", "**/*.dylib"
includeEmptyDirs = false
build.dependsOn it
publish.dependsOn it
}
tasks.named('test', Test) {
useJUnitPlatform()
maxHeapSize = '1G'
testLogging {
events "passed"
}
}
apply from: "publish.gradle"