Skip to content

Commit 3df04c1

Browse files
committed
adding gradle functionality
1 parent 904df74 commit 3df04c1

File tree

11 files changed

+568
-336
lines changed

11 files changed

+568
-336
lines changed

Search/BingVisualSearch/.gitignore

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,5 @@
1-
*.class
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
23

3-
# Auth filed
4-
*.auth
5-
*.azureauth
6-
7-
# Mobile Tools for Java (J2ME)
8-
.mtj.tmp/
9-
10-
# Package Files #
11-
*.jar
12-
*.war
13-
*.ear
14-
15-
# Azure Tooling #
16-
node_modules
17-
packages
18-
19-
# Eclipse #
20-
*.pydevproject
21-
.project
22-
.metadata
23-
bin/**
24-
tmp/**
25-
tmp/**/*
26-
*.tmp
27-
*.bak
28-
*.swp
29-
*~.nib
30-
local.properties
31-
.classpath
32-
.settings/
33-
.loadpath
34-
35-
# Other Tooling #
36-
.classpath
37-
.project
38-
target/
39-
.idea
40-
*.iml
41-
42-
# Mac OS #
43-
.DS_Store
44-
.DS_Store?
45-
46-
# Windows #
47-
Thumbs.db
48-
49-
# reduced pom files should not be included
50-
dependency-reduced-pom.xml
4+
# Ignore Gradle build output directory
5+
build
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plugins {
2+
java
3+
application
4+
}
5+
application {
6+
mainClassName = "main.java.BingVisualSearchSample"
7+
}
8+
repositories {
9+
mavenCentral()
10+
}
11+
dependencies {
12+
compile("org.slf4j:slf4j-simple:1.7.25")
13+
compile("com.microsoft.azure.cognitiveservices:azure-cognitiveservices-visualsearch:1.0.2-beta")
14+
compile("com.google.code.gson:gson:2.8.5")
15+
}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# name: Pressing Ctrl-D exits session
2+
# type: bool
3+
# Ctrl-D exits cmd.exe when it is pressed on an empty line.
4+
ctrld_exits = 1
5+
6+
# name: Toggle if pressing Esc clears line
7+
# type: bool
8+
# Clink clears the current line when Esc is pressed (unless Readline's Vi mode
9+
# is enabled).
10+
esc_clears_line = 1
11+
12+
# name: Match display colour
13+
# type: int
14+
# Colour to use when displaying matches. A value less than 0 will be the
15+
# opposite brightness of the default colour.
16+
match_colour = -1
17+
18+
# name: Executable match style
19+
# type: enum
20+
# 0 = PATH only
21+
# 1 = PATH and CWD
22+
# 2 = PATH, CWD, and directories
23+
# Changes how Clink will match executables when there is no path separator on
24+
# the line. 0 = PATH only, 1 = PATH and CWD, 2 = PATH, CWD, and directories. In
25+
# all cases both executables and directories are matched when there is a path
26+
# separator present. A value of -1 will disable executable matching completely.
27+
exec_match_style = 2
28+
29+
# name: Whitespace prefix matches files
30+
# type: bool
31+
# If the line begins with whitespace then Clink bypasses executable matching and
32+
# will match all files and directories instead.
33+
space_prefix_match_files = 1
34+
35+
# name: Colour of the prompt
36+
# type: int
37+
# Surrounds the prompt in ANSI escape codes to set the prompt's colour. Disabled
38+
# when the value is less than 0.
39+
prompt_colour = -1
40+
41+
# name: Auto-answer terminate prompt
42+
# type: enum
43+
# 0 = Disabled
44+
# 1 = Answer 'Y'
45+
# 2 = Answer 'N'
46+
# Automatically answers cmd.exe's 'Terminate batch job (Y/N)?' prompts. 0 =
47+
# disabled, 1 = answer 'Y', 2 = answer 'N'.
48+
terminate_autoanswer = 0
49+
50+
# name: Lines of history saved to disk
51+
# type: int
52+
# When set to a positive integer this is the number of lines of history that
53+
# will persist when Clink saves the command history to disk. Use 0 for infinite
54+
# lines and <0 to disable history persistence.
55+
history_file_lines = 10000
56+
57+
# name: Skip adding lines prefixed with whitespace
58+
# type: bool
59+
# Ignore lines that begin with whitespace when adding lines in to the history.
60+
history_ignore_space = 0
61+
62+
# name: Controls how duplicate entries are handled
63+
# type: enum
64+
# 0 = Always add
65+
# 1 = Ignore
66+
# 2 = Erase previous
67+
# If a line is a duplicate of an existing history entry Clink will erase the
68+
# duplicate when this is set 2. A value of 1 will not add duplicates to the
69+
# history and a value of 0 will always add lines. Note that history is not
70+
# deduplicated when reading/writing to disk.
71+
history_dupe_mode = 2
72+
73+
# name: Read/write history file each line edited
74+
# type: bool
75+
# When non-zero the history will be read from disk before editing a new line and
76+
# written to disk afterwards.
77+
history_io = 0
78+
79+
# name: Sets how command history expansion is applied
80+
# type: enum
81+
# 0 = Off
82+
# 1 = On
83+
# 2 = Not in single quotes
84+
# 3 = Not in double quote
85+
# 4 = Not in any quotes
86+
# The '!' character in an entered line can be interpreted to introduce words
87+
# from the history. This can be enabled and disable by setting this value to 1
88+
# or 0. Values or 2, 3 or 4 will skip any ! character quoted in single, double,
89+
# or both quotes respectively.
90+
history_expand_mode = 4
91+
92+
# name: Support Windows' Ctrl-Alt substitute for AltGr
93+
# type: bool
94+
# Windows provides Ctrl-Alt as a substitute for AltGr, historically to support
95+
# keyboards with no AltGr key. This may collide with some of Readline's
96+
# bindings.
97+
use_altgr_substitute = 1
98+
99+
# name: Strips CR and LF chars on paste
100+
# type: enum
101+
# 0 = Paste unchanged
102+
# 1 = Strip
103+
# 2 = As space
104+
# Setting this to a value >0 will make Clink strip CR and LF characters from
105+
# text pasted into the current line. Set this to 1 to strip all newline
106+
# characters and 2 to replace them with a space.
107+
strip_crlf_on_paste = 2
108+
109+
# name: Enables basic ANSI escape code support
110+
# type: bool
111+
# When printing the prompt, Clink has basic built-in support for SGR ANSI escape
112+
# codes to control the text colours. This is automatically disabled if a third
113+
# party tool is detected that also provides this facility. It can also be
114+
# disabled by setting this to 0.
115+
ansi_code_support = 1
116+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
;= @echo off
2+
;= rem Call DOSKEY and use this file as the macrofile
3+
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0%
4+
;= rem In batch mode, jump to the end of the file
5+
;= goto:eof
6+
;= Add aliases below here
7+
e.=explorer .
8+
gl=git log --oneline --all --graph --decorate $*
9+
ls=ls --show-control-chars -F --color $*
10+
pwd=cd
11+
clear=cls
12+
history=cat "%CMDER_ROOT%\config\.history"
13+
unalias=alias /d $1
14+
vi=vim $*
15+
cmderr=cd /d "%CMDER_ROOT%"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
:: use this file to run your own startup commands
2+
:: use in front of the command to prevent printing the command
3+
4+
:: uncomment this to have the ssh agent load when cmder starts
5+
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"
6+
7+
:: uncomment this next two lines to use pageant as the ssh authentication agent
8+
:: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock
9+
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-pageant.cmd"
10+
11+
:: you can add your plugins to the cmder path like so
12+
:: set "PATH=%CMDER_ROOT%\vendor\whatever;%PATH%"
13+
14+
@echo off
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

Search/BingVisualSearch/gradlew

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
#!/usr/bin/env sh
2+
3+
##############################################################################
4+
##
5+
## Gradle start up script for UN*X
6+
##
7+
##############################################################################
8+
9+
# Attempt to set APP_HOME
10+
# Resolve links: $0 may be a link
11+
PRG="$0"
12+
# Need this for relative symlinks.
13+
while [ -h "$PRG" ] ; do
14+
ls=`ls -ld "$PRG"`
15+
link=`expr "$ls" : '.*-> \(.*\)$'`
16+
if expr "$link" : '/.*' > /dev/null; then
17+
PRG="$link"
18+
else
19+
PRG=`dirname "$PRG"`"/$link"
20+
fi
21+
done
22+
SAVED="`pwd`"
23+
cd "`dirname \"$PRG\"`/" >/dev/null
24+
APP_HOME="`pwd -P`"
25+
cd "$SAVED" >/dev/null
26+
27+
APP_NAME="Gradle"
28+
APP_BASE_NAME=`basename "$0"`
29+
30+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31+
DEFAULT_JVM_OPTS='"-Xmx64m"'
32+
33+
# Use the maximum available, or set MAX_FD != -1 to use that value.
34+
MAX_FD="maximum"
35+
36+
warn () {
37+
echo "$*"
38+
}
39+
40+
die () {
41+
echo
42+
echo "$*"
43+
echo
44+
exit 1
45+
}
46+
47+
# OS specific support (must be 'true' or 'false').
48+
cygwin=false
49+
msys=false
50+
darwin=false
51+
nonstop=false
52+
case "`uname`" in
53+
CYGWIN* )
54+
cygwin=true
55+
;;
56+
Darwin* )
57+
darwin=true
58+
;;
59+
MINGW* )
60+
msys=true
61+
;;
62+
NONSTOP* )
63+
nonstop=true
64+
;;
65+
esac
66+
67+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68+
69+
# Determine the Java command to use to start the JVM.
70+
if [ -n "$JAVA_HOME" ] ; then
71+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72+
# IBM's JDK on AIX uses strange locations for the executables
73+
JAVACMD="$JAVA_HOME/jre/sh/java"
74+
else
75+
JAVACMD="$JAVA_HOME/bin/java"
76+
fi
77+
if [ ! -x "$JAVACMD" ] ; then
78+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79+
80+
Please set the JAVA_HOME variable in your environment to match the
81+
location of your Java installation."
82+
fi
83+
else
84+
JAVACMD="java"
85+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86+
87+
Please set the JAVA_HOME variable in your environment to match the
88+
location of your Java installation."
89+
fi
90+
91+
# Increase the maximum file descriptors if we can.
92+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93+
MAX_FD_LIMIT=`ulimit -H -n`
94+
if [ $? -eq 0 ] ; then
95+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96+
MAX_FD="$MAX_FD_LIMIT"
97+
fi
98+
ulimit -n $MAX_FD
99+
if [ $? -ne 0 ] ; then
100+
warn "Could not set maximum file descriptor limit: $MAX_FD"
101+
fi
102+
else
103+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104+
fi
105+
fi
106+
107+
# For Darwin, add options to specify how the application appears in the dock
108+
if $darwin; then
109+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110+
fi
111+
112+
# For Cygwin, switch paths to Windows format before running java
113+
if $cygwin ; then
114+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116+
JAVACMD=`cygpath --unix "$JAVACMD"`
117+
118+
# We build the pattern for arguments to be converted via cygpath
119+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120+
SEP=""
121+
for dir in $ROOTDIRSRAW ; do
122+
ROOTDIRS="$ROOTDIRS$SEP$dir"
123+
SEP="|"
124+
done
125+
OURCYGPATTERN="(^($ROOTDIRS))"
126+
# Add a user-defined pattern to the cygpath arguments
127+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129+
fi
130+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
131+
i=0
132+
for arg in "$@" ; do
133+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135+
136+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138+
else
139+
eval `echo args$i`="\"$arg\""
140+
fi
141+
i=$((i+1))
142+
done
143+
case $i in
144+
(0) set -- ;;
145+
(1) set -- "$args0" ;;
146+
(2) set -- "$args0" "$args1" ;;
147+
(3) set -- "$args0" "$args1" "$args2" ;;
148+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154+
esac
155+
fi
156+
157+
# Escape application args
158+
save () {
159+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160+
echo " "
161+
}
162+
APP_ARGS=$(save "$@")
163+
164+
# Collect all arguments for the java command, following the shell quoting and substitution rules
165+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166+
167+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169+
cd "$(dirname "$0")"
170+
fi
171+
172+
exec "$JAVACMD" "$@"

0 commit comments

Comments
 (0)