gradle minor improvements, support windows
+import org.gradle.internal.os.OperatingSystem
plugins {
id 'java-library'
@@ -21,13 +22,13 @@ def versionMinor = 8
def versionPatch = 0
def versionModifier = ""
def jarVersion = "2.8.0"
-def secureEnv = System.getenv("TRAVIS_SECURE_ENV_VARS") != null ? System.getenv("TRAVIS_SECURE_ENV_VARS") : "false";
-def branch = System.getenv("TRAVIS_BRANCH") != null ? System.getenv("TRAVIS_BRANCH") : "";
-def tag = System.getenv("TRAVIS_TAG") != null ? System.getenv("TRAVIS_TAG") : "";
-def useSigning = "true".equals(secureEnv) && ("master".equals(branch) || (!"".equals(tag) && tag.equals(branch))) // tag will be the branch on a tag event for travis
+def secureEnv = System.getenv("TRAVIS_SECURE_ENV_VARS") != null ? System.getenv("TRAVIS_SECURE_ENV_VARS") : "false"
+def branch = System.getenv("TRAVIS_BRANCH") != null ? System.getenv("TRAVIS_BRANCH") : ""
+def tag = System.getenv("TRAVIS_TAG") != null ? System.getenv("TRAVIS_TAG") : ""
+def useSigning = "true" == secureEnv && ("master" == branch || ("" != tag && tag == branch)) // tag will be the branch on a tag event for travis
def getVersionName = { ->
- if ("".equals(tag)) {
+ if ("" == tag) {
versionModifier = "-SNAPSHOT"
}
@@ -134,6 +135,7 @@ javadoc {
excludes = ['io/nats/client/impl', 'io/nats/examples']
classpath = sourceSets.main.runtimeClasspath
doLast {
+ if (!OperatingSystem.current().isWindows()) {
exec {
println "Updating favicon on all html files"
workingDir 'build/docs/javadoc'
@@ -147,6 +149,7 @@ javadoc {
}
}
}
+}
task examplesJar(type: Jar) {
archiveClassifier.set('examples')
