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

Write jnigen_maven_downloads.json to maven directories, and only rerun maven when required. #742

Closed
mahesh-hegde opened this issue Oct 7, 2022 · 3 comments
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue

Comments

@mahesh-hegde
Copy link
Contributor

maven commands take significant time in tests. So why not

  • write a maven_downloads.json file to download folder containing last download config.
  • Check the file before invoking maven.
  • invoke maven command only if dependencies are changed.
@mahesh-hegde
Copy link
Contributor Author

mahesh-hegde commented Mar 22, 2023

To be more elaborate, maven doesn't re-download from the internet every time. It has a local cache in ~/.m2 . However, invoking maven itself is a source of slowness.

Possible design:

maven_downloads.json

{
    "comment": "This file avoids the need to invoke maven every time, which can be slow. Delete this file to force refresh"
    "downloaded_on": "date"
    "source_deps": [""]
    "jar_deps": [""]
}

TODO: Invalidation

Re-download is triggered when:

conservative caching:

  • Any file in the directory is older than jnigen.yaml

aggressive caching:

  • Compare maven_downloads spec by content. If any dependency is changed

Other criteria to invalidate: (can be used in conjunction)

  • stale downloads: If downloads are older than a predefined timeout

  • anomalies: JSON file older than any of the downloads.

TODO: Manual invalidation

  • by CLI-only flag --force-invoke-maven

or

  • disable caching in YAML, which can be overridden by CLI as well.

@mahesh-hegde
Copy link
Contributor Author

cc: @dcharkes

@mahesh-hegde mahesh-hegde mentioned this issue Mar 22, 2023
6 tasks
@HosseinYousefi HosseinYousefi added the closed-not-planned Closed as we don't intend to take action on the reported issue label Aug 24, 2023
@HosseinYousefi
Copy link
Member

I think there is a case to be made to completely remove maven support from jnigen's main workflow. We might instead add some helper scripts like dart run jnigen:maven_init that create the intial pom.xml files in the directory.

Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants