Skip to content
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

Merged
merged 8 commits into from
Nov 23, 2023
Merged

Conversation

srimanachanta
Copy link
Member

@srimanachanta srimanachanta commented Nov 22, 2023

Cleanup project-wide gradle configuration.

  • removes native dependencies from java only projects
  • increases readability
  • Pass generated headers in setup instead of modifying model

@srimanachanta srimanachanta requested a review from a team as a code owner November 22, 2023 07:03
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
Copy link
Contributor

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?

Copy link
Member Author

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

photon-lib/build.gradle Show resolved Hide resolved
@@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok if multiple projects share this name right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It builds lol

Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Member Author

@srimanachanta srimanachanta Nov 22, 2023

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

@mcm001 mcm001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on a C++ sim project and on a fat JAR

@mcm001 mcm001 merged commit 773c635 into PhotonVision:master Nov 23, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants