Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.

Commit

Permalink
update wss-agent api version. refactor dependencyInfo and add depende…
Browse files Browse the repository at this point in the history
…ncyType.
  • Loading branch information
Alex Maybaum committed Jul 17, 2017
1 parent 363d51e commit d96d077
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repositories {
dependencies {
compile gradleApi()
compile localGroovy()
compile 'org.whitesource:wss-agent-api-client:2.3.3', 'org.whitesource:wss-agent-report:2.3.3'
compile 'org.whitesource:wss-agent-api-client:2.3.8', 'org.whitesource:wss-agent-report:2.3.8'
compile 'org.codehaus.groovy:groovy-backports-compat23:2.4.11'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.whitesource.agent.api.ChecksumUtils
import org.whitesource.agent.api.model.AgentProjectInfo
import org.whitesource.agent.api.model.Coordinates
import org.whitesource.agent.api.model.DependencyInfo
import org.whitesource.agent.api.model.DependencyType
import org.whitesource.gradle.WhitesourceConfiguration

/**
Expand Down Expand Up @@ -48,6 +49,7 @@ class CollectProjectInfoTask extends DefaultTask {
if (!addedSha1s.contains(sha1)) {
def dependencyInfo = new DependencyInfo()
dependencyInfo.setArtifactId(file.name)
dependencyInfo.setFilename(file.name)
dependencyInfo.setSystemPath(file.absolutePath)
dependencyInfo.setSha1(sha1)
projectInfo.getDependencies().add(dependencyInfo)
Expand All @@ -67,11 +69,13 @@ class CollectProjectInfoTask extends DefaultTask {
def sha1 = ChecksumUtils.calculateSHA1(file)
if (!addedSha1s.contains(sha1)) {
dependencyInfo.setGroupId(dependency.getModuleGroup())
dependencyInfo.setArtifactId(file.getName())
dependencyInfo.setArtifactId(dependency.getModuleName())
dependencyInfo.setVersion(dependency.getModuleVersion())
dependencyInfo.setSystemPath(file.getAbsolutePath())
dependencyInfo.setType(artifact.getType())
dependencyInfo.setSha1(sha1)
dependencyInfo.setSystemPath(file.getAbsolutePath())
dependencyInfo.setDependencyType(DependencyType.GRADLE)
dependencyInfo.setFilename(file.getName())
addedSha1s.add(sha1)
dependency.getChildren().each {
def info = getDependencyInfo(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.whitesource.agent.report.PolicyCheckReport
class UpdateWhitesourceInventoryTask extends DefaultTask {

private static final String AGENT_TYPE = 'gradle-plugin'
private static final String AGENT_VERSION = '2.2.5'
private static final String AGENT_VERSION = '2.3.8'

WhitesourceConfiguration wssConfig
private WhitesourceService service
Expand Down Expand Up @@ -65,7 +65,7 @@ class UpdateWhitesourceInventoryTask extends DefaultTask {
}

private void createService() {
service = new WhitesourceService(AGENT_TYPE, AGENT_VERSION, null)
service = new WhitesourceService(AGENT_TYPE, AGENT_VERSION, "0.8")
configureProxy()
}

Expand Down

0 comments on commit d96d077

Please sign in to comment.