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

Added error message if there are multiple jars in the candidate and b… #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mdmarshmallow
Copy link
Contributor

…aseline core build

if core_jar_file is None:
raise RuntimeError('can\'t find core JAR file in %s' % ('%s/lucene/build/core' % path))
if jars_found > 1:
raise RuntimeError('Found %d jars in %s, please only include 1 jar file' % (jars_found,'%s/lucene/build/core' % path))
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe change message to Found %d jars in "%s"; please run "gradle clean" to clean up or so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually just realized in this code path the build.gradle file wouldn't exist (see other comment). So then wouldn't gradle clean not work?

Copy link
Owner

Choose a reason for hiding this comment

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

OH, yes, then suggest ant clean here and gradle clean in the other code path? Or vice/versa :)

@@ -1536,12 +1539,15 @@ def getClassPath(checkout):

# We use the jar file for core to leverage the MR JAR
core_jar_file = None
jars_found = 0
for filename in os.listdir('%s/lucene/core/build/libs' % path):
if reCoreJar.match(filename) is not None:
core_jar_file = '%s/lucene/core/build/libs/%s' % (path, filename)
Copy link
Owner

Choose a reason for hiding this comment

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

Uh oh, why is this path different from the above path! Why are we doing this (differently!) in two places?

Copy link
Contributor Author

@mdmarshmallow mdmarshmallow Dec 21, 2021

Choose a reason for hiding this comment

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

This line in getClassPath line 1535:

  if not os.path.exists(os.path.join(path, 'build.gradle')):
    return getAntClassPath(checkout)

The top path is in getAntClassPath, and the bottom is getClassPath

Copy link
Owner

Choose a reason for hiding this comment

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

OK this is actually dead-ish code now, but let's leave it since sometimes we do go back and (try to) run luceneutil on older Lucene releases.

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