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

Fix skriptTest and similar tasks not working on Windows #2846

Merged
merged 3 commits into from
Mar 22, 2020

Conversation

Nicofisi
Copy link
Member

@Nicofisi Nicofisi commented Mar 3, 2020

Description

This PR fixes the skriptTest Gradle task not working on Windows, and the two other test tasks. It does so by changing the classpath file separator from : to ${File.pathSeparator}, which stands for : on Linux and Mac, and ; on Windows.

Relevant JavaDoc:

    /**
     * The system-dependent path-separator character.  This field is
     * initialized to contain the first character of the value of the system
     * property <code>path.separator</code>.  This character is used to
     * separate filenames in a sequence of files given as a <em>path list</em>.
     * On UNIX systems, this character is <code>':'</code>; on Microsoft Windows systems it
     * is <code>';'</code>.
     *
     * @see     java.lang.System#getProperty(java.lang.String)
     */
    public static final char pathSeparatorChar = fs.getPathSeparator();

    /**
     * The system-dependent path-separator character, represented as a string
     * for convenience.  This string contains a single character, namely
     * <code>{@link #pathSeparatorChar}</code>.
     */
    public static final String pathSeparator = "" + pathSeparatorChar;

Thanks for helping to test on Mac @ShaneBeee ;) 🌵


Target Minecraft Versions: any
Requirements: none
Related Issues: #2797

@Nicofisi Nicofisi added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Mar 3, 2020
@Nicofisi Nicofisi requested a review from ShaneBeee March 3, 2020 00:16
Copy link
Contributor

@ShaneBeee ShaneBeee left a comment

Choose a reason for hiding this comment

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

Thanks for helping to test on Mac @ShaneBeee ;) 🌵

You're welcome!

As Nico stated, I tested this on macOS and it works great 👍
Appears to build properly in the actions.

Looks good to me :)

@Nicofisi Nicofisi requested a review from bensku March 6, 2020 14:56
@bensku bensku merged commit 17ef848 into master Mar 22, 2020
@Nicofisi Nicofisi deleted the fix/skripttest-on-windows branch April 16, 2020 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants