Commits

Meikel Brandmeyer  committed 3c4c4bc

Simplified plugin installation

  • Participants
  • Parent commits f257542
  • Tags v2.1.2

Comments (0)

Files changed (2)

 clojure.jar=/path/to/clojure.jar
 clojure-contrib.jar=/path/to/clojure-contrib.jar
 nailgun-client=ng
-vimdir=/path/to/install/vim/plugin
+vimdir=/custom/installation/path/for/vimplugin
 ––8<––––8<––––8<––
 
 Once you have created this file, simply run ant. This should give a
 when building the nailgun-client. That's ok.
 
 Running „ant install“ will install the vim plugin into the named directory.
+If you omit the vimdir line in the local.properties file the vim plugin
+will be installed in the user's runtime directory – <home>/.vim on Unic/Mac,
+<home>\vimfiles on Windows.
 
 To run the Nailgun server you need the clojure.jar, clojure-contrib.jar and
 vimclojure.jar in your Classpath:
     <target name="clean-all" depends="clean-lib,clean"
         description="--> clean all project files"/>
 
-    <target name="install" if="vimdir"
+    <target name="install"
         description="--> install the vim plugin">
+        <condition property="do.custom.install">
+            <isset property="vimdir"/>
+        </condition>
+        <condition property="do.windows.install">
+            <and>
+                <not><isset property="vimdir"/></not>
+                <os family="windows"/>
+            </and>
+        </condition>
+        <condition property="do.unix.install">
+            <and>
+                <not><isset property="vimdir"/></not>
+                <os family="unix"/>
+            </and>
+        </condition>
+        <antcall target="do-install"/>
+    </target>
+
+    <target name="do-install"
+        depends="do-windows-install,do-unix-install,do-custom-install"/>
+
+    <target name="do-windows-install" if="do.windows.install">
+        <property name="vimdir" location="${user.home}/vimfiles"/>
+        <antcall target="real-do-install"/>
+    </target>
+
+    <target name="do-unix-install" if="do.unix.install">
+        <property name="vimdir" location="${user.home}/.vim"/>
+        <antcall target="real-do-install"/>
+    </target>
+
+    <target name="do-custom-install" if="do.custom.install">
+        <antcall target="real-do-install"/>
+    </target>
+
+    <target name="real-do-install">
         <mkdir dir="${vimdir}/autoload"/>
         <mkdir dir="${vimdir}/doc"/>
         <mkdir dir="${vimdir}/indent"/>