Commencez chaque script par une ligne shebang pour indiquer l'interpréteur à utiliser :
#!/bin/bashAssurez-vous que le script a les permissions d'exécution :
| package ${PACKAGE_NAME}; | |
| import java.awt.Color; | |
| import java.awt.Font; | |
| import java.awt.Frame; | |
| import java.awt.Graphics2D; | |
| import java.awt.RenderingHints; | |
| import java.awt.event.KeyEvent; | |
| import java.awt.event.WindowAdapter; | |
| import java.awt.event.WindowEvent; |
| #!/bin/bash | |
| #---- project parameters | |
| project_name=[[DEFAULT_APP_NAME]] | |
| project_version=[[DEFAULT_APP_VERSION]] | |
| main_class=[[DEFAULT_MAIN_CLASS]] | |
| vendor_name="[[DEFAULT_VENDOR_NAME]]" | |
| author_name=[[DEFAULT_AUTHOR_NAME]] | |
| JARS= | |
| SOURCE_VERSION="25" | |
| JAR_OPTS="-Xmx512m" |
| #!/bin/bash | |
| # build scripts (c) 2025 Frederic Delorme | |
| # | |
| # Please adapt the `project_name`, `project_version` and `main_class` variables to fit your own project. | |
| # The generated JARs will be named as target/build/[project_name]-[main_class]-[project_version].jar | |
| # | |
| # NOTE: `main_class` is a list of space separated classes to generate as many JAR as listed classes. | |
| # | |
| project_name=javabuildmini | |
| project_version=1.0.0 |
| package $APP_PACKAGE_NAME; | |
| import java.io.IOException; | |
| import java.time.LocalDateTime; | |
| import java.time.format.DateTimeFormatter; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.Properties; | |
| import java.util.ResourceBundle; | |
| /** |
| function generateBookSlideFromDataSheet() { | |
| var presentationTemplateId = '[SLIDE_GOOGLE_DOC_ID]'; | |
| var spreadSheetDataId = '[SPREADSHEET_GOOGLE_DOC_ID]'; | |
| var dataRange="[DATA_RANGE:'A2:J10']" | |
| var generatedBooksFolderId='[FOLDER_OUTPUT_GOOGLE_DOC_ID]'; | |
| var bookdata = Sheets.Spreadsheets.Values.get(spreadSheetDataId,dataRange); |
| public enum ConfigAttribute { | |
| CONFIG_FILE_PATH("configFile", | |
| "cf", | |
| "app.config.filepath", | |
| "The properties file path to be loaded as configuration", | |
| (v) -> v, | |
| "/config.properties"), | |
| TEST_MODE_EXIT("exit", "x", | |
| "app.exit", | |
| "Test mode only auto exit after initialization", |
| package com.java.simple.app; | |
| import java.io.IOException; | |
| import java.util.*; | |
| import java.util.concurrent.ConcurrentHashMap; | |
| import java.util.function.Function; | |
| /** | |
| * Main class for project JavaSimpleAppTemplate | |
| * |
The Java init script gives the opportunity to create simple java project with some build script.
UPDATE: add some example usages in help and fix anoying bug.
The created project
.sdkmanrc file,| title | version | description | createdAt | author | tag | |||||
|---|---|---|---|---|---|---|---|---|---|---|
Java Project Build script |
5.2 |
bring a very simple tool to compile java project to a jar file with JAR dependencies, execute unit test and check quality code. |
2023-10-23 |
|
java, build, unit-test, javadoc, doc, wrapjar, zip |