- Java 100%
|
|
||
|---|---|---|
| example-src | ||
| .gitignore | ||
| build.java | ||
| Job.java | ||
| LICENSE | ||
| README.md | ||
Job - a nob.h Port with some Jai Flavours
A project should only need the language itself as build tool. This is the basic idea of nob.h.
I recommend to read the original README of nob.h to understand the
implications using such build system.
Limitations
The build.java example uses the current experimental feature "Implicitly declared classes"
which allows for a more procedural style of programming.
But since this is still in development, you might encounter some issues with that.
For example using the Compiler class as return type in the "file scope" like this:
void main(String[] args) {
Compiler c; // works fine
}
Compiler foo() {} // does not work; Symbol not found
You could work around those limitations, or you could code your build.java in
the traditional way.
Dependencies
You need:
- openjdk version >= 24.0.0
Nothing more.
Usage
- Place
Job.javain the root directory of your project - create a
build.javain the same directory (or use my example as starting point) - start developing your
build.javafile - Build your project with
java build.java
You can consult the build.java file in this repository for
a basic example.
Demo
You can try Job right now, execute the following command:
java build.java run -- foo bar 123
Output
$ java build.java run -- foo bar 123
[INFO]: Working Dir: /home/user/dev/job
[INFO]: created directory `/home/user/dev/job/build`
[INFO]: created directory `/home/user/dev/job/bin`
[INFO]: Debug build
Hello, World!
Arg: foo
Arg: bar
Arg: 123
It creates a few directories where the *.class files and *.jar is stored.
It also executes the program directly with every args after the double dash (--).