-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Warns the user if specified mainClass is not a valid Java class. #228
Conversation
@@ -30,6 +30,8 @@ | |||
/** Immutable configuration options for the builder process. */ | |||
public class BuildConfiguration { | |||
|
|||
public static final String VALID_JAVA_CLASS_REGEX = "([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh confusing, can you comment on top of this, what this means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually never mind, the tests are good.
public void testValidJavaClassRegex() { | ||
Assert.assertTrue("my.Class".matches(BuildConfiguration.VALID_JAVA_CLASS_REGEX)); | ||
Assert.assertTrue("my.java_Class$valid".matches(BuildConfiguration.VALID_JAVA_CLASS_REGEX)); | ||
Assert.assertFalse("${start-class}".matches(BuildConfiguration.VALID_JAVA_CLASS_REGEX)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you verify that is123.valid
works?
and that mutliple package items work? abc.xyz.Valid
Changed the regex method to rather use the built-in method for checking valid Java identifiers. |
Fixes #206
Fixes #170