Skip to content

Commit

Permalink
Merge remote-tracking branch 'oauth/master'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
davido committed Dec 15, 2018
2 parents d1ade3e + a49174d commit f83337c
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 198 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/.classpath
/.project
/.settings/org.maven.ide.eclipse.prefs
/.settings/org.eclipse.m2e.core.prefs
/.settings
/bazel-bin
/bazel-genfiles
/bazel-gerrit-oauth-provider
/bazel-out
/bazel-testlogs
/eclipse-out
/.idea
*.swp
3 changes: 3 additions & 0 deletions .settings/org.eclipse.core.runtime.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Tue Sep 02 16:59:24 PDT 2008
eclipse.preferences.version=1
line.separator=\n
12 changes: 11 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("//tools/bzl:junit.bzl", "junit_tests")
load(
"//tools/bzl:plugin.bzl",
"PLUGIN_DEPS",
"PLUGIN_TEST_DEPS",
"gerrit_plugin",
)

Expand All @@ -26,7 +27,16 @@ junit_tests(
name = "gerrit-oauth-provider_tests",
srcs = glob(["src/test/java/**/*.java"]),
tags = ["oauth"],
deps = PLUGIN_DEPS + [
deps = [
":gerrit-oauth-provider__plugin_test_deps",
],
)

java_library(
name = "gerrit-oauth-provider__plugin_test_deps",
testonly = 1,
visibility = ["//visibility:public"],
exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
":gerrit-oauth-provider__plugin",
"@scribe//jar",
],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ following:
Install
-------

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

```
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ workspace(name = "com_github_davido_gerrit_oauth_provider")
load("//:bazlets.bzl", "load_bazlets")

load_bazlets(
commit = "5e0b58a466804eca41dd99df75bdf8575de0d167",
# local_path = "/home/<user>/projects/bazlets",
commit = "d025e909c2e8a369712165309f599a2765005f2d",
#local_path = "/home/<user>/projects/bazlets",
)

# Snapshot Plugin API
Expand Down
6 changes: 4 additions & 2 deletions bazlets.bzl
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

NAME = "com_googlesource_gerrit_bazlets"

def load_bazlets(
commit = None,
commit,
local_path = None):
if not local_path:
native.git_repository(
git_repository(
name = NAME,
remote = "https://gerrit.googlesource.com/bazlets",
commit = commit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public OAuthUserInfo getUserInfo(OAuthToken token) throws IOException {
public OAuthToken getAccessToken(OAuthVerifier rv) {
Verifier vi = new Verifier(rv.getValue());
Token to = service.getAccessToken(null, vi);
return new OAuthToken(to.getToken(), to.getSecret(), null);
return new OAuthToken(to.getToken(), to.getSecret(), to.getRawResponse());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public OAuthUserInfo getUserInfo(OAuthToken token) throws IOException {
public OAuthToken getAccessToken(OAuthVerifier rv) {
Verifier vi = new Verifier(rv.getValue());
Token to = service.getAccessToken(null, vi);
return new OAuthToken(to.getToken(), to.getSecret(), null);
return new OAuthToken(to.getToken(), to.getSecret(), to.getRawResponse());
}

@Override
Expand Down
1 change: 1 addition & 0 deletions tools/bzl/plugin.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load(
"@com_googlesource_gerrit_bazlets//:gerrit_plugin.bzl",
"PLUGIN_DEPS",
"PLUGIN_TEST_DEPS",
"gerrit_plugin",
)
13 changes: 4 additions & 9 deletions tools/eclipse/BUILD
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
load("//tools/bzl:plugin.bzl", "PLUGIN_DEPS", "gerrit_plugin")
load("//tools/bzl:classpath.bzl", "classpath_collector")

java_library(
name = "classpath",
runtime_deps = PLUGIN_DEPS + [
"//:gerrit-oauth-provider__plugin",
],
)

classpath_collector(
name = "main_classpath_collect",
deps = PLUGIN_DEPS + ["//:gerrit-oauth-provider__plugin"],
testonly = 1,
deps = [
"//:gerrit-oauth-provider__plugin_test_deps",
],
)
179 changes: 0 additions & 179 deletions tools/eclipse/project.py

This file was deleted.

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

0 comments on commit f83337c

Please sign in to comment.