Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
sy and syd merged
Browse files Browse the repository at this point in the history
  • Loading branch information
vwiencek committed Sep 1, 2014
1 parent 656d530 commit b39c48d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 20 deletions.
46 changes: 40 additions & 6 deletions gradle/gradle/application.distribution.gradle
Expand Up @@ -24,17 +24,51 @@ startScripts {
winPurgeFileDeletionCommands += ")\r\n\r\n";

winFile.text = winFile.text.replaceAll("(:end)", "${winPurgeFileDeletionCommands}:end")

def winText = winFile.text
def textTmp = ""

winText.readLines().each {
line ->
if (line.startsWith("\"%JAVA_EXE%\"")) {
textTmp += "if \"%1\" == \"daemon\" (\r\n"
textTmp += " @rem start daemon\r\n"
textTmp += " call %DIRNAME%syd.bat %2 %3 %4\r\n"
textTmp += ") else (\r\n"
textTmp += " " + line + "\r\n"
textTmp += ")"
}
else {
textTmp += line + '\n'
}
}

winFile.text = textTmp

// Update unix text
def unixText = unixFile.text
textTmp = ""

unixText.readLines().each {
line ->
if (line.startsWith("exec")) {
textTmp += "if [ \$51 = daemon ]; then \n"
textTmp += " /bin/bash syd \n"
textTmp += "else \n"
textTmp += " " + line + "\n"
textTmp += "fi \n"
}
else {
textTmp += line + '\n'
}
}

unixFile.text = textTmp
}
}

applicationDistribution.from("${rootProject.projectDir}/") {
include "AUTHORS.md", "CHANGELOG.md", "LICENSE.md", "README.md"

// Copy daemon script
from("gradle/daemon/") {
include "syncanyd", "syncanyd.bat"
into "bin"
}

// Copy syncany/syncanyd to sy/syd
from(files("gradle/daemon/", "${startScripts.outputDir}/")) {
Expand Down
14 changes: 0 additions & 14 deletions gradle/gradle/development.fakeinstall.gradle
Expand Up @@ -15,20 +15,10 @@ task fakeinstall(dependsOn: ["fakeuninstall"]) << {
rename("syncany.bat", "sy.bat")
expand(appBinary: "${buildDir}/install/${applicationName}/bin/syncany.bat")
}

copy {
from "gradle/windows/syncany.bat"
into System.getenv()["windir"]
rename("syncany.bat", "syd.bat")
expand(appBinary: "${buildDir}/install/${applicationName}/bin/syncanyd.bat")
}
}
else{
ant.symlink(resource: "${buildDir}/install/${applicationName}/bin/${applicationName}", link: "/usr/local/bin/syncany")
ant.symlink(resource: "${buildDir}/install/${applicationName}/bin/${applicationName}", link: "/usr/local/bin/sy")
ant.symlink(resource: "${buildDir}/install/${applicationName}/bin/syncanyd", link: "/usr/local/bin/syncanyd")
ant.symlink(resource: "${buildDir}/install/${applicationName}/bin/syncanyd", link: "/usr/local/bin/syd")

}
}

Expand All @@ -38,14 +28,10 @@ task fakeuninstall << {
if (osName.startsWith("windows")) {
new File(System.getenv()["windir"] + "/syncany.bat").delete()
new File(System.getenv()["windir"] + "/sy.bat").delete()
new File(System.getenv()["windir"] + "/syncanyd.bat").delete()
new File(System.getenv()["windir"] + "/syd.bat").delete()
}
else {
new File("/usr/local/bin/syncany").delete()
new File("/usr/local/bin/sy").delete()
new File("/usr/local/bin/syncanyd").delete()
new File("/usr/local/bin/syd").delete()
}
}

0 comments on commit b39c48d

Please sign in to comment.