forked from godbrigero/PWRUPCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
113 lines (96 loc) · 3.07 KB
/
build.gradle
File metadata and controls
113 lines (96 loc) · 3.07 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
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2026.2.1"
id "com.google.protobuf" version "0.9.3"
id "maven-publish" // For publishing as a library
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
// Set to true to use debug for JNI.
wpi.java.debugJni = false
// Defining my dependencies
dependencies {
// WPILib dependencies
annotationProcessor wpi.java.deps.wpilibAnnotations()
implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()
// Native libraries
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
simulationDebug wpi.sim.enableDebug()
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()
// Other dependencies
implementation 'com.google.code.gson:gson:2.10.1'
implementation "com.google.protobuf:protobuf-java:3.22.2"
implementation 'org.ejml:ejml-all:0.41'
implementation 'org.java-websocket:Java-WebSocket:1.5.3'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation 'org.jmdns:jmdns:3.5.7'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testImplementation "com.google.protobuf:protobuf-java:3.22.2"
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'com.github.godbrigero:autobahn_client:4c1ea78b06'
}
repositories {
mavenCentral()
maven {
url = "https://jitpack.io"
}
}
test {
useJUnitPlatform()
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}
// Setting up the Jar File as a library
jar {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
from sourceSets.main.allSource
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}
// Configure for publishing as a library
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
// --- Protobuf setup ---
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.22.2" // Use the desired protoc version
}
generateProtoTasks {
all().each { task ->
task.builtins {
java { // Enable Java generation
option 'lite' // Use this option for smaller code (optional)
}
}
}
}
}
// Make sure protobuf compilation runs before building Java classes
tasks.named('compileJava') {
dependsOn tasks.named('generateProto')
}
sourceSets {
main {
proto {
srcDir 'src/proto'
}
java {
srcDirs += "$buildDir/generated/source/proto/main/java"
}
}
}