Skip to content

Commit b7334df

Browse files
committed
[java][okhttp] Regenerate samples against a clean build
The previously committed samples were generated with a jar that still contained seven okhttp templates from an earlier prototype build: Pair, StringUtil, ServerVariable, ServerConfiguration, maven.yml, travis and git_push.sh. Those templates are intentionally not part of this library - mustache resolution is supposed to fall back to the shared Java/ and _common/ templates - but stale target/classes output survived an incremental build and was shaded into the CLI jar, where library-local templates take precedence. Rebuilt with `mvn clean install` and regenerated. Only git_push.sh actually differed in the output; it now matches _common/git_push.sh.mustache and is byte-identical to the okhttp-gson sample, as are Pair, StringUtil, ServerVariable, ServerConfiguration, maven.yml and travis.
1 parent a6ce093 commit b7334df

27 files changed

Lines changed: 432 additions & 675 deletions

File tree

‎samples/client/echo_api/java/okhttp-jackson-user-defined-templates/git_push.sh‎

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,25 @@ git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
99
git_host=$4
10-
git_branch=$5
1110

12-
if [ "$git_host" = "" ]; then
11+
if [ -z "${git_host}" ]; then
1312
git_host="github.com"
14-
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
13+
echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}"
1514
fi
1615

17-
if [ "$git_branch" = "" ]; then
18-
git_branch="master"
19-
echo "[INFO] No command line input provided. Set \$git_branch to $git_branch"
20-
fi
21-
22-
if [ "$git_user_id" = "" ]; then
16+
if [ -z "${git_user_id}" ]; then
2317
git_user_id="GIT_USER_ID"
24-
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
18+
echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}"
2519
fi
2620

27-
if [ "$git_repo_id" = "" ]; then
21+
if [ -z "${git_repo_id}" ]; then
2822
git_repo_id="GIT_REPO_ID"
29-
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
23+
echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}"
3024
fi
3125

32-
if [ "$release_note" = "" ]; then
26+
if [ -z "${release_note}" ]; then
3327
release_note="Minor update"
34-
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
28+
echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}"
3529
fi
3630

3731
# Initialize the local directory as a Git repository
@@ -41,23 +35,20 @@ git init
4135
git add .
4236

4337
# Commits the tracked changes and prepares them to be pushed to a remote repository.
44-
git commit -m "$release_note"
38+
git commit -m "${release_note}"
4539

4640
# Sets the new remote
47-
git_remote=$(git remote)
48-
if [ "$git_remote" = "" ]; then # git remote not defined
49-
50-
if [ "$GIT_TOKEN" = "" ]; then
51-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
52-
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
41+
if [ -z "$(git remote)" ]; then # git remote not defined
42+
if [ -z "${GIT_TOKEN:-}" ]; then
43+
echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment."
44+
git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git"
5345
else
54-
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
46+
git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git"
5547
fi
56-
5748
fi
5849

59-
git pull origin "$git_branch"
50+
git pull origin master
6051

6152
# Pushes (Forces) the changes in the local repository up to the remote repository
6253
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
63-
git push origin "$git_branch"
54+
git push origin master 2>&1 | grep -v 'To https'

‎samples/client/echo_api/java/okhttp-user-defined-templates/git_push.sh‎

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,25 @@ git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
99
git_host=$4
10-
git_branch=$5
1110

12-
if [ "$git_host" = "" ]; then
11+
if [ -z "${git_host}" ]; then
1312
git_host="github.com"
14-
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
13+
echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}"
1514
fi
1615

17-
if [ "$git_branch" = "" ]; then
18-
git_branch="master"
19-
echo "[INFO] No command line input provided. Set \$git_branch to $git_branch"
20-
fi
21-
22-
if [ "$git_user_id" = "" ]; then
16+
if [ -z "${git_user_id}" ]; then
2317
git_user_id="GIT_USER_ID"
24-
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
18+
echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}"
2519
fi
2620

27-
if [ "$git_repo_id" = "" ]; then
21+
if [ -z "${git_repo_id}" ]; then
2822
git_repo_id="GIT_REPO_ID"
29-
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
23+
echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}"
3024
fi
3125

32-
if [ "$release_note" = "" ]; then
26+
if [ -z "${release_note}" ]; then
3327
release_note="Minor update"
34-
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
28+
echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}"
3529
fi
3630

3731
# Initialize the local directory as a Git repository
@@ -41,23 +35,20 @@ git init
4135
git add .
4236

4337
# Commits the tracked changes and prepares them to be pushed to a remote repository.
44-
git commit -m "$release_note"
38+
git commit -m "${release_note}"
4539

4640
# Sets the new remote
47-
git_remote=$(git remote)
48-
if [ "$git_remote" = "" ]; then # git remote not defined
49-
50-
if [ "$GIT_TOKEN" = "" ]; then
51-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
52-
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
41+
if [ -z "$(git remote)" ]; then # git remote not defined
42+
if [ -z "${GIT_TOKEN:-}" ]; then
43+
echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment."
44+
git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git"
5345
else
54-
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
46+
git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git"
5547
fi
56-
5748
fi
5849

59-
git pull origin "$git_branch"
50+
git pull origin master
6051

6152
# Pushes (Forces) the changes in the local repository up to the remote repository
6253
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
63-
git push origin "$git_branch"
54+
git push origin master 2>&1 | grep -v 'To https'

‎samples/client/echo_api/java/okhttp/git_push.sh‎

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,25 @@ git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
99
git_host=$4
10-
git_branch=$5
1110

12-
if [ "$git_host" = "" ]; then
11+
if [ -z "${git_host}" ]; then
1312
git_host="github.com"
14-
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
13+
echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}"
1514
fi
1615

17-
if [ "$git_branch" = "" ]; then
18-
git_branch="master"
19-
echo "[INFO] No command line input provided. Set \$git_branch to $git_branch"
20-
fi
21-
22-
if [ "$git_user_id" = "" ]; then
16+
if [ -z "${git_user_id}" ]; then
2317
git_user_id="GIT_USER_ID"
24-
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
18+
echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}"
2519
fi
2620

27-
if [ "$git_repo_id" = "" ]; then
21+
if [ -z "${git_repo_id}" ]; then
2822
git_repo_id="GIT_REPO_ID"
29-
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
23+
echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}"
3024
fi
3125

32-
if [ "$release_note" = "" ]; then
26+
if [ -z "${release_note}" ]; then
3327
release_note="Minor update"
34-
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
28+
echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}"
3529
fi
3630

3731
# Initialize the local directory as a Git repository
@@ -41,23 +35,20 @@ git init
4135
git add .
4236

4337
# Commits the tracked changes and prepares them to be pushed to a remote repository.
44-
git commit -m "$release_note"
38+
git commit -m "${release_note}"
4539

4640
# Sets the new remote
47-
git_remote=$(git remote)
48-
if [ "$git_remote" = "" ]; then # git remote not defined
49-
50-
if [ "$GIT_TOKEN" = "" ]; then
51-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
52-
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
41+
if [ -z "$(git remote)" ]; then # git remote not defined
42+
if [ -z "${GIT_TOKEN:-}" ]; then
43+
echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment."
44+
git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git"
5345
else
54-
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
46+
git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git"
5547
fi
56-
5748
fi
5849

59-
git pull origin "$git_branch"
50+
git pull origin master
6051

6152
# Pushes (Forces) the changes in the local repository up to the remote repository
6253
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
63-
git push origin "$git_branch"
54+
git push origin master 2>&1 | grep -v 'To https'

‎samples/client/others/java/okhttp-jackson-oneOf/git_push.sh‎

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,25 @@ git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
99
git_host=$4
10-
git_branch=$5
1110

12-
if [ "$git_host" = "" ]; then
11+
if [ -z "${git_host}" ]; then
1312
git_host="github.com"
14-
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
13+
echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}"
1514
fi
1615

17-
if [ "$git_branch" = "" ]; then
18-
git_branch="master"
19-
echo "[INFO] No command line input provided. Set \$git_branch to $git_branch"
20-
fi
21-
22-
if [ "$git_user_id" = "" ]; then
16+
if [ -z "${git_user_id}" ]; then
2317
git_user_id="GIT_USER_ID"
24-
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
18+
echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}"
2519
fi
2620

27-
if [ "$git_repo_id" = "" ]; then
21+
if [ -z "${git_repo_id}" ]; then
2822
git_repo_id="GIT_REPO_ID"
29-
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
23+
echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}"
3024
fi
3125

32-
if [ "$release_note" = "" ]; then
26+
if [ -z "${release_note}" ]; then
3327
release_note="Minor update"
34-
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
28+
echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}"
3529
fi
3630

3731
# Initialize the local directory as a Git repository
@@ -41,23 +35,20 @@ git init
4135
git add .
4236

4337
# Commits the tracked changes and prepares them to be pushed to a remote repository.
44-
git commit -m "$release_note"
38+
git commit -m "${release_note}"
4539

4640
# Sets the new remote
47-
git_remote=$(git remote)
48-
if [ "$git_remote" = "" ]; then # git remote not defined
49-
50-
if [ "$GIT_TOKEN" = "" ]; then
51-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
52-
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
41+
if [ -z "$(git remote)" ]; then # git remote not defined
42+
if [ -z "${GIT_TOKEN:-}" ]; then
43+
echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment."
44+
git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git"
5345
else
54-
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
46+
git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git"
5547
fi
56-
5748
fi
5849

59-
git pull origin "$git_branch"
50+
git pull origin master
6051

6152
# Pushes (Forces) the changes in the local repository up to the remote repository
6253
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
63-
git push origin "$git_branch"
54+
git push origin master 2>&1 | grep -v 'To https'

‎samples/client/others/java/okhttp-jackson3-oneOf/git_push.sh‎

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,25 @@ git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
99
git_host=$4
10-
git_branch=$5
1110

12-
if [ "$git_host" = "" ]; then
11+
if [ -z "${git_host}" ]; then
1312
git_host="github.com"
14-
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
13+
echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}"
1514
fi
1615

17-
if [ "$git_branch" = "" ]; then
18-
git_branch="master"
19-
echo "[INFO] No command line input provided. Set \$git_branch to $git_branch"
20-
fi
21-
22-
if [ "$git_user_id" = "" ]; then
16+
if [ -z "${git_user_id}" ]; then
2317
git_user_id="GIT_USER_ID"
24-
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
18+
echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}"
2519
fi
2620

27-
if [ "$git_repo_id" = "" ]; then
21+
if [ -z "${git_repo_id}" ]; then
2822
git_repo_id="GIT_REPO_ID"
29-
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
23+
echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}"
3024
fi
3125

32-
if [ "$release_note" = "" ]; then
26+
if [ -z "${release_note}" ]; then
3327
release_note="Minor update"
34-
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
28+
echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}"
3529
fi
3630

3731
# Initialize the local directory as a Git repository
@@ -41,23 +35,20 @@ git init
4135
git add .
4236

4337
# Commits the tracked changes and prepares them to be pushed to a remote repository.
44-
git commit -m "$release_note"
38+
git commit -m "${release_note}"
4539

4640
# Sets the new remote
47-
git_remote=$(git remote)
48-
if [ "$git_remote" = "" ]; then # git remote not defined
49-
50-
if [ "$GIT_TOKEN" = "" ]; then
51-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
52-
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
41+
if [ -z "$(git remote)" ]; then # git remote not defined
42+
if [ -z "${GIT_TOKEN:-}" ]; then
43+
echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment."
44+
git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git"
5345
else
54-
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
46+
git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git"
5547
fi
56-
5748
fi
5849

59-
git pull origin "$git_branch"
50+
git pull origin master
6051

6152
# Pushes (Forces) the changes in the local repository up to the remote repository
6253
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
63-
git push origin "$git_branch"
54+
git push origin master 2>&1 | grep -v 'To https'

0 commit comments

Comments
 (0)