Generate jave files using maven (#4133)
generate generated-java files using maven instead of by build.sh
This commit is contained in:
@ -34,23 +34,23 @@ under the License.
|
||||
|
||||
### Code Generation
|
||||
|
||||
The FE module requires part of the generated code, such as Thrift, Protobuf and other frameworks. This part needs to be generated by compiling the contents of the `gensrc/` directory in the Linux environment.
|
||||
The FE module requires part of the generated code, such as Thrift, Protobuf, Jflex, CUP and other frameworks.
|
||||
|
||||
1. Under Linux, enter the source code directory and execute the following command:
|
||||
1. Under Linux, enter the source code directory `fe` and execute the following command:
|
||||
|
||||
```
|
||||
sh build.sh --clean --fe
|
||||
```
|
||||
```
|
||||
mvn generate-sources
|
||||
```
|
||||
|
||||
2. Then package the generated `gensrc/build/java` directory:
|
||||
2. If use windows as development environment, then package the generated `fe/fe-core/target/generated-sources` directory:
|
||||
|
||||
`cd gensrc/build/ && tar czf java.tar.gz java/`
|
||||
`fe/fe-core/target/ && tar czf java.tar.gz generated-sources/`
|
||||
|
||||
3. Copy `java.tar.gz` to the `fe/` directory of the development environment and unzip
|
||||
3. Copy `java.tar.gz` to the `fe/fe-core/target/` directory of the development environment and unzip
|
||||
|
||||
```
|
||||
cp java.tar.gz /path/to/doris/fe/
|
||||
cd /path/to/doris/fe/ && tar xzf java.tar.gz
|
||||
cp java.tar.gz /path/to/doris/fe/fe-core/target/
|
||||
cd /path/to/doris/fe/fe-core/target/ && tar xzf java.tar.gz
|
||||
```
|
||||
|
||||
## Import FE project
|
||||
@ -126,13 +126,12 @@ You can directly start an FE process in Ecplise to facilitate debugging the code
|
||||
|
||||
## Code Update
|
||||
|
||||
1. Update lexical and grammar files
|
||||
1. Update lexical and grammar files or proto and thrift files
|
||||
|
||||
If you modified `fe/src/main/cup/sql_parser.cup` or `fe/src/main/jflex/sql_scanner.flex` file. You need to execute the following commands in the `fe/` directory:
|
||||
If you modified `fe/src/main/cup/sql_parser.cup` or `fe/src/main/jflex/sql_scanner.flex` file or proto and thrift files. You need to execute the following commands in the `fe/` directory:
|
||||
|
||||
```
|
||||
mvn de.jflex:maven-jflex-plugin:1.4.3:generate
|
||||
mvn net.sourceforge.czt.dev:cup-maven-plugin:1.6-cdh:generate
|
||||
mvn generate-sources
|
||||
```
|
||||
|
||||
Then refresh the project in Eclipse.
|
||||
|
||||
Reference in New Issue
Block a user