Skip to content

Conversation

kwrooijen
Copy link
Contributor

This feature adds the ability to compile your clojure code using the Godot Headless Client. This way you don't manually have to compile your Clojure code from within the REPL, instead you can run the following command:

bashgodot3-headless -d ArcadiaGodot/Compiler.tscn --src "." --target my/export/directory

This also enables us to compile CLJ files from our CI/CD.

@kwrooijen
Copy link
Contributor Author

Once #22 is merged we can omit the --src and instead use the :source-paths key in configuration.edn. We can also add an additional key such as :target-dir or :release-dir so that the --target key can also be omitted. With those changes we can even run the scene in the Godot editor itself to compile CLJ files without a CLI tool.

(aot dlls-dir namespaces)))

(defn- file-namespace [file]
(-> file (slurp :enc "utf-8") edn/read-string second symbol))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function assumes that the first statement of the file is (ns <namespace> ,,,). Maybe there's a more reliable way to find a file's namespace?

@kwrooijen
Copy link
Contributor Author

kwrooijen commented Jun 30, 2021

@selfsame I've updated this PR so that the Compiler.tscn scene will look in configuration.edn for the :source-paths and :target-path keys. All you have to do now is run the Compiler.tscn either through the command-line or Godot editor and everything gets compiled nicely! If you could try this out, that would be great. If it works as expected then I don't see a reason to keep the manually compilation in the README.md.

@bfollington
Copy link
Contributor

I think this is a very nice addition in terms of developer / onboarding experience, any chance of getting this one merged @selfsame?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants