Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
@@ -22,6 +22,7 @@
22 22 import com.myronmarston.music.OutputManager;
23 23 import com.myronmarston.util.ProcessRunner;
24 24 import com.myronmarston.util.FileHelper;
  25 +import com.myronmarston.util.OSHelper;
25 26 import java.io.*;
26 27 import java.util.*;
27 28 import java.util.regex.*;
@@ -42,7 +43,10 @@
42 43 private static final Pattern LILYPOND_OR_GUIDO_OUTPUT_WARNING = Pattern.compile(".*?warning.*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
43 44
44 45 static {
45   - if (System.getProperty("os.name").equals("Mac OS X")) {
  46 + if (OSHelper.isMacOSX()) {
  47 + // The path environment variable works a bit differently on OS X, and I haven't
  48 + // found a way to get changes to the path to be picked up by netbeans when it
  49 + // runs the test suite...so we'll just manually set it here.
46 50 LILYPOND_EXE_FILE = "/Applications/LilyPond.app/Contents/Resources/bin/lilypond";
47 51 } else {
48 52 LILYPOND_EXE_FILE = "lilypond";
38 FractalComposer/src/com/myronmarston/util/OSHelper.java
... ... @@ -0,0 +1,38 @@
  1 +/*
  2 + * Copyright 2008, Myron Marston <myron DOT marston AT gmail DOT com>
  3 + *
  4 + * This file is part of Fractal Composer.
  5 + *
  6 + * Fractal Composer is free software: you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License as published by
  8 + * the Free Software Foundation, either version 3 of the License, or
  9 + * at your option any later version.
  10 + *
  11 + * Fractal Composer is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + *
  16 + * You should have received a copy of the GNU General Public License
  17 + * along with Fractal Composer. If not, see <http://www.gnu.org/licenses/>.
  18 + */
  19 +
  20 +package com.myronmarston.util;
  21 +
  22 +/**
  23 + * Class with static helper methods to deal with operating system differences.
  24 + *
  25 + * @author myron
  26 + */
  27 +public class OSHelper {
  28 +
  29 + /**
  30 + * Checks to see if the current operating system is Mac OS X.
  31 + *
  32 + * @return true if the current OS is Mac OS X.
  33 + */
  34 + public static boolean isMacOSX() {
  35 + return System.getProperty("os.name").equals("Mac OS X");
  36 + }
  37 +
  38 +}

0 comments on commit c880742

Please sign in to comment.
Something went wrong with that request. Please try again.