11package com .codacy
22
3- import java .io .File
4-
5- import com .codacy .api .Language
63import com .codacy .api .client .CodacyClient
74import com .codacy .api .helpers .FileHelper
5+ import com .codacy .api .Language
86import com .codacy .api .service .CoverageServices
97import com .codacy .parsers .implementation .CoberturaParser
8+ import java .io .File
109import sbt .Keys ._
1110import sbt ._
1211
1312object CodacyCoveragePlugin extends AutoPlugin {
1413
15- object autoImport {
14+ object AutoImport {
1615 val codacyCoverage = taskKey[Unit ](" Upload coverage reports to Codacy." )
1716 val codacyProjectToken = settingKey[Option [String ]](" Your project token." )
1817 val coberturaFile = settingKey[File ](" Path for project Cobertura file." )
@@ -31,11 +30,9 @@ object CodacyCoveragePlugin extends AutoPlugin {
3130 )
3231 }
3332
34- import com .codacy .CodacyCoveragePlugin .autoImport ._
35-
36- // override def requires = ScoverageSbtPlugin
33+ import com .codacy .CodacyCoveragePlugin .AutoImport ._
3734
38- override def trigger = allRequirements
35+ override def trigger : PluginTrigger = allRequirements
3936
4037 override val projectSettings = baseSettings
4138
@@ -53,7 +50,7 @@ object CodacyCoveragePlugin extends AutoPlugin {
5350
5451 FileHelper .writeJsonToFile(codacyCoverageFile, report)
5552
56- val codacyClient = new CodacyClient (getApiBaseUrl (codacyApiBaseUrl), projectToken = Some (projectToken))
53+ val codacyClient = new CodacyClient (apiBaseUrl (codacyApiBaseUrl), projectToken = Some (projectToken))
5754 val coverageServices = new CoverageServices (codacyClient)
5855
5956 logger.info(s " Uploading coverage data... " )
@@ -75,7 +72,7 @@ object CodacyCoveragePlugin extends AutoPlugin {
7572 }
7673 }
7774
78- private def getApiBaseUrl (codacyApiBaseUrl : Option [String ]): Option [String ] = {
75+ private def apiBaseUrl (codacyApiBaseUrl : Option [String ]): Option [String ] = {
7976 // Check for an environment variable to override the API URL.
8077 // If it doesn't exist, try the build options or default to the public API.
8178 sys.env.get(" CODACY_API_BASE_URL" )
0 commit comments