1
1
package com .codacy
2
2
3
- import java .io .File
4
-
5
- import com .codacy .api .Language
6
3
import com .codacy .api .client .CodacyClient
7
4
import com .codacy .api .helpers .FileHelper
5
+ import com .codacy .api .Language
8
6
import com .codacy .api .service .CoverageServices
9
7
import com .codacy .parsers .implementation .CoberturaParser
8
+ import java .io .File
10
9
import sbt .Keys ._
11
10
import sbt ._
12
11
13
12
object CodacyCoveragePlugin extends AutoPlugin {
14
13
15
- object autoImport {
14
+ object AutoImport {
16
15
val codacyCoverage = taskKey[Unit ](" Upload coverage reports to Codacy." )
17
16
val codacyProjectToken = settingKey[Option [String ]](" Your project token." )
18
17
val coberturaFile = settingKey[File ](" Path for project Cobertura file." )
@@ -31,11 +30,9 @@ object CodacyCoveragePlugin extends AutoPlugin {
31
30
)
32
31
}
33
32
34
- import com .codacy .CodacyCoveragePlugin .autoImport ._
35
-
36
- // override def requires = ScoverageSbtPlugin
33
+ import com .codacy .CodacyCoveragePlugin .AutoImport ._
37
34
38
- override def trigger = allRequirements
35
+ override def trigger : PluginTrigger = allRequirements
39
36
40
37
override val projectSettings = baseSettings
41
38
@@ -53,7 +50,7 @@ object CodacyCoveragePlugin extends AutoPlugin {
53
50
54
51
FileHelper .writeJsonToFile(codacyCoverageFile, report)
55
52
56
- val codacyClient = new CodacyClient (getApiBaseUrl (codacyApiBaseUrl), projectToken = Some (projectToken))
53
+ val codacyClient = new CodacyClient (apiBaseUrl (codacyApiBaseUrl), projectToken = Some (projectToken))
57
54
val coverageServices = new CoverageServices (codacyClient)
58
55
59
56
logger.info(s " Uploading coverage data... " )
@@ -75,7 +72,7 @@ object CodacyCoveragePlugin extends AutoPlugin {
75
72
}
76
73
}
77
74
78
- private def getApiBaseUrl (codacyApiBaseUrl : Option [String ]): Option [String ] = {
75
+ private def apiBaseUrl (codacyApiBaseUrl : Option [String ]): Option [String ] = {
79
76
// Check for an environment variable to override the API URL.
80
77
// If it doesn't exist, try the build options or default to the public API.
81
78
sys.env.get(" CODACY_API_BASE_URL" )
0 commit comments