Java no-build system. Port from nob.h
Find a file
2025-11-19 02:33:56 +01:00
example-src first 2025-11-16 08:36:10 +01:00
.gitignore first 2025-11-16 08:36:10 +01:00
build.java updated the example to v1.2.0 2025-11-19 02:06:25 +01:00
Job.java When compiling via javac, all found java files where passed as single string, instead as a list; The Manifest file always landed in the directory and didn't allowed for a custom path 2025-11-19 01:58:47 +01:00
LICENSE first 2025-11-16 08:36:10 +01:00
README.md adapted example in readme to 1.2.0 2025-11-19 02:33:38 +01:00

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.java in the root directory of your project
  • create a build.java in the same directory (or use my example as starting point)
  • start developing your build.java file
  • 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 (--).