Skip to content

Add Java subproject allowing tasks to be programmed in Java with Python wrappers#7

Draft
Mac-Coleman wants to merge 75 commits intomainfrom
java
Draft

Add Java subproject allowing tasks to be programmed in Java with Python wrappers#7
Mac-Coleman wants to merge 75 commits intomainfrom
java

Conversation

@Mac-Coleman
Copy link
Collaborator

This pull request is to add support for tasks programmed in Java to be run on the sign.

Short summary:

  • The Maven project at c4_sign/java_c4sign can be compiled into a Jar file containing all the classes for the tasks written in Java.
  • The Maven project can be setup automatically on Unix-based systems by running bin/setup_java_project.sh
  • The Maven project can be compiled on Unix-based systems by running bin/compile_java_project.sh
  • The main Python program should start the Java server automatically on Unix-based systems...
  • The new Python class JavaTask is a wrapper for instances of Java classes that extend JavaTaskBase.
  • The Java class JavaTaskController has a static method getActiveTasks() that returns an ArrayList<JavaTaskBase> of all the tasks that can be run.
  • The Python program is made aware of these Java tasks when setting up all the tasks in ScreenManager.update_tasks by starting the Py4J gateway server, calling JavaTaskController.getActiveTasks(), and creating a Python JavaTask for each Java class discovered.

I'm not sure yet how robust my solution for setting up the Maven project is for everyone's install of Python, and it probably doesn't work natively for most Windows users...

@Mac-Coleman Mac-Coleman marked this pull request as draft November 22, 2024 08:39
@Mac-Coleman Mac-Coleman added the enhancement New feature or request label Nov 22, 2024
@Mac-Coleman Mac-Coleman marked this pull request as ready for review November 22, 2024 08:55
Copy link
Collaborator

@itsactuallyluna9 itsactuallyluna9 left a comment

Choose a reason for hiding this comment

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

overall, looks mostly good! there's just a few things that have to be changed :)

(there's also the whole windows thing we gotta figure out, but y'know)

* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah man I don't think these tests will pass.... \j

@itsactuallyluna9
Copy link
Collaborator

updated branch to main so we have pretty simulator :)

@Mac-Coleman Mac-Coleman marked this pull request as draft November 22, 2024 20:47
@Mac-Coleman Mac-Coleman self-assigned this Sep 3, 2025
@Mac-Coleman
Copy link
Collaborator Author

Writing a note to myself to remember what to continue thinking about before merging this in:

Currently, the --gif option struggles with JavaTasks because the script that does the conversion uses the python classname for each task, which is "JavaTask" for all the tasks written in Java. I think we might have to make it so that each task has a separate, unique, "canonical" name, and currently the classname and task title are not suitable. If adding a new field for this "canonical" name sounds good to you, I will try that.

As long as we're adding fields to these classes, I think it might also be useful to have a description field where task artists can explain what they made and what significance it holds to them. This field could be written into docs/screen_tasks.md and could serve as a useful introduction to the project and what kinds of things it can do. Does that sound good?

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants