Skip to content

Commit f83337c

Browse files
committed
Merge remote-tracking branch 'oauth/master'
* oauth/master: Upgrade bazlets to latest stable-2.16 to build with 2.16.1 API Upgrade bazlets to latest stable-2.16 to build with 2.16 API Upgrade bazlets to latest master to build with 2.16-rc3 API Upgrade bazlets to latest stable-2.15 to build with 2.15.7 API Upgrade bazlets to latest stable-2.14 to build with 2.14.17 API Update bazlets to master to build with 2.16-rc1 API Upgrade bazlets to latest stable-2.15 to build with 2.15.6 API WORKSPACE: Make commented out local_path line spaces indent consistent Upgrade bazlets to latest stable-2.14 to build with 2.14.16 API Align Eclipse compiler settings with core Gerrit's Fix Eclipse project generation README: Fix name of jar file in standalone build Update README bazlets: Replace native.git_repository with skylark rule Upgrade bazlets to latest stable-2.14 to build with 2.14.15 API Update bazlets to stable-2.15 to build with 2.15.4 API Update bazlets to latest stable-2.14 to build with 2.14.14 API Update bazlets to latest stable-2.14 to build with 2.14.13 API Fix GitLab and Bitbucket services Change-Id: Id5511ea799540e3758f082286305449ed7a2b68a
2 parents d1ade3e + a49174d commit f83337c

File tree

12 files changed

+45
-198
lines changed

12 files changed

+45
-198
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/.classpath
22
/.project
3-
/.settings/org.maven.ide.eclipse.prefs
4-
/.settings/org.eclipse.m2e.core.prefs
3+
/.settings
54
/bazel-bin
65
/bazel-genfiles
76
/bazel-gerrit-oauth-provider
87
/bazel-out
98
/bazel-testlogs
9+
/eclipse-out
1010
/.idea
1111
*.swp
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#Tue Sep 02 16:59:24 PDT 2008
2+
eclipse.preferences.version=1
3+
line.separator=\n

BUILD

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ load("//tools/bzl:junit.bzl", "junit_tests")
22
load(
33
"//tools/bzl:plugin.bzl",
44
"PLUGIN_DEPS",
5+
"PLUGIN_TEST_DEPS",
56
"gerrit_plugin",
67
)
78

@@ -26,7 +27,16 @@ junit_tests(
2627
name = "gerrit-oauth-provider_tests",
2728
srcs = glob(["src/test/java/**/*.java"]),
2829
tags = ["oauth"],
29-
deps = PLUGIN_DEPS + [
30+
deps = [
31+
":gerrit-oauth-provider__plugin_test_deps",
32+
],
33+
)
34+
35+
java_library(
36+
name = "gerrit-oauth-provider__plugin_test_deps",
37+
testonly = 1,
38+
visibility = ["//visibility:public"],
39+
exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
3040
":gerrit-oauth-provider__plugin",
3141
"@scribe//jar",
3242
],

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ following:
4040
Install
4141
-------
4242

43-
Copy the `bazel-genfiles/gerrit-oauth-provider.jar` to
43+
Copy the `bazel-genfiles/oauth.jar` to
4444
`$gerrit_site/plugins` and re-run init to configure it:
4545

4646
```

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ workspace(name = "com_github_davido_gerrit_oauth_provider")
33
load("//:bazlets.bzl", "load_bazlets")
44

55
load_bazlets(
6-
commit = "5e0b58a466804eca41dd99df75bdf8575de0d167",
7-
# local_path = "/home/<user>/projects/bazlets",
6+
commit = "d025e909c2e8a369712165309f599a2765005f2d",
7+
#local_path = "/home/<user>/projects/bazlets",
88
)
99

1010
# Snapshot Plugin API

bazlets.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
2+
13
NAME = "com_googlesource_gerrit_bazlets"
24

35
def load_bazlets(
4-
commit = None,
6+
commit,
57
local_path = None):
68
if not local_path:
7-
native.git_repository(
9+
git_repository(
810
name = NAME,
911
remote = "https://gerrit.googlesource.com/bazlets",
1012
commit = commit,

src/main/java/com/googlesource/gerrit/plugins/oauth/BitbucketOAuthService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public OAuthUserInfo getUserInfo(OAuthToken token) throws IOException {
110110
public OAuthToken getAccessToken(OAuthVerifier rv) {
111111
Verifier vi = new Verifier(rv.getValue());
112112
Token to = service.getAccessToken(null, vi);
113-
return new OAuthToken(to.getToken(), to.getSecret(), null);
113+
return new OAuthToken(to.getToken(), to.getSecret(), to.getRawResponse());
114114
}
115115

116116
@Override

src/main/java/com/googlesource/gerrit/plugins/oauth/GitLabOAuthService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public OAuthUserInfo getUserInfo(OAuthToken token) throws IOException {
106106
public OAuthToken getAccessToken(OAuthVerifier rv) {
107107
Verifier vi = new Verifier(rv.getValue());
108108
Token to = service.getAccessToken(null, vi);
109-
return new OAuthToken(to.getToken(), to.getSecret(), null);
109+
return new OAuthToken(to.getToken(), to.getSecret(), to.getRawResponse());
110110
}
111111

112112
@Override

tools/bzl/plugin.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load(
22
"@com_googlesource_gerrit_bazlets//:gerrit_plugin.bzl",
33
"PLUGIN_DEPS",
4+
"PLUGIN_TEST_DEPS",
45
"gerrit_plugin",
56
)

tools/eclipse/BUILD

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
load("//tools/bzl:plugin.bzl", "PLUGIN_DEPS", "gerrit_plugin")
21
load("//tools/bzl:classpath.bzl", "classpath_collector")
32

4-
java_library(
5-
name = "classpath",
6-
runtime_deps = PLUGIN_DEPS + [
7-
"//:gerrit-oauth-provider__plugin",
8-
],
9-
)
10-
113
classpath_collector(
124
name = "main_classpath_collect",
13-
deps = PLUGIN_DEPS + ["//:gerrit-oauth-provider__plugin"],
5+
testonly = 1,
6+
deps = [
7+
"//:gerrit-oauth-provider__plugin_test_deps",
8+
],
149
)

tools/eclipse/project.py

Lines changed: 0 additions & 179 deletions
This file was deleted.

tools/eclipse/project.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# Copyright (C) 2017 The Android Open Source Project
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
`bazel query @com_googlesource_gerrit_bazlets//tools/eclipse:project --output location | sed s/BUILD:.*//`project.py -n oauth -r .

0 commit comments

Comments
 (0)