-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
77 lines (62 loc) · 1.8 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
plugins {
id "java"
id 'edu.wpi.first.WpilibTools' version '1.3.0'
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
id "com.diffplug.spotless" version "6.22.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_11
targetCompatibility = JavaVersion.VERSION_11
}
dependencies {
implementation wpilibTools.deps.wpilibOpenCvJava("frc2025", "4.10.0-3")
// Junit
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")
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
java {
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
}
ext.nativeName = wpilibTools.platformMapper.currentPlatform.platformName;
ext.outputsFolder = file("$buildDir/outputs")
println("Building for $nativeName")
tasks.register('copyNativeLibrary', Sync) {
from "${projectDir}/cmake_build/bin/"
from "${projectDir}/cmake_build/lib/"
into "${outputsFolder}/nativelibraries/${nativeName}/"
include "**/*.dll", "**/*.so"
// And flatten, since windows is stupid
eachFile {
path = name
}
includeEmptyDirs = false
build.dependsOn it
publish.dependsOn it
}
apply from: "publish.gradle"