diff --git a/gradle/gradle/application.java.gradle b/gradle/gradle/application.java.gradle index cc0b7b252..2ac28794d 100644 --- a/gradle/gradle/application.java.gradle +++ b/gradle/gradle/application.java.gradle @@ -28,7 +28,7 @@ subprojects { resources { srcDirs = ['src/it/resources']} compileClasspath += sourceSets.test.compileClasspath runtimeClasspath += sourceSets.test.runtimeClasspath - output.classesDir = sourceSets.test.output.classesDir + output.classesDirs.setFrom(sourceSets.test.output.classesDirs) } } diff --git a/gradle/gradle/development.fakeinstall.gradle b/gradle/gradle/development.fakeinstall.gradle index a122af91f..c0f1605c3 100644 --- a/gradle/gradle/development.fakeinstall.gradle +++ b/gradle/gradle/development.fakeinstall.gradle @@ -3,57 +3,61 @@ import org.apache.tools.ant.taskdefs.condition.Os -task fakeinstall(dependsOn: ["fakeuninstall"]) << { - description = "Must be run as root: Makes syncany/sy command available everywhere (symlink to syncany-cli/build/..)" - - // Do not depend on :syncany-cli:installApp to avoid permission issues when - // running fakeinstall as "root"; manually calling installApp required - - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - copy { - from "gradle/windows/syncany.bat" - into System.getenv()["windir"] - rename("syncany.bat", "sy.bat") - expand(appBinary: "${buildDir}/install/${applicationName}/bin/syncany.bat") +task fakeinstall(dependsOn: ["fakeuninstall"]) { + doLast { + description = "Must be run as root: Makes syncany/sy command available everywhere (symlink to syncany-cli/build/..)" + + // Do not depend on :syncany-cli:installApp to avoid permission issues when + // running fakeinstall as "root"; manually calling installApp required + + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + copy { + from "gradle/windows/syncany.bat" + into System.getenv()["windir"] + rename("syncany.bat", "sy.bat") + expand(appBinary: "${buildDir}/install/${applicationName}/bin/syncany.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") } - } - 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") - } - if(Os.isFamily(Os.FAMILY_MAC)) { - copy { - from "gradle/osx/org.syncany.daemon.plist" - into "/Library/LaunchAgents" - } - exec { - commandLine "/bin/launchctl", "load", "/Library/LaunchAgents/org.syncany.daemon.plist" - } - } + if(Os.isFamily(Os.FAMILY_MAC)) { + copy { + from "gradle/osx/org.syncany.daemon.plist" + into "/Library/LaunchAgents" + } + exec { + commandLine "/bin/launchctl", "load", "/Library/LaunchAgents/org.syncany.daemon.plist" + } + } + } } -task fakeuninstall << { - description = "Must be run as root: Removes symlink for syncany/sy command (complement to fakeinstall)" +task fakeuninstall { + doLast { + description = "Must be run as root: Removes symlink for syncany/sy command (complement to fakeinstall)" - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - new File(System.getenv()["windir"] + "/syncany.bat").delete() - new File(System.getenv()["windir"] + "/sy.bat").delete() - } - else { - new File("/usr/local/bin/syncany").delete() - new File("/usr/local/bin/sy").delete() - } + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + new File(System.getenv()["windir"] + "/syncany.bat").delete() + new File(System.getenv()["windir"] + "/sy.bat").delete() + } + else { + new File("/usr/local/bin/syncany").delete() + new File("/usr/local/bin/sy").delete() + } - if(Os.isFamily(Os.FAMILY_MAC)) { - File daemonFile = new File("/Library/LaunchAgents/org.syncany.daemon.plist") - - if (daemonFile.exists()) { - exec { - commandLine "/bin/launchctl", "stop", "org.syncany.daemon" - commandLine "/bin/launchctl", "unload", "/Library/LaunchAgents/org.syncany.daemon.plist" - } - daemonFile.delete() - } - } + if(Os.isFamily(Os.FAMILY_MAC)) { + File daemonFile = new File("/Library/LaunchAgents/org.syncany.daemon.plist") + + if (daemonFile.exists()) { + exec { + commandLine "/bin/launchctl", "stop", "org.syncany.daemon" + commandLine "/bin/launchctl", "unload", "/Library/LaunchAgents/org.syncany.daemon.plist" + } + daemonFile.delete() + } + } + } } diff --git a/gradle/gradle/development.misc.gradle b/gradle/gradle/development.misc.gradle index 70272801b..1bfa0f780 100644 --- a/gradle/gradle/development.misc.gradle +++ b/gradle/gradle/development.misc.gradle @@ -2,8 +2,8 @@ // Gradle Wrapper Tasks (for local gradlew scripts) //////////////////////////// -task wrapper(type: Wrapper) { - gradleVersion = '3.5' +wrapper { + gradleVersion = '6.8' jarFile = 'gradle/wrapper/wrapper.jar' } diff --git a/gradle/gradle/packaging.innosetup.gradle b/gradle/gradle/packaging.innosetup.gradle index cf9d6971c..44ee5d981 100644 --- a/gradle/gradle/packaging.innosetup.gradle +++ b/gradle/gradle/packaging.innosetup.gradle @@ -1,44 +1,45 @@ // Windows Installer /////////////////////////////////////////////////////////// -task exe(dependsOn: [installDist]) << { - def innoSetupDir = new File("${buildDir}/innosetup") +task exe(dependsOn: [installDist]) { + doLast { + def innoSetupDir = new File("${buildDir}/innosetup") - delete innoSetupDir - innoSetupDir.mkdir(); - - copy { - from("${rootProject.projectDir}/gradle/innosetup/setup-left.bmp") - from("${rootProject.projectDir}/gradle/innosetup/setup-top.bmp") - from("${rootProject.projectDir}/gradle/innosetup/setup-info-before.rtf") - from("${rootProject.projectDir}/gradle/innosetup/setup-info-after.rtf") - from("${rootProject.projectDir}/gradle/innosetup/setup-icon.ico") - from("${rootProject.projectDir}/gradle/innosetup/modpath.iss") - from("${rootProject.projectDir}/gradle/innosetup/code.iss") - into(innoSetupDir) - } - - copy { - from("${rootProject.projectDir}/gradle/innosetup/setup-cli.iss.skel") - rename("setup-cli.iss.skel", "setup-cli.iss") - expand([ - applicationVersion: "${applicationVersion}", - applicationVersionFull: "${applicationVersionFull}", - ]) - into(innoSetupDir) - } + delete innoSetupDir + innoSetupDir.mkdir(); + + copy { + from("${rootProject.projectDir}/gradle/innosetup/setup-left.bmp") + from("${rootProject.projectDir}/gradle/innosetup/setup-top.bmp") + from("${rootProject.projectDir}/gradle/innosetup/setup-info-before.rtf") + from("${rootProject.projectDir}/gradle/innosetup/setup-info-after.rtf") + from("${rootProject.projectDir}/gradle/innosetup/setup-icon.ico") + from("${rootProject.projectDir}/gradle/innosetup/modpath.iss") + from("${rootProject.projectDir}/gradle/innosetup/code.iss") + into(innoSetupDir) + } - exec { - workingDir rootProject.projectDir - commandLine "iscc ${innoSetupDir}/setup-cli.iss".split() - } - - if (!project.ext.has('exeDontCopyToUpload')) { copy { - from files("${buildDir}/innosetup") - include "*.exe" - into file("build/upload") + from("${rootProject.projectDir}/gradle/innosetup/setup-cli.iss.skel") + rename("setup-cli.iss.skel", "setup-cli.iss") + expand([ + applicationVersion: "${applicationVersion}", + applicationVersionFull: "${applicationVersionFull}", + ]) + into(innoSetupDir) + } + + exec { + workingDir rootProject.projectDir + commandLine "iscc ${innoSetupDir}/setup-cli.iss".split() + } + + if (!project.ext.has('exeDontCopyToUpload')) { + copy { + from files("${buildDir}/innosetup") + include "*.exe" + into file("build/upload") + } } } } - diff --git a/gradle/gradle/reports.coverage.gradle b/gradle/gradle/reports.coverage.gradle index 6c47aa6f9..cab0aa620 100644 --- a/gradle/gradle/reports.coverage.gradle +++ b/gradle/gradle/reports.coverage.gradle @@ -17,7 +17,6 @@ subprojects { } test { jacoco { - append = true classDumpDir = file("${rootProject.buildDir}/jacoco/classpathdumps") destinationFile = file("${rootProject.buildDir}/jacoco/tests.exec") } @@ -25,9 +24,9 @@ subprojects { jacocoTestReport { - additionalSourceDirs = files(sourceSets.main.allSource.srcDirs) - sourceDirectories = files(sourceSets.main.allSource.srcDirs) - classDirectories = files(sourceSets.main.output) + getAdditionalClassDirs().setFrom(files(sourceSets.main.allSource.srcDirs)) + getSourceDirectories().setFrom(files(sourceSets.main.allSource.srcDirs)) + getClassDirectories().setFrom(files(sourceSets.main.output)) reports { html.enabled = true @@ -39,17 +38,17 @@ subprojects { task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { dependsOn = subprojects.test - additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) - sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) - classDirectories = files(subprojects.sourceSets.main.output) - executionData = files(subprojects.jacocoTestReport.executionData) + getSourceDirectories().setFrom(files(subprojects.sourceSets.main.allSource.srcDirs)) + getSourceDirectories().setFrom(files(subprojects.sourceSets.main.allSource.srcDirs)) + getClassDirectories().setFrom(files(subprojects.sourceSets.main.output)) + getExecutionData().setFrom(files(subprojects.jacocoTestReport.executionData)) reports { html.enabled = true - html.destination "${rootProject.buildDir}/reports/coverage" + html.destination file("${rootProject.buildDir}/reports/coverage") xml.enabled = true - xml.destination "${rootProject.buildDir}/reports/coverage/coverage.xml" + xml.destination file("${rootProject.buildDir}/reports/coverage/coverage.xml") csv.enabled = false } diff --git a/gradle/gradle/reports.tests.gradle b/gradle/gradle/reports.tests.gradle index 85acfaab5..49efee21f 100644 --- a/gradle/gradle/reports.tests.gradle +++ b/gradle/gradle/reports.tests.gradle @@ -59,8 +59,8 @@ subprojects { ignoreFailures = true maxParallelForks = 2 testLogging { events 'started', 'passed'} - testClassesDir = sourceSets.integration.output.classesDir - classpath += sourceSets.integration.runtimeClasspath + testClassesDirs = sourceSets.integration.output.classesDirs + classpath += sourceSets.integration.runtimeClasspath exclude '**/*TestSuite*' }