-
Notifications
You must be signed in to change notification settings - Fork 115
Migration to Bazel
@regisd is attempting to migrate the build of JFlex from Maven to Bazel.
- Maven main build system.
- Add Bazel BUILD on modules, one by one.
- Bazel main build system.
- Maven kept as a backup.
- People who want to simply use jflex, can download the targz distribution. The targz doesn't contain java sources.
- People who want to build clone the git repo and use bazel.
- Bazel unique build system.
- Remove obsolete code.
- Optional: reorganise directory structure.
https://github.com/jflex-de/jflex/pull/395
status: very easy, done PR #401
See bazel_rules
status: hard, not started
Ideally, we need to infer the deps to generate a pom.xml
status: Very easy, done on "simple". PR #401
status: Easy, done. PR #442
status: obsolete, won't do
status: easy (once cup rule and jflex rule are done), done PR #444
status: obsolete, won't do
status: hard, WIP
- custom test runner
- custom format to define test cases (.test)
- a lot of convention on the input name, the golden file name, etc.
- handling generation failure or compilation failures as expected
status: needs investigation
Anyone who wants to build from source clones the git repo and uses Maven.
The repo looks like this:
├── bazel-* [REMOVED for targz]
├── cup-maven-plugin [OBSOLETE, removed]
├── bin [MOVED from jflex/bin]
├── docs [OK]
├── examples [MOVED from jflex/examples]
├── jflex [OK]
│ ├── common-testing [REMOVED for targz]
│ └── src [OK]
├── jflex-maven-plugin [REMOVED for targz]
├── jflex-unicode-maven-plugin [REMOVED for targz]
├── report-module [OBSOLETE, removed]
├── scripts [REMOVED for targz]
├── src [OBSOLETE, removed]
├── testsuite [REMOVED for targz]
│ ├── bzltestsuite [NEW, replaces jflex-testsuite-maven-plugin]
│ ├── jflex-testsuite-maven-plugin [OBSOLETE, removed]
│ └── testcases
├── lib [UNCHANGED]
├── third_party [NEW]
└── tools [REMOVED for targz]
As a result, the targz has the following strucuture:
Distribution targz
├── bin
│ ├── jflex.bat
│ └── jflex.sh
├── docs [COPIED from bazel-bin]
│ ├── manual.html
│ └── manual.pdf
├── examples
├── jflex
│ └── src [OK]
├── lib [UNCHANGED; add jars copied from bazel-bin]
├── third_party
│ ├── cup
│ ├── com
│ └── org [etc.]
└── README.md LICENSE etc.
Note: for the distribution to avoid the bootstrap question, we can also copy relevant files from bazel-genfiles
:
bazel-genfiles
├── examples
│ └── simple
│ └── Yylex.java
└── jflex
├── LexParse.java
├── LexScan.java
└── sym.java
This is the flattest structure that works well with Maven and makes releasing the targz easy.
├── bin
│ └── jflex.bat
├── docs
│ ├── grammar.md
│ ├── intro.md
│ └── template.tex
├── java
│ └── jflex
│ ├── LexGenerator.java
│ ├── gui
│ ├── lexparse.flex
│ ├── lexscan.cup
│ ├── maven
│ │ └── JflexMojo.java
│ ├── testing
│ │ └── testsuite
│ │ └── TestRunner.java
│ └── unicode
│ └── UnicodeProperies.java
├── javatests
│ └── jflex
│ └── testsuite
│ └── apiprivate
│ ├── ApiPrivateTest.java
│ └── private.lex
├── scripts
│ ├── release.sh
│ └── travis.sh
└── third_party
├── com
│ └── google
│ └── guava
└── java
└── java_cup
├── java_cup-11b.jar
└── runtime
├── ComplexSymbolFactory.java
└── lr_parser.java