Permalink
Browse files

Fixed some issues in windows added build script for windows version

  • Loading branch information...
1 parent 0c5866d commit 06d052bbf3ae1486dd70be89d940384511fe32dc unknown committed Sep 24, 2012
View
1 build-exe.bat
@@ -0,0 +1 @@
+"C:\Program Files (x86)\JSmooth 0.9.9-7\jsmoothcmd.exe" jsync.jsmooth
View
2 build-windows.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+mvn install -Dversion=`cat VERSION` && (cd java; mvn assembly:single -Dversion=`cat ../VERSION`) && cp java/target/JSync-`cat VERSION`-jar-with-dependencies.jar java/target/JSync-jar-with-dependencies.jar && echo "DONE, NOW BUILD THE EXE WITH JSMOOTH USING jsync.jsmooth"
View
8 java/pom.xml
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.jsync</groupId>
<artifactId>JSync</artifactId>
- <version>0.0.1</version>
+ <version>${version}</version>
<dependencies>
<dependency>
@@ -18,6 +18,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.1</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.1</version>
View
14 java/src/main/java/com/jsync/FsResourceWindows.java
@@ -50,7 +50,7 @@ public boolean isSymlink() {
@Override
public int getMode() {
- return 0;
+ return -1;
}
@Override
@@ -59,7 +59,7 @@ public void setGid(int gid) {
@Override
public int getGid() {
- return 0;
+ return -1;
}
@Override
@@ -68,37 +68,33 @@ public void setUid(int uid) {
@Override
public int getUid() {
- return 0;
+ return -1;
}
@Override
public void setMode(int mode) {
-
}
@Override
public void createSymlink(String target) {
-
}
@Override
public long getAccessTime() {
- return 0;
+ return -1;
}
@Override
public void setAccessTime(long accessTime) {
-
}
@Override
public long getModifiedTime() {
- return 0;
+ return super.lastModified();
}
@Override
public void setModifiedTime(long modifiedTime) {
-
}
@Override
View
6 java/src/main/java/com/jsync/JSync.java
@@ -3,7 +3,11 @@
import java.io.IOException;
public class JSync {
-
+ static {
+ if (System.getenv("LIBJSYNC_PATH") != null) {
+ System.setProperty("jna.library.path", System.getenv("LIBJSYNC_PATH"));
+ }
+ }
public static void main(String[] args) throws IOException {
JSyncOptions options = new JSyncOptions(args);
View
17 java/src/main/java/com/jsync/ResourceCopier.java
@@ -19,12 +19,19 @@ public static void copy(IResource in, IResource out) throws IOException {
out.mkdirs();
- out.setUid(in.getUid());
- out.setGid(in.getGid());
- out.setMode(in.getMode());
- out.setAccessTime(in.getAccessTime());
- out.setModifiedTime(in.getModifiedTime());
+ int uid = in.getUid();
+ int gid = in.getGid();
+ int mode = in.getMode();
+ long atime = in.getAccessTime();
+ long mtime = in.getModifiedTime();
+
+ if (uid != -1) out.setUid(uid);
+ if (gid != -1) out.setGid(gid);
+ if (mode != -1) out.setMode(mode);
+ if (atime != -1) out.setAccessTime(atime);
+ if (mtime != -1) out.setModifiedTime(mtime);
+
out.setMimeType(in.getMimeType());
out.setSize(in.getSize());
View
6 java/src/main/java/com/jsync/ResourceGenerator.java
@@ -1,7 +1,7 @@
package com.jsync;
import com.amazonaws.auth.AWSCredentials;
-
+import org.apache.commons.lang3.SystemUtils;
import java.net.URI;
import java.net.URISyntaxException;
@@ -40,9 +40,7 @@ public IResource generateResource(String path) {
try {
uri = new URI(path);
} catch (URISyntaxException e) {
- System.out.println(System.getProperty("os.name"));
- if (System.getProperty("os.name").equals("Windows 7")) {
- System.out.println("Using windows style files");
+ if (SystemUtils.IS_OS_WINDOWS) {
return new FsResourceWindows(path);
} else {
return new FsResource(path);
View
32 jsync.jsmooth
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<jsmoothproject>
+<JVMSearchPath>registry</JVMSearchPath>
+<JVMSearchPath>javahome</JVMSearchPath>
+<JVMSearchPath>jrepath</JVMSearchPath>
+<JVMSearchPath>jdkpath</JVMSearchPath>
+<JVMSearchPath>exepath</JVMSearchPath>
+<JVMSearchPath>jview</JVMSearchPath>
+<currentDirectory>${EXECUTABLEPATH}</currentDirectory>
+<embeddedJar>true</embeddedJar>
+<executableName>jsync.exe</executableName>
+<initialMemoryHeap>-1</initialMemoryHeap>
+<jarLocation>java\target\JSync-jar-with-dependencies.jar</jarLocation>
+<mainClassName>com.jsync.JSync</mainClassName>
+<maximumMemoryHeap>-1</maximumMemoryHeap>
+<maximumVersion></maximumVersion>
+<minimumVersion>1.6</minimumVersion>
+<skeletonName>Console Wrapper</skeletonName>
+<skeletonProperties>
+<key>Message</key>
+<value>This program needs Java to run.
+Please download it at http://www.java.com</value>
+</skeletonProperties>
+<skeletonProperties>
+<key>PressKey</key>
+<value>0</value>
+</skeletonProperties>
+<skeletonProperties>
+<key>Debug</key>
+<value>0</value>
+</skeletonProperties>
+</jsmoothproject>

0 comments on commit 06d052b

Please sign in to comment.