Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added OSHelper class to help manage the differences between OS X and …

…other platforms.
  • Loading branch information...
commit c8807422dbbcd68a603e6b8a4c487397e411ac6c 1 parent 7cfb3af
Myron Marston authored
6 FractalComposer/src/com/myronmarston/music/notation/SheetMusicCreator.java
View
@@ -22,6 +22,7 @@
import com.myronmarston.music.OutputManager;
import com.myronmarston.util.ProcessRunner;
import com.myronmarston.util.FileHelper;
+import com.myronmarston.util.OSHelper;
import java.io.*;
import java.util.*;
import java.util.regex.*;
@@ -42,7 +43,10 @@
private static final Pattern LILYPOND_OR_GUIDO_OUTPUT_WARNING = Pattern.compile(".*?warning.*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
static {
- if (System.getProperty("os.name").equals("Mac OS X")) {
+ if (OSHelper.isMacOSX()) {
+ // The path environment variable works a bit differently on OS X, and I haven't
+ // found a way to get changes to the path to be picked up by netbeans when it
+ // runs the test suite...so we'll just manually set it here.
LILYPOND_EXE_FILE = "/Applications/LilyPond.app/Contents/Resources/bin/lilypond";
} else {
LILYPOND_EXE_FILE = "lilypond";
38 FractalComposer/src/com/myronmarston/util/OSHelper.java
View
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2008, Myron Marston <myron DOT marston AT gmail DOT com>
+ *
+ * This file is part of Fractal Composer.
+ *
+ * Fractal Composer is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option any later version.
+ *
+ * Fractal Composer is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Fractal Composer. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.myronmarston.util;
+
+/**
+ * Class with static helper methods to deal with operating system differences.
+ *
+ * @author myron
+ */
+public class OSHelper {
+
+ /**
+ * Checks to see if the current operating system is Mac OS X.
+ *
+ * @return true if the current OS is Mac OS X.
+ */
+ public static boolean isMacOSX() {
+ return System.getProperty("os.name").equals("Mac OS X");
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.