Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript will no longer work in Ant build files #23

Open
martindholmes opened this issue Dec 16, 2020 · 8 comments
Open

JavaScript will no longer work in Ant build files #23

martindholmes opened this issue Dec 16, 2020 · 8 comments

Comments

@martindholmes
Copy link
Collaborator

...when run in Oxygen, due to its bundling Java 15, and we can expect the same at the command line eventually because of the long-threatened removal of Nashorn. We need to find another way for people to choose a directory, and to show a generated web page in a local browser.

@martindholmes
Copy link
Collaborator Author

@joeytakeda Can you test on Mac and see if a hard-coded exec calling firefox, as I've encoded in the build file now, will work on Mac too? Could you also test with safari, which we know will be there on a Mac?

@joeytakeda
Copy link
Collaborator

Doesn't work, unfortunately--Mac installs don't tend to create executables (I would have to had installed firefox using Homebrew: brew install --cask firefox but my computer is managed by my institution, so Firefox came pre-packaged).

In Mac, using open should work, which opens an HTML file in the default browser:

open $diagnosticsFile

But not sure how that would work with Linux, though (or Windows, of course)

@martindholmes
Copy link
Collaborator Author

Ah, that'll do -- I'll try that on Linux...

@martindholmes
Copy link
Collaborator Author

martindholmes commented Dec 16, 2020

Nope, no good. I think I'll leave firefox for unix and windows; meanwhile, if you can add this:

    <condition property="isMac">
        <os family="mac" />
    </condition>

and get "open" to run for mac but not Linux, that would be great. I'm not sure whether "unix" is true for both.

joeytakeda added a commit that referenced this issue Dec 17, 2020
@joeytakeda
Copy link
Collaborator

That doesn't work for me--mac is false and unix is true. Per http://ant.apache.org/manual/Tasks/conditions.html:

mac—for all Apple Macintosh systems prior to Mac OS X
unix—for all Unix(-like) operating systems, including Linux and Mac OS X/macOS

But I've just sent up a commit that runs the uname command to test what kind of unix OS it is (per https://stackoverflow.com/questions/19500112/can-i-detect-if-i-am-on-a-linux-system-and-not-a-generic-unix-system-using-ant). Which seems to work well. Let me know if that works for you.

@martindholmes
Copy link
Collaborator Author

That works for me. Let's leave it there until I can test on my work Windows vm. But we are going to get badly bitten by this Nashorn thing; any of our build files that use JavaScript will have to be rewritten asap.

@martindholmes
Copy link
Collaborator Author

Just flagging up that this is now thoroughly broken. We should remove the dependency on Nashorn before the scheduled end of the Endings project in March 2023.

@joeytakeda
Copy link
Collaborator

Just re-reading this thread and it seems we were focused on the opening stuff, but not the directory / file chooser. I wonder if we should just toss that entirely and say people need to set the directory at the command line (or use a prop file)?

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

No branches or pull requests

2 participants