To get started you only need to know a couple of tasks.
Next try running this command:
Finally, run the build command again:
Now try to execute this command:
A Basic Workflow
To start developing your library, you can follow the simple workflow described below.
Resource Link:
gradlew clean
gradlew test
gradlew build
gradlew build
,
a new directory was created in your project's root directory named
'build'. This directory contains all of the artifacts resulting from
building your project. - build/classes - The compiled Java classes
- build/test-results - The raw results of your unit tests
- build/reports - An html report displaying the results of your unit tests
- build/libs - The java-quickstart.jar library for your project
gradlew clean
This should result in the 'build' directory being deleted. At this point your project is back to its initial state.Next try running this command:
gradlew test
This command instructs Gradle to compile your Java source files,
execute your unit tests, and generate the test report. If all of your
tests passed you should see a 'BUILD SUCCESSFULL' message. Finally, run the build command again:
gradlew build
This command will instruct Gradle to compile your Java source files,
execute your unit tests, generate a test report, and assemble your jar.
You may notice that the some of the steps in the build output are
labelled 'UP-TO-DATE'. Gradle is smart enough to keep track of what
steps it has already executed and only execute them again if something
has changed. Now try to execute this command:
gradlew clean build
The result of running this command is the same as when you just the gradlew build
command. However, notice that most of the build steps in the console's
output no longer are marked as 'UP-TO-DATE'. This is because you told
Gradle to clean up the build directory before running the build. This
means that Gradle had to recompile the sources, rerun the tests,
regenerate the test report and finally generate the jar.A Basic Workflow
To start developing your library, you can follow the simple workflow described below.
- Develop a new feature with unit tests
gradlew test
- If tests fail, fix the code and go back to step 2
- If you need to add more features, go back to step 1
gradlew clean build
Resource Link:
No comments:
Post a Comment