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

Add a vendordep gradle task #418

Merged
merged 14 commits into from
Oct 17, 2020
Merged

Conversation

Starlight220
Copy link
Member

Fixes #417
The original commit uses curl, the second uses the gradle-download plugin.

@Starlight220
Copy link
Member Author

How do I test the "feature" I added?

@ThadHouse
Copy link
Member

Bump the version number, run the publishToMavenLocal task, and then use that updated version number in a normal robot project.

@Starlight220
Copy link
Member Author

Fixed.

@ThadHouse
Copy link
Member

@Starlight220 looks good. Can you do a few things though. The first 2 before I'll merge it, the third just make a plan to do.

  1. Update the download task to the latest version (its been updated)
  2. Instead of just printing an error, also add an example of how to pass a url. Gradle doesn't print this by default, but for our users it'd be really helpful. Something like "No vendor JSON URL was entered. Try the following \n.\gradlew vendordep --url <insert_url_here>"
  3. Work with @Daltz333 to get something added to docs for this.

@Starlight220
Copy link
Member Author

Starlight220 commented Aug 28, 2020

3 is already done, it's waiting for this to be merged. The frc-docs PR is linked above.
Will do 1,2 soon
Done, ready for review.

@Starlight220
Copy link
Member Author

@ThadHouse - I finished 1,2. Feel free to review/merge/whatever. 3 is wpilibsuite/frc-docs#755, feel free to check it out.

@Starlight220
Copy link
Member Author

@ThadHouse - I was thinking about special-casing two strings in the task so that teams can use this task also to get the Command-Based JSONs with the task. maybe something like gradlew vendordep --url=$COMMAND-NEW. Preferably the first char would be an uncommon character ($ % & etc) so that it's a single char comparison to check if we have a URL or a special case (and if it's the latter we then check if the special case is valid etc).
This would be helpful because right now there isn't a conventional way to get the command-based JSONs.

Either way, I think this feature would be more appropriate as a separate PR, assuming you think it should be added at all - what are your thoughts about this. All your reviews of this PR are fixed, can you review/merge it?

@ThadHouse
Copy link
Member

How would that help. A user could just use the git url directly and pass it it. Definitely opposed to embedding that url in gradlerio, which is what it would take.

And there is a conventional way to get the command based json. VS Code, and theyre always installed with the installer.

@Starlight220
Copy link
Member Author

I was more thinking about it fetching the JSON from the local wpi maven repo (where VS Code fetches it from anyway).

@Starlight220
Copy link
Member Author

@ThadHouse should I add some docs about this to the Adding Vendor Dependencies - Without VS Code section in the README.md?

@ThadHouse
Copy link
Member

Regarding the local url, if its just pointing to the local folder, I'm not opposed. Something like $FRCLOCAL\filename.json Just make sure its using starts with to make sure that only matches in the beginning.

@ThadHouse
Copy link
Member

And yes, updating the readme would be helpful.

@Starlight220
Copy link
Member Author

Starlight220 commented Oct 10, 2020

I finally got the local fetching to work.
Needs some testing. I'll be testing these cases, extra cases are welcome:

  • make sure info prints are correct
  • no URL passed {fails with usage error message}

Local

  • 1. exists in FRCHOME, nonexistent in project, default vendor folder location {should add the file}
  • 2. nonexistent in FRCHOME, nonexistent in project, default vendor folder location {should fail with file not found error message}
  • 3. exists in FRCHOME, existent in project, default vendor folder location {should replace with warning/message}
  • 4. same as (1) but non-default vendor folder location
  • 5. same as (2) but non-default vendor folder location
  • 6. same as (3) but non-default vendor folder location
  • finds $FRCLOCAL only if it's at the beginning of the URL string {failed with an exception from the web access code}

Remote

  • valid URL, default folder location
  • invalid URL, default folder location
  • valid URL, nondefault folder location
  • invalid URL, nondefault folder location

@Starlight220
Copy link
Member Author

I now tested, the only issue I saw was that the overwriting warning isn't printed when fetching from remote.

@ThadHouse ThadHouse merged commit 3667849 into wpilibsuite:master Oct 17, 2020
@Starlight220 Starlight220 deleted the master branch November 14, 2020 18:16
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.

Implement a vendordep task for adding deps from the commandline
2 participants