← Back to team overview

syncany-team team mailing list archive

Re: Syncany running on OSX

 

On 06/23/2011 10:25 AM, Philipp Heckel wrote:
Hi Samúel,

Hi Philipp
looks good for a start. Maybe you can make your own Mac-branch on
Launchpad. It's really easy:

$ bzr branch lp:syncany
$ cd syncany
[make your changes]
$ bzr commit -m"mac stuff"
$ bzr push lp:~yourusername/syncany/mac

I pushed the changes I've made to the project at lp:sammi/syncany/mac . I have added:

   * Basic notification support with Growl (http://growl.info)
   * Ant target that bundles all relevant files into Syncany.app with
     JarBundler (http://informagen.com/JarBundler/).
   * Changes to BufferedWatcher.java so that is portable between
     operating systems.

I have tested Syncany.app on other osx machine and it works out of the box.
I saw that you chaned stuff in the BufferedWatcher and even in the
BSD* stuff of the jpathwatch implementation. Rewriting the
BufferedWatcher is no porblem because I wrote that one myself and it's
just a contribution to jpathwatch. But I see a little issue with
rewriting the stuff outside the "contrib/" directory of jpathwatch...
Do you think you could get it to work without changing that part?

Also, could you change the BufferedWatcher in a way that it will still
work on the other platforms? If it's easier, you can inherit and make
a MacBufferedWatcher. There are already some differences between
Windows and Linux, so that might be a good idea anyway. Let me know
what you think.
I looked at the documentation for jpathwatch and had to remove the BSD ENTRY_RENAME_FROM and ENTRY_RENAME_TO events since they are not supported in BSDPathWatchService.java. I have now made modification to the BufferedWatcher.java so that I checks for which operating system is running and assigns the right KIND instead of hardcoding it. The code that I changed outside of contrib directory was just for better read and is something that I did not intend to change. I do agree that It is probably best to create MacBufferedWatcher and other inheritance where we have to deal with mac specific issues. But for now I think that this small modification I've made to the BufferedWatcher.java does not need to be in a subbclass of BufferedWatcher.
Thanks for your support.
Likewise

Regards,
Sammi
Philipp

2011/6/22 Samúel Jón Gunnarsson<sammi@xxxxxxxxxxxxxxx>:
Hi All,

I have been hacking on syncany on mac and I now have a version that is buggy but running and syncing to a remote server via samba share.  The file open dialog is not working correctly so if I type in the path manually when setting up a new syncing profile. There is probably more that is not working but I haven't got around to test it.

Here are the modifications (diff) I made so that in order to getting syncany up and running on macosx. I have not worked with bzr vcs before so I have not committed my changes yet.

Regards,
Sammi


=== modified file 'syncany/bin/syncany.sh'
--- syncany/bin/syncany.sh      2011-06-05 20:41:13 +0000
+++ syncany/bin/syncany.sh      2011-06-21 00:17:12 +0000
@@ -97,7 +97,7 @@
  CLASSPATH="$DEPS:$CLASSPATH"

  # Call
-EXEC="$JAVA -Xms512m -cp $CLASSPATH -Dsyncany.home=$PRGDIR -Djava.library.path=$LIBDIR -Djava.util.logging.config.file=$PRGDIR/conf/logging.conf org.syncany.Syncany $@"
+EXEC="$JAVA -Xms512m -Xmx512m -cp $CLASSPATH -Dsyncany.home=$PRGDIR -Djava.library.path=$LIBDIR -Djava.util.logging.config.file=$PRGDIR/conf/logging.conf org.syncany.Syncany $@"

  echo $EXEC


=== modified file 'syncany/build.xml'
--- syncany/build.xml   2011-06-05 20:06:20 +0000
+++ syncany/build.xml   2011-06-21 17:16:22 +0000
@@ -12,6 +12,7 @@
     <property file="version.properties"/>
     <import file="nbproject/build-impl.xml"/>

+<import file="nbproject/management-build-impl.xml"/>
        <!-- Determine OS -->
        <condition property="isLinux"><os family="unix" /></condition>
        <condition property="isWindows"><os family="windows" /></condition>
@@ -226,3 +227,4 @@

     -->
  </project>
+

=== modified file 'syncany/nbproject/configs/dontpanic.properties'
--- syncany/nbproject/configs/dontpanic.properties      2011-05-28 22:03:36 +0000
+++ syncany/nbproject/configs/dontpanic.properties      2011-06-21 00:17:49 +0000
@@ -1,1 +1,1 @@
-run.jvmargs=-Xms512m -Dsyncany.home=. -Djava.library.path='lib/' -Djava.util.logging.config.file=conf/logging.conf -Dlog4j.configuration=conf/logging.conf
+run.jvmargs=-Xms512m -Xmx512m -Dsyncany.home=. -Djava.library.path='lib/' -Djava.util.logging.config.file=conf/logging.conf -Dlog4j.configuration=conf/logging.conf

=== modified file 'syncany/nbproject/project.properties'
--- syncany/nbproject/project.properties        2011-06-05 21:47:40 +0000
+++ syncany/nbproject/project.properties        2011-06-20 23:32:18 +0000
@@ -124,7 +124,7 @@
     ${file.reference.SSHTools-j2ssh-ext-0.1.0.jar}:\
     ${file.reference.jsch-0.1.44.jar}
  # Space-separated list of extra javac options
-javac.compilerargs=
+javac.compilerargs=-Xlint:deprecation
  javac.deprecation=false
  javac.processorpath=\
     ${javac.classpath}

=== modified file 'syncany/nbproject/project.xml'
--- syncany/nbproject/project.xml       2011-05-29 02:22:38 +0000
+++ syncany/nbproject/project.xml       2011-06-21 17:16:19 +0000
@@ -11,6 +11,7 @@
                 <root id="test.src.dir"/>
             </test-roots>
         </data>
+<data xmlns="http://www.netbeans.org/ns/jmx/1"; version="0.4"/>
         <spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1";>
             <word>Syncany</word>
         </spellchecker-wordlist>

=== modified file 'syncany/src/name/pachler/nio/file/contrib/BufferedWatcher.java'
--- syncany/src/name/pachler/nio/file/contrib/BufferedWatcher.java      2011-05-23 16:50:04 +0000
+++ syncany/src/name/pachler/nio/file/contrib/BufferedWatcher.java      2011-06-21 21:53:57 +0000
@@ -74,8 +74,9 @@
         StandardWatchEventKind.ENTRY_CREATE,
         StandardWatchEventKind.ENTRY_DELETE,
         StandardWatchEventKind.ENTRY_MODIFY,
-        ExtendedWatchEventKind.ENTRY_RENAME_FROM,
-        ExtendedWatchEventKind.ENTRY_RENAME_TO };
+     //   ExtendedWatchEventKind.ENTRY_RENAME_FROM,
+    //    ExtendedWatchEventKind.ENTRY_RENAME_TO
+    };

     private static final Modifier[] MODIFIERS = new Modifier[] {
         // ExtendedWatchEventModifier.FILE_TREE // Windows only!

=== modified file 'syncany/src/name/pachler/nio/file/impl/BSDPathWatchService.java'
--- syncany/src/name/pachler/nio/file/impl/BSDPathWatchService.java     2011-05-23 16:50:04 +0000
+++ syncany/src/name/pachler/nio/file/impl/BSDPathWatchService.java     2011-06-21 21:18:47 +0000
@@ -88,7 +88,12 @@
                int flags = makeFlagMask(kinds, modifiers);

                // check that user only provided supported flags and modifiers
-               int supportedFlags = (FLAG_FILTER_ENTRY_CREATE | FLAG_FILTER_ENTRY_DELETE | FLAG_FILTER_ENTRY_MODIFY | FLAG_FILTER_KEY_INVALID);
+               int supportedFlags = (
+                FLAG_FILTER_ENTRY_CREATE |
+                FLAG_FILTER_ENTRY_DELETE |
+                FLAG_FILTER_ENTRY_MODIFY |
+                FLAG_FILTER_KEY_INVALID
+                );
                if((flags&  ~supportedFlags) != 0)
                        throw new UnsupportedOperationException("The given watch event kind or modifier is not supported by this WatchService");


=== modified file 'syncany/src/org/syncany/Environment.java'
--- syncany/src/org/syncany/Environment.java    2011-06-05 20:41:13 +0000
+++ syncany/src/org/syncany/Environment.java    2011-06-21 00:24:20 +0000
@@ -91,7 +91,11 @@
         else if (System.getProperty("os.name").contains("Windows")) {
             operatingSystem = OperatingSystem.Windows;
             defaultUserConfDir = new File(System.getProperty("user.home")+"\\"+Constants.APPLICATION_NAME);
-        }
+        }
+        else if (System.getProperty("os.name").contains("Mac OS X")) {
+            operatingSystem = OperatingSystem.Mac;
+            defaultUserConfDir = new File(System.getProperty("user.home")+"/."+Constants.APPLICATION_NAME.toLowerCase());
+        }
         else {
             throw new RuntimeException("Your system is not supported at the moment: "+System.getProperty("os.name"));
         }

=== modified file 'syncany/src/org/syncany/config/Config.java'
--- syncany/src/org/syncany/config/Config.java  2011-06-05 21:26:56 +0000
+++ syncany/src/org/syncany/config/Config.java  2011-06-21 20:11:50 +0000
@@ -156,6 +156,8 @@
                 switch (env.getOperatingSystem()){
                     case Linux:
                         return new File(System.getProperty("user.home")+File.separator+".face");
+                    case Mac:
+                        return new File(System.getProperty("user.home")+File.separator+".face");
                     case Windows:
                         return new File(getConfDir()+File.separator+"profile.png");
                     default:

=== modified file 'syncany/src/org/syncany/gui/tray/Tray.java'
--- syncany/src/org/syncany/gui/tray/Tray.java  2011-06-03 20:55:56 +0000
+++ syncany/src/org/syncany/gui/tray/Tray.java  2011-06-21 00:34:30 +0000
@@ -28,6 +28,7 @@
  import java.util.ResourceBundle;
  import java.util.logging.Level;
  import java.util.logging.Logger;
+import org.syncany.gui.tray.mac.MacTray;

  /**
  *
@@ -74,6 +75,10 @@
             instance = new WindowsTray();
             return instance;
         }
+        else if (env.getOperatingSystem() == Environment.OperatingSystem.Mac) {
+            instance = new MacTray();
+            return instance;
+        }

         throw new RuntimeException("Your OS is currently not supported: "+System.getProperty("os.name"));
     }

=== added directory 'syncany/src/org/syncany/gui/tray/mac'
=== added file 'syncany/src/org/syncany/gui/tray/mac/MacTray.java'
--- syncany/src/org/syncany/gui/tray/mac/MacTray.java   1970-01-01 00:00:00 +0000
+++ syncany/src/org/syncany/gui/tray/mac/MacTray.java   2011-06-21 00:33:32 +0000
@@ -0,0 +1,23 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.syncany.gui.tray.mac;
+
+/**
+ *
+ * @author samueljon
+ */
+import java.io.File;
+import org.syncany.gui.tray.AbstractCommonTray;
+
+/**
+ *
+ * @author Philipp C. Heckel
+ */
+public class MacTray extends AbstractCommonTray {
+    @Override
+    public void notify(String summary, String body, File imageFile) {
+        System.err.println("NOT IMPLEMENTED"); // TODO do this!
+    }
+}

=== modified file 'syncany/src/org/syncany/watch/local/LocalWatcher.java'
--- syncany/src/org/syncany/watch/local/LocalWatcher.java       2011-05-23 16:50:04 +0000
+++ syncany/src/org/syncany/watch/local/LocalWatcher.java       2011-06-21 00:28:29 +0000
@@ -123,7 +123,8 @@
         }

         if (env.getOperatingSystem() == OperatingSystem.Linux
-            || env.getOperatingSystem() == OperatingSystem.Windows) {
+            || env.getOperatingSystem() == OperatingSystem.Windows
+                || env.getOperatingSystem() == OperatingSystem.Mac) {

             instance = new CommonLocalWatcher();
             return instance;




Follow ups

References