Skip to content

Commit

Permalink
🐛 Prevent gradle logic from decompressing jars all the time (#663)
Browse files Browse the repository at this point in the history
The gradle analysis was uncompressing jars every time because of a lack
of a check for the existence of the already decompressed directory.

- Related to https://github.com/konveyor/tackle2-hub/issues/667
- Partly fixes #662

Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
  • Loading branch information
jmle committed Jul 18, 2024
1 parent 00f45aa commit 389f5d8
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,14 @@ func (p *javaServiceClient) getURI(refURI string) (string, uri.URI, error) {
}
javaFileAbsolutePath = filepath.Join(filepath.Dir(sourcesFile), filepath.Dir(path), javaFileName)

cmd := exec.Command("jar", "xf", filepath.Base(sourcesFile))
cmd.Dir = filepath.Dir(sourcesFile)
err = cmd.Run()
if err != nil {
fmt.Printf("\n java error%v", err)
return "", "", err
if _, err := os.Stat(filepath.Dir(javaFileAbsolutePath)); err != nil {
cmd := exec.Command("jar", "xf", filepath.Base(sourcesFile))
cmd.Dir = filepath.Dir(sourcesFile)
err = cmd.Run()
if err != nil {
fmt.Printf("\n java error%v", err)
return "", "", err
}
}
}

Expand Down

0 comments on commit 389f5d8

Please sign in to comment.