Skip to content

Commit

Permalink
Fixed some issues in windows added build script for windows version
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Sep 24, 2012
1 parent 0c5866d commit 06d052b
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 20 deletions.
1 change: 1 addition & 0 deletions build-exe.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"C:\Program Files (x86)\JSmooth 0.9.9-7\jsmoothcmd.exe" jsync.jsmooth
2 changes: 2 additions & 0 deletions build-windows.sh
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 7 additions & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -17,6 +17,12 @@
<version>4.3</version>
</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>
Expand Down
14 changes: 5 additions & 9 deletions java/src/main/java/com/jsync/FsResourceWindows.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public boolean isSymlink() {

@Override
public int getMode() {
return 0;
return -1;
}

@Override
Expand All @@ -59,7 +59,7 @@ public void setGid(int gid) {

@Override
public int getGid() {
return 0;
return -1;
}

@Override
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion java/src/main/java/com/jsync/JSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 12 additions & 5 deletions java/src/main/java/com/jsync/ResourceCopier.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
6 changes: 2 additions & 4 deletions java/src/main/java/com/jsync/ResourceGenerator.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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);
Expand Down
32 changes: 32 additions & 0 deletions jsync.jsmooth
Original file line number Diff line number Diff line change
@@ -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.