{"id":23665872,"url":"https://github.com/alfonsog-dev/javabuild","last_synced_at":"2025-12-08T11:30:14.510Z","repository":{"id":206326845,"uuid":"716266909","full_name":"AlfonsoG-dev/javaBuild","owner":"AlfonsoG-dev","description":"a basic java build tool for simple proyects","archived":false,"fork":false,"pushed_at":"2024-12-19T19:51:06.000Z","size":271,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T06:18:13.847Z","etag":null,"topics":["build-tool","clitool"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlfonsoG-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-08T19:26:54.000Z","updated_at":"2024-12-19T19:51:09.000Z","dependencies_parsed_at":"2023-11-22T06:23:47.218Z","dependency_job_id":"e58ebb8f-86c4-480a-8a39-f88e200b413b","html_url":"https://github.com/AlfonsoG-dev/javaBuild","commit_stats":null,"previous_names":["alfonsog-dev/javabuild"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlfonsoG-dev%2FjavaBuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlfonsoG-dev%2FjavaBuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlfonsoG-dev%2FjavaBuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlfonsoG-dev%2FjavaBuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlfonsoG-dev","download_url":"https://codeload.github.com/AlfonsoG-dev/javaBuild/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239665948,"owners_count":19677054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tool","clitool"],"created_at":"2024-12-29T06:18:26.221Z","updated_at":"2025-12-08T11:30:14.453Z","avatar_url":"https://github.com/AlfonsoG-dev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java build tool\n- basic build tool for simple java projects\n- build the project with 1 or 3 simple commands\n- It works on WINDOWS \u0026 LINUX\n\n![expected output](./docs/build_command.png)\n\n-----\n\n# Dependencies\n- [java_jdk_17.0.8](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)\n- [powershell](https://www.microsoft.com/store/productId/9MZ1SNWT0N5D?ocid=pdpshare)\n\n# References\n- [compile_references](https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html)\n- [create_jar_references](https://docs.oracle.com/javase/tutorial/deployment/jar/index.html)\n- [run_java_references](https://docs.oracle.com/en/java/javase/21/docs/specs/man/java.html)\n- [executables_from_jar_linux](https://stackoverflow.com/questions/44427355/how-to-convert-jar-to-linux-executable-file)\n\n------\n\n# Features \n- [x] compile the project to bin.\n- [x] extracts the jar files inside lib to create later the project jar file.\n- [x] create the project jar file.\n- [x] run the project without using jar files.\n- [x] build the project, combine the 3 previously mention.\n- [x] create the folder structure of the project.\n- [x] create the run powershell script and executes the project.\n- [x] add cli option to the create build script to allow the user to name the script.\n\n# TODO's\n- [ ] add to the *--add* CLI command the aggregation of modules like the ones of *JavaFX*\n- [ ] implement the module aggregation for compile, run, create-jar, execution script\n \n------\n\n# How to\n\n- use the `.ps1` script to build the project.\n```shell\nbuild.ps1\n\nor\n\n./build.sh\n```\n\u003e- it will build the project and create the jar file to use for the *.exe* file creation.\n\u003e- now you have the jar file to test the project functionality.\n\n# Usage\n\n- use the executable\n\u003e- This will print the **cli** commands that you can used.\n```console\njavabuild --h\n```\n\u003e- use the jar file to execute the program for the same purpose.\n```console\njava -jar JavaBuild.jar --h\n```\n\n## Manifesto usage\n\n- when the app have dependencies in *lib* folder you need to specify in the *Manifesto* file if you want to \ninclude the extraction files of the lib dependency or you need to declara in the *Manifesto* the class path \nof the lib dependencies\n\n```text\nCreated-By: Author-Name\nMain-Class: App\nClass-Path: .\\lib\\dependencyFolder\\dependency.jar\n```\n- when you declare the Class-Path the build operation when trying to create the project *.jar* file, it exclude\nthe extraction files of the lib dependency.\n\n\u003e- if you don't declare the Class-Path the build operation when trying to create the project *.jar* file, now \nincludes the extraction files of the lib dependency as part of the project *.jar* creation.\n\n## list project files\n\n- Use this to list the java *class* files inside the given folder.\n```shell\njavaBuild -ls .\\src\\\n```\n\n## Crete a project\n\n- Use this to create the structure for the project.\n\u003e- You need to provide the author\n```shell\njavaBuild -cb Author-Name\n```\n\u003e- As soon you create the project you need to change the manifesto adding the main class.\n```shell\njavaBuild --i\n```\n\u003e- This will add the main class value to the manifesto.\n\n## Compile\n\n- to compile the project.\n\u003e- `javaBuild -cm`.\n\u003e\u003e- it compiles the .java clases into bin.\n\u003e\u003e- you can give a folder path to indicate the directory where you want to place the compiled files.\n\u003e\u003e- The default folder for the *class* files is **.\\bin\\**\n```pwsh\njavabuild -cm .\\other\\target\n```\n\n## Create a jar file of the project\n\n- to create a jar file is necessary to include or verify dependencies or libraries in the project.\n\u003e- in order to create the jar file we need to extract the content of all the jar files inside lib into: `extractionFiles`.\n\u003e- use the extracted files to include the library files in the build process of the project *.jar* file.\n\u003e\u003e- `javaBuild -ex`.\n\n- now to create the project jar file.\n\u003e- `javaBuild -cx`.\n\u003e- it also can be created using source folder as parameter:\n```pwsh\njavabuild -cx .\\testing\\\n```\n\u003e- remember that the manifesto determines the behavior for the build process.\n\n## Create the build script\n\n- Use this to create the build script for **powershell** in windows and **bash** for linux.\n\u003e- Creates the script whit all the command to build the project, except the extraction operation.\n\u003e- And at last it executes the project.\n```shell\njavaBuild -cr\n```\n\n## Create or modify the manifesto file\n- The manifesto file, is necessary to include or verify if you want to add to the build the extraction of the dependencies or not.\n\u003e- To include the extraction files of a dependency: `javabuild --i` otherwise `javabuild --i n` \n\n## Build the project\n\n- All can be done with only 1 command\n\u003e- It combines the commands: *compile* \u0026 *create jar* to build the project.\n\u003e- The extraction of the jar dependency need to execute manually with: `-ex` and only one time per jar dependency.\n\u003e- If you have configured the manifesto the dependency extraction will behave as describe previously.\n```shell\njavaBuild --build\n```\n\u003e\u003e- Also you can give the source folder of the **class** files.\n\u003e\u003e- If not *.\\bin\\* will be use\n```shell\njavaBuild --build -s .\\testing\\\n```\n\n## Run or execute the project\n\n- Uses the class files and the main class to execute and run the application.\n\u003e- it compiles to *.\\bin\\* folder and executes the project using the .class files.\n\u003e- you can specify the java class that you want to execute: \n```pwsh\njavabuild --run .\\src\\App.java\n```\n\u003e- you can give also the source directory\n```pwsh\njavabuild --run .\\src\\App.java -s .\\testing\\\n```\n\u003e\u003e- if you don't give the class to execute the main class is selected\n\u003e\u003e- additional you can execute CLI command with this method too\n```pwsh\njavabuild --run --h\n```\n\n## Add an external jar dependency\n\n- Used to add a framework or library file type *.jar*.\n\u003e- `javabuild --add dependency.jar`\n\u003e\u003e- add an external jar file to the lib folder of the project\n\u003e- or you can use the directory name\n\u003e- `javabuild --add ./folderName`\n\u003e\u003e- Only works when the lib file don't contain modules.\n\n------\n\n# Additional info\n\nThis project use [javaBuild_tool](https://github.com/AlfonsoG-dev/javaBuild) to build itself.\n\u003e- this app uses **powershell** to execute the commands on *WINDOWS*.\n\u003e- this app uses **bash** to execute commands on *LINUX*.\n\u003e- if you want to use the *CLI* tool you have to create an `.exe` file and place it in system path\n\u003e- for **LINUX**\n```bash\n$ echo '#!/usr/bin/java -jar' \u003e myBin\n$ cat my.jar \u003e\u003e myBin\n$ chmod +x myBin\n$ ./myBin\n```\n- with that you can create an **environment variable** and use it from there.\n\n------\n\n# Disclaimer\n- this project is for educational purposes.\n- security issues are not taken into account.\n- Use it at your own risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfonsog-dev%2Fjavabuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfonsog-dev%2Fjavabuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfonsog-dev%2Fjavabuild/lists"}