-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[build] Gradle Cleanup #1021
[build] Gradle Cleanup #1021
Changes from 6 commits
0c80eff
bfb4612
20f359c
76dd2a8
63d1f9b
9855ae6
6e39d85
4563d61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,24 @@ | ||
plugins { | ||
id 'edu.wpi.first.WpilibTools' version '1.3.0' | ||
} | ||
|
||
import java.nio.file.Path | ||
|
||
apply from: "${rootDir}/shared/common.gradle" | ||
|
||
dependencies { | ||
implementation project(':photon-targeting') | ||
|
||
implementation "io.javalin:javalin:$javalinVersion" | ||
|
||
implementation 'org.msgpack:msgpack-core:0.9.0' | ||
implementation 'org.msgpack:jackson-dataformat-msgpack:0.9.0' | ||
|
||
// JOGL stuff (currently we only distribute for aarch64, which is Pi 4) | ||
implementation "org.jogamp.gluegen:gluegen-rt:$joglVersion" | ||
implementation "org.jogamp.jogl:jogl-all:$joglVersion" | ||
|
||
implementation "org.jogamp.gluegen:gluegen-rt:$joglVersion:natives-linux-aarch64" | ||
implementation "org.jogamp.jogl:jogl-all:$joglVersion:natives-linux-aarch64" | ||
|
||
// Zip | ||
implementation 'org.zeroturnaround:zt-zip:1.14' | ||
|
||
implementation wpilibTools.deps.wpilibJava("apriltag") | ||
|
||
implementation "org.xerial:sqlite-jdbc:3.41.0.0" | ||
} | ||
|
||
task writeCurrentVersionJava { | ||
task writeCurrentVersion { | ||
def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in") | ||
writePhotonVersionFile(versionFileIn, Path.of("$projectDir", "src", "main", "java", "org", "photonvision", "PhotonVersion.java"), | ||
versionString) | ||
} | ||
|
||
build.dependsOn writeCurrentVersionJava | ||
build.dependsOn writeCurrentVersion | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,26 @@ apply plugin: 'edu.wpi.first.NativeUtils' | |
apply from: "${rootDir}/shared/config.gradle" | ||
apply from: "${rootDir}/shared/javacommon.gradle" | ||
|
||
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get() | ||
|
||
def nativeConfigName = 'wpilibNatives' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's ok if multiple projects share this name right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It builds lol There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And it runs in test mode and the shadow jar and robot sim and everything? This could cause unsatisfied link errors if you aren't careful There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test mode worked, I didn't run the simulation. Also if you look at main, they are both named the exact same thing so I'm fairly sure this doesn't matter. |
||
def nativeConfig = configurations.create(nativeConfigName) | ||
|
||
def nativeTasks = wpilibTools.createExtractionTasks { | ||
configurationName = nativeConfigName | ||
} | ||
|
||
nativeTasks.addToSourceSetResources(sourceSets.main) | ||
|
||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath") | ||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet") | ||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil") | ||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore") | ||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore") | ||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag") | ||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal") | ||
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get()) | ||
|
||
// Windows specific functionality to export all symbols from a binary automatically | ||
nativeUtils { | ||
exportsConfigs { | ||
|
@@ -23,6 +43,9 @@ model { | |
} | ||
exportedHeaders { | ||
srcDirs 'src/main/native/include' | ||
if (project.hasProperty('generatedHeaders')) { | ||
srcDir generatedHeaders | ||
} | ||
include "**/*.h" | ||
} | ||
} | ||
|
@@ -73,4 +96,4 @@ model { | |
} | ||
} | ||
|
||
apply from: "${rootDir}/shared/publish.gradle" | ||
apply from: "${rootDir}/shared/javacpp/publish.gradle" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with the old name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just matched photon-lib now