Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  Promote aggregation key to case class
  Add ability to ignore specific files suffixes

Change-Id: Ifceb12d03188813db37816fe84ac38ff72f79fb6
diff --git a/build.sbt b/build.sbt
index 74cfc91..59d1b6a 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,6 +1,6 @@
 enablePlugins(GitVersioning)
 
-val gerritApiVersion = "2.16.8"
+val gerritApiVersion = "3.0.0"
 
 val pluginName = "analytics"
 
@@ -12,7 +12,7 @@
   .settings(
     name := pluginName,
     resolvers += Resolver.mavenLocal,
-    version := "2.16-SNAPSHOT",
+    version := gerritApiVersion,
 
     scalaVersion := "2.11.8",
 
diff --git a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/DateConversions.scala b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/DateConversions.scala
index 3da8249..874dc0d 100644
--- a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/DateConversions.scala
+++ b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/DateConversions.scala
@@ -14,7 +14,7 @@
 
 package com.googlesource.gerrit.plugins.analytics.common
 
-import com.google.gwtjsonrpc.common.JavaSqlTimestampHelper
+import com.google.gerrit.json.JavaSqlTimestampHelper
 
 object DateConversions {
 
diff --git a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/GsonFormatter.scala b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/GsonFormatter.scala
index 4417f3f..b054554 100644
--- a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/GsonFormatter.scala
+++ b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/GsonFormatter.scala
@@ -17,7 +17,7 @@
 import java.io.PrintWriter
 import java.lang.reflect.Type
 
-import com.google.gerrit.server.OutputFormat
+import com.google.gerrit.json.OutputFormat
 import com.google.gson.{Gson, GsonBuilder, JsonSerializer, _}
 import com.google.inject.Singleton
 
@@ -52,5 +52,4 @@
       }
     }
   }
-
-}
\ No newline at end of file
+}
diff --git a/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GerritTestDaemon.scala b/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GerritTestDaemon.scala
index db82d13..1b6b674 100644
--- a/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GerritTestDaemon.scala
+++ b/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GerritTestDaemon.scala
@@ -17,6 +17,9 @@
 import java.io.File
 import java.util.{Date, UUID}
 
+import com.google.gerrit.acceptance.{AbstractDaemonTest, GitUtil}
+import com.google.gerrit.extensions.annotations.PluginName
+import com.google.gerrit.extensions.client.SubmitType
 import com.google.gerrit.acceptance._
 import com.google.gerrit.extensions.restapi.RestApiModule
 import com.google.gerrit.reviewdb.client.Project
@@ -144,17 +147,18 @@
 )
 object GerritTestDaemon extends LightweightPluginDaemonTest {
   baseConfig = new Config()
+  AbstractDaemonTest.temporaryFolder.create()
   tempDataDir.create()
 
   def newProject(nameSuffix: String) = {
     resourcePrefix = ""
-    super.createProject(nameSuffix, allProjects, false)
+    super.createProjectOverAPI(nameSuffix, allProjects, false, SubmitType.MERGE_IF_NECESSARY)
   }
 
   def getRepository(projectName: Project.NameKey): FileRepository =
     repoManager.openRepository(projectName).asInstanceOf[FileRepository]
 
-  def adminAuthor = admin.getIdent
+  def adminAuthor = admin.newIdent
 
   def getInstance[T](clazz: Class[T]): T =
     plugin.getSysInjector.getInstance(clazz)