diff options
author | Jukka Jokiniva <jukka.jokiniva@qt.io> | 2018-10-02 11:58:51 +0300 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2018-12-18 16:51:41 +0000 |
commit | 4e9a83e1029a7a55ae09fe3fe44c353e6c35cecb (patch) | |
tree | dd2a38d4b692a4120d08c976e79fc8dff89c6225 | |
parent | 3cabdbb48663cefa45388ddc6ce3a1e4d1c941e3 (diff) |
Basic plugin
This is just the needed infrastructure to build the Qt plugin which adds
a custom workflow to allow staging and integrating changes through a CI
instead of directly submitting them.
Change-Id: I6709dd99b718f7e644aa61bbb6c389291c5fb637
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r-- | BUILD | 26 | ||||
-rw-r--r-- | pom.xml | 98 | ||||
-rw-r--r-- | src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtModule.java | 31 | ||||
-rw-r--r-- | src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtSshModule.java | 15 | ||||
-rw-r--r-- | src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java | 25 |
5 files changed, 195 insertions, 0 deletions
@@ -0,0 +1,26 @@ +load("//tools/bzl:junit.bzl", "junit_tests") +load("//tools/bzl:plugin.bzl", "PLUGIN_DEPS", "PLUGIN_TEST_DEPS", "gerrit_plugin") + +gerrit_plugin( + name = "gerrit-plugin-qt-workflow", + srcs = glob(["src/main/java/**/*.java"]), + manifest_entries = [ + "Gerrit-PluginName: gerrit-plugin-qt-workflow", + "Gerrit-Module: com.googlesource.gerrit.plugins.qtcodereview.QtModule", + "Gerrit-SshModule: com.googlesource.gerrit.plugins.qtcodereview.QtSshModule", + "Implementation-Title: Qt Code Review Flow Plugin", + "Implementation-URL: https://codereview.qt-project.org/p/qtqa/gerrit-plugin-qt-workflow.git", + ], + resources = glob(["src/main/**/*"]), +) + +junit_tests( + name = "qtcodereview_tests", + size = "large", + srcs = glob(["src/test/java/**/*IT.java"]), + tags = ["qtcodereview"], + visibility = ["//visibility:public"], + deps = PLUGIN_TEST_DEPS + PLUGIN_DEPS + [ + ":gerrit-plugin-qt-workflow__plugin", + ], +) @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (C) 2018 The Qt Company +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>com.googlesource.gerrit.plugins</groupId> + <artifactId>qtcodereview</artifactId> + <packaging>jar</packaging> + <version>2.16</version> + <properties> + <Gerrit-ApiType>plugin</Gerrit-ApiType> + <Gerrit-ApiVersion>${project.version}</Gerrit-ApiVersion> + <GWT-Version>2.8.0</GWT-Version> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.4</version> + <configuration> + <archive> + <manifestEntries> + <Gerrit-PluginName>gerrit-plugin-qt-workflow</Gerrit-PluginName> + <Gerrit-Module>com.googlesource.gerrit.plugins.qtcodereview.QtModule</Gerrit-Module> + <Gerrit-SshModule>com.googlesource.gerrit.plugins.qtcodereview.QtSshModule</Gerrit-SshModule> + + <Implementation-Vendor>The Qt Company</Implementation-Vendor> + <Implementation-URL>https://codereview.qt-project.org/p/qtqa/gerrit-plugin-qt-workflow.git</Implementation-URL> + + <Implementation-Title>Qt Code Review Flow Plugin</Implementation-Title> + <Implementation-Version>${project.version}</Implementation-Version> + + <Gerrit-ApiType>${Gerrit-ApiType}</Gerrit-ApiType> + <Gerrit-ApiVersion>${Gerrit-ApiVersion}</Gerrit-ApiVersion> + </manifestEntries> + </archive> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + <encoding>UTF-8</encoding> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>com.google.gerrit</groupId> + <artifactId>gerrit-${Gerrit-ApiType}-api</artifactId> + <version>${Gerrit-ApiVersion}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.google.gerrit</groupId> + <artifactId>gerrit-plugin-gwtui</artifactId> + <version>${Gerrit-ApiVersion}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.google.gwt</groupId> + <artifactId>gwt-user</artifactId> + <version>${GWT-Version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.google.gerrit</groupId> + <artifactId>gerrit-acceptance-framework</artifactId> + <version>${Gerrit-ApiVersion}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <repositories> + <repository> + <id>maven.org</id> + <url>http://repo1.maven.org/maven2</url> + </repository> + </repositories> +</project> diff --git a/src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtModule.java b/src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtModule.java new file mode 100644 index 0000000..5cfba4a --- /dev/null +++ b/src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtModule.java @@ -0,0 +1,31 @@ +// +// Copyright (C) 2018 The Qt Company +// + +package com.googlesource.gerrit.plugins.qtcodereview; + +import com.google.common.flogger.FluentLogger; +import com.google.gerrit.extensions.config.FactoryModule; +import com.google.gerrit.extensions.restapi.RestApiModule; + +import com.google.inject.Inject; +import com.google.inject.AbstractModule; + +public class QtModule extends FactoryModule { + + private static final FluentLogger logger = FluentLogger.forEnclosingClass(); + + @Override + protected void configure() { + + install( + new RestApiModule() { + @Override + protected void configure() { + } + } + ); + + } + +} diff --git a/src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtSshModule.java b/src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtSshModule.java new file mode 100644 index 0000000..3dbf1d4 --- /dev/null +++ b/src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtSshModule.java @@ -0,0 +1,15 @@ +// +// Copyright (C) 2018 The Qt Company +// + +package com.googlesource.gerrit.plugins.qtcodereview; + +import com.google.gerrit.sshd.PluginCommandModule; + +class QtSshModule extends PluginCommandModule { + + @Override + protected void configureCommands() { + + } +} diff --git a/src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java b/src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java new file mode 100644 index 0000000..2aa798a --- /dev/null +++ b/src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java @@ -0,0 +1,25 @@ +// Copyright (C) 2018 The Qt Company + +package com.googlesource.gerrit.plugins.qtcodereview; + +import com.google.gerrit.acceptance.LightweightPluginDaemonTest; +import com.google.gerrit.acceptance.TestPlugin; +import com.google.gerrit.acceptance.UseSsh; + +import org.junit.Test; + +@TestPlugin( + name = "gerrit-plugin-qt-workflow", + sysModule = "com.googlesource.gerrit.plugins.qtcodereview.QtModule", + sshModule = "com.googlesource.gerrit.plugins.qtcodereview.QtSshModule" +) + +@UseSsh +public class QtCodeReviewIT extends LightweightPluginDaemonTest { + + @Test + public void dummyTest() { + + } + +} |