Merge branch 'stable-3.1' * stable-3.1: Update bazlets to latest stable-3.1 Update bazlets to latest stable-3.0 Rename GWT examples to have -GWT suffix Update maven build to 2.16.13 Update bazlets to latest stable-2.16 Update maven build to 2.15.18 Update maven build to 2.14.20 Remove Buck based build Update bazlets to latest stable-2.15 Update bazlets to latest stable-2.14 Update bazlets to Gerrit API 2.14.20 Just did: 'git merge --log -X theirs stable-3.1' Change-Id: Ic8af5c25324ea96290c6ca9ba871f69185a7f60f
diff --git a/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCapability.java b/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCapability.java deleted file mode 120000 index 89edecb..0000000 --- a/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCapability.java +++ /dev/null
@@ -1 +0,0 @@ -../../../../../../../../../../example-adminSshCommand/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCapability.java \ No newline at end of file
diff --git a/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCapability.java b/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCapability.java new file mode 100644 index 0000000..84b7adb --- /dev/null +++ b/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCapability.java
@@ -0,0 +1,26 @@ +// Copyright (C) 2014 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. + +package com.googlesource.gerrit.plugins.examples.adminsshcommand; + +import com.google.gerrit.extensions.config.CapabilityDefinition; + +class AdminExampleCapability extends CapabilityDefinition { + static final String ADMIN_EXAMPLE = "adminExample"; + + @Override + public String getDescription() { + return "Administrate Example"; + } +}
diff --git a/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCommand.java b/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCommand.java deleted file mode 120000 index 0b87e21..0000000 --- a/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCommand.java +++ /dev/null
@@ -1 +0,0 @@ -../../../../../../../../../../example-adminSshCommand/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCommand.java \ No newline at end of file
diff --git a/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCommand.java b/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCommand.java new file mode 100644 index 0000000..3c31b6b --- /dev/null +++ b/example-sshCommandDelegateDynamicBean/src/main/java/com/googlesource/gerrit/plugins/examples/adminsshcommand/AdminExampleCommand.java
@@ -0,0 +1,42 @@ +// Copyright (C) 2014 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. + +package com.googlesource.gerrit.plugins.examples.adminsshcommand; + +import com.google.gerrit.extensions.annotations.RequiresCapability; +import com.google.gerrit.sshd.CommandMetaData; +import com.google.gerrit.sshd.SshCommand; +import org.kohsuke.args4j.Option; + +@RequiresCapability(AdminExampleCapability.ADMIN_EXAMPLE) +@CommandMetaData(name = "admin", description = "Administrate the example") +public final class AdminExampleCommand extends SshCommand { + private int count = 1; + + @Option( + name = "--count", + aliases = {"-c"}, + metaVar = "COUNT", + usage = "Number of times to greet the administrator") + public void setCount(int count) { + this.count = count; + } + + @Override + protected void run() { + while (count-- > 0) { + stdout.print("Hello, example administrator\n"); + } + } +}