[Improvement] Simplify compilation by compiling scripts
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 935
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 298
Description
### What would you like to be improved?
### Description
We will create a shell script (build.sh) that presents the user with a menu of build options. The user can select the desired build option, and the script will execute the corresponding build command. This reduces the need to manually type out build commands, making the process more convenient and less error-prone.
### Sample build.sh Script
```
#!/bin/bash
### Define build options
buildOptions=(
"Only compile and skip the unit test and Integration test: ./gradlew clean build -x test"
"Only execute the unit test and skip Integration test: ./gradlew test -PskipITs"
"Run the integration tests in embedded mode: ./gradlew build -x test && ./gradlew test -PskipTests -PtestMode=embedded"
"Run the integration tests in deploy mode: ./gradlew build -x test && ./gradlew compileDistribution && ./gradlew test -PskipTests -PtestMode=deploy"
"Exit"
)
```
I think the purpose of the proposal is to make it easy for use to compile and test the Gravitino project, So I think we didn't need to support complex gradle of command, It would make the script very difficult to maintain.
I think we can support the following:
#### Memu 1: Only compile and skip the unit test and Integration test:
```
./gradlew clean build -x test"
```
#### Memu 2: Only execute the unit test and skip the Integration test:
```
./gradlew test -PskipITs
```
#### Memu 3: Run the integration tests in embedded mode:
```
./gradlew build -x test && ./gradlew test -PskipTests -PtestMode=embedded
```
#### Memu 4: Run the integration tests in deploy mode:
```
./gradlew build -x test && ./gradlew compileDistribution && ./gradlew test -PskipTests -PtestMode=deploy
```
#### Exit Memu: Exit
### Reference
I think we can refer some build command of
1. https://github.com/apache/gravitino/tree/main/.github/workflows
2. https://github.com/apache/gravitino/blob/main/docs/how-to-build.md
3. https://github.com/apache/gravitino/blob/main/docs/how-to-test.md
### How should we improve?
https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script
Contributor guide
Research direction
Start by reading the build commands in .github/workflows, docs/how-to-build.md, and docs/how-to-test.md, then inspect the repository location where build.sh should live. Verify the script presents the four listed build and test options plus Exit, and that each selection runs its documented command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, shell
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100