Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
Updates to gradle 3.3, and removes Visual Studio 2015 workaround (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse authored and 333fred committed Jan 5, 2017
1 parent 5df78c5 commit b9e80ec
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 34 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ build.dependsOn wpiutilSourceZip
apply from: 'publish.gradle'

task wrapper(type: Wrapper) {
gradleVersion = '3.0'
gradleVersion = '3.3'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Aug 22 20:37:33 PDT 2016
#Wed Jan 04 14:11:50 PST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
19 changes: 11 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -154,16 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
23 changes: 0 additions & 23 deletions toolchains/windows.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,10 @@
model {
toolChains {
visualCpp(VisualCpp) {
// Workaround for VS2015 adapted from https://github.com/couchbase/couchbase-lite-java-native/issues/23
def VS_2015_INCLUDE_DIR = "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"
def VS_2015_LIB_DIR = "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/ucrt"
def VS_2015_INSTALL_DIR = 'C:/Program Files (x86)/Microsoft Visual Studio 14.0'
def vsInstallDir = file(VS_2015_INSTALL_DIR)

// If you ever happen to install and uninstall any other version of VS, Gradle will misdetect the compiler
// and linker to run. This fixes that by manually setting the install dir
if (vsInstallDir.exists()) {
installDir = vsInstallDir
}

eachPlatform {
cppCompiler.withArguments { args ->
args << '/EHsc' << '/DNOMINMAX' << '/D_SCL_SECURE_NO_WARNINGS' << '/D_WINSOCK_DEPRECATED_NO_WARNINGS'
if (file(VS_2015_INCLUDE_DIR).exists()) {
args << "/I$VS_2015_INCLUDE_DIR"
}
}
linker.withArguments { args ->
if (file(VS_2015_LIB_DIR).exists()) {
if (platform.architecture.name == 'x86') {
args << "/LIBPATH:$VS_2015_LIB_DIR/x86"
} else {
args << "/LIBPATH:$VS_2015_LIB_DIR/x64"
}
}
}
}
}
Expand Down

0 comments on commit b9e80ec

Please sign in to comment.