Skip to content

Conversation

@lsf37
Copy link
Member

@lsf37 lsf37 commented Feb 27, 2020

  • use com.github.vbmacher:java-cup{-runtime} instead
  • update mvn and bazel deps
  • move cup-sample-project into cup-maven-plugin

This should enable a JFlex build from source from a release package outside our own repo.

@lsf37 lsf37 added this to the 1.8.1 milestone Feb 27, 2020
@lsf37 lsf37 self-assigned this Feb 27, 2020
@lsf37 lsf37 requested a review from regisd February 27, 2020 10:17
@lsf37 lsf37 changed the title retire our own cup-packaging [wip] retire our own cup-packaging Feb 27, 2020
@lsf37 lsf37 force-pushed the cup-jar branch 4 times, most recently from 50a30a5 to 7ac9558 Compare February 27, 2020 12:34
@lsf37 lsf37 changed the title [wip] retire our own cup-packaging retire our own cup-packaging Feb 27, 2020
@lsf37
Copy link
Member Author

lsf37 commented Feb 27, 2020

Ok, this is now ready for review.

Having java-cup-runtime and java-cup as external dependency in maven and bazel seems to be working fine and fixes the release package problem. It looks like I already did use that dependency for ant in the examples and had forgotten about it, so they're now actually all using the same setup.

@regisd
Copy link
Member

regisd commented Feb 27, 2020

I'm fine with it. Just want to point out that

Copy link
Member

@regisd regisd left a comment

Choose a reason for hiding this comment

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

I guess a follow-up step is to remove our version of cup-maven-plugin and use vbmacher's one instead

@lsf37
Copy link
Member Author

lsf37 commented Feb 28, 2020

Yes, he even says it's not actively maintained apart from tracking CUP releases, although he is taking pull requests. We may need to change again for the next CUP release, but it looks like they are rare now.

  • I thought you wanted to keep track of the cup code to see diffs across versions

Indeed, that is the disadvantage of this solution. It was more important to me when there were still CUP releases every year or so, but I might still regret dropping the source from our repo when the next one comes out. At least CUP is now using git and quoting the hash for their release, so it's a bit easier to keep track of what's changing. I'm willing to risk it. The alternative would be to add source for our own java_cup package and publish that, but it looks like that will be more work than is justified by the benefit of the diff.

Instead of adding it to third_party? We could still do that later after 1.8.1.

@lsf37
Copy link
Member Author

lsf37 commented Feb 28, 2020

I guess a follow-up step is to remove our version of cup-maven-plugin and use vbmacher's one instead

I tried using it, but it's a bit awkward, i.e. needs explicit naming of className and cupDefinition, and doesn't seem to be able to deal with classes without package as we use in the examples.

We could raise PRs for that based on our own plugin, though, and make it work. The vmbacher plugin does support pretty much all options that CUP provides, so that might indeed be the shortest path to a cup plugin with support for everything we want.

@lsf37 lsf37 merged commit 24e448f into master Feb 28, 2020
@lsf37 lsf37 deleted the cup-jar branch February 28, 2020 01:34
regisd added a commit to regisd/jflex that referenced this pull request Mar 28, 2020
regisd added a commit that referenced this pull request Mar 28, 2020
* Exclude all generated code from error-prone.

* Remove cup from the XepExcludedPaths
Follow-up of #734

* Make fields final.
  https://errorprone.info/bugpattern/FieldCanBeFinal

* Remove reference equality
  https://errorprone.info/bugpattern/ReferenceEquality

* Keep UnnecessaryParentheses disabled

```
jflex/src/main/java/jflex/generator/Emitter.java:1173: error: [UnnecessaryParentheses] Unnecessary use of grouping parentheses
          println("            case " + (++last) + ": break;");
                                        ^
    (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
  Did you mean 'println("            case " + ++last + ": break;");'?
```

https://errorprone.info/bugpattern/UnnecessaryParentheses

* Reenable CatchAndPrintStackTrace

Nothing to fix

* Fix DefaultCharset
Also Replace guava Charsets by java StandardCharsets

https://errorprone.info/bugpattern/DefaultCharset

LexScan was already fixed in #470

* Fix ConstructorInvokesOverridable

make methods final.
https://errorprone.info/bugpattern/ConstructorInvokesOverridable

SuppressWarnings for OptionsDialog.java

* Add default case to switch statements

https://errorprone.info/bugpattern/MissingDefault

* Enable Unused  at ERROR

Suppress warnings on WIP ucd_generator

https://errorprone.info/bugpattern/Unused

* Enable UnusedException as ERROR

Fix violations when possible
SuppressWarnings otherwise

https://errorprone.info/bugpattern/UnusedException

* Keep Var OFF

it's quite controversial and there are tons of violations.
https://errorprone.info/bugpattern/Var

* Fix MixedArrayDimensions

Rewrite C-style array declaration.

https://errorprone.info/bugpattern/MixedArrayDimensions

* Fix MethodCanBeStatic

https://errorprone.info/bugpattern/MixedArrayDimensions

* Fix WildcardImport

List imports  explicitly

https://errorprone.info/bugpattern/WildcardImport
regisd pushed a commit that referenced this pull request Mar 28, 2020
commit 48787cf
Author:     Régis Décamps <[email protected]>
AuthorDate: Sat Mar 28 21:50:42 2020 +0100
Commit:     GitHub <[email protected]>
CommitDate: Sat Mar 28 21:50:42 2020 +0100

    Minor: Address Error prone warnings (#749)

    * Exclude all generated code from error-prone.

    * Remove cup from the XepExcludedPaths
    Follow-up of #734

    * Make fields final.
      https://errorprone.info/bugpattern/FieldCanBeFinal

    * Remove reference equality
      https://errorprone.info/bugpattern/ReferenceEquality

    * Keep UnnecessaryParentheses disabled

    ```
    jflex/src/main/java/jflex/generator/Emitter.java:1173: error: [UnnecessaryParentheses] Unnecessary use of grouping parentheses
              println("            case " + (++last) + ": break;");
                                            ^
        (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
      Did you mean 'println("            case " + ++last + ": break;");'?
    ```

    https://errorprone.info/bugpattern/UnnecessaryParentheses

    * Reenable CatchAndPrintStackTrace

    Nothing to fix

    * Fix DefaultCharset
    Also Replace guava Charsets by java StandardCharsets

    https://errorprone.info/bugpattern/DefaultCharset

    LexScan was already fixed in #470

    * Fix ConstructorInvokesOverridable

    make methods final.
    https://errorprone.info/bugpattern/ConstructorInvokesOverridable

    SuppressWarnings for OptionsDialog.java

    * Add default case to switch statements

    https://errorprone.info/bugpattern/MissingDefault

    * Enable Unused  at ERROR

    Suppress warnings on WIP ucd_generator

    https://errorprone.info/bugpattern/Unused

    * Enable UnusedException as ERROR

    Fix violations when possible
    SuppressWarnings otherwise

    https://errorprone.info/bugpattern/UnusedException

    * Keep Var OFF

    it's quite controversial and there are tons of violations.
    https://errorprone.info/bugpattern/Var

    * Fix MixedArrayDimensions

    Rewrite C-style array declaration.

    https://errorprone.info/bugpattern/MixedArrayDimensions

    * Fix MethodCanBeStatic

    https://errorprone.info/bugpattern/MixedArrayDimensions

    * Fix WildcardImport

    List imports  explicitly

    https://errorprone.info/bugpattern/WildcardImport

Updated from target/jflex-parent-1.9.0-SNAPSHOT-sources.jar
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.

3 participants