Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONARGO-75 Onboard sonar-go to Develocity #40

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
ORG_GRADLE_PROJECT_signingKeyId: VAULT[development/kv/data/sign data.key_id]

GRADLE_USER_HOME: ${CIRRUS_WORKING_DIR}/.gradle
DEVELOCITY_TOKEN: VAULT[development/kv/data/develocity data.token]
DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${DEVELOCITY_TOKEN}

linux_image_template: &LINUX_IMAGE
image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-g7-latest
Expand Down Expand Up @@ -101,7 +103,7 @@
-Pqa --info --stacktrace --console plain --no-daemon --build-cache
<<: *CLEANUP_GRADLE_CACHE_SCRIPT

qa_plugin_task:

Check warning on line 106 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L106

task "qa_plugin" depends on task "build", but their only_if conditions are different

Check warning on line 106 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L106

task "qa_plugin" depends on task "build", but their only_if conditions are different
<<: *QA_TASK_FILTER
env:
ITS_PROJECT: "plugin"
Expand All @@ -112,7 +114,7 @@
<<: *LINUX_4_CPU_6G_JAVA_17
<<: *GRADLE_ITS_TEMPLATE

qa_ruling_task:

Check warning on line 117 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L117

task "qa_ruling" depends on task "build", but their only_if conditions are different
<<: *QA_TASK_FILTER
env:
SQ_VERSION: "LATEST_RELEASE"
Expand Down Expand Up @@ -150,7 +152,7 @@

### Promote tasks

promote_task:

Check warning on line 155 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L155

task "promote" depends on task "build", but their only_if conditions are different
depends_on:
- build
- qa_plugin
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Furthermore, there are files such as `package-info.java` and `module-info.java`
Also the Go source files are not handled. For those files use a manual script like below to update the license:
`find . -type f -name "*.go" -exec sed -i '' 's/2018-2023/2018-2024/' "{}" \;`



## License

Copyright 2012-2024 SonarSource.
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ version=1.19.0-SNAPSHOT
description=Code Analyzer for Go
projectTitle=Go
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx1024m
org.gradle.caching=true
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
*/
package org.sonarsource.slang;

import java.util.List;
import org.junit.Test;
import org.sonarqube.ws.Issues;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -35,13 +33,6 @@ public void go_measures() {
assertThat(getMeasureAsInt(componentKey, "ncloc")).isEqualTo(41);
assertThat(getMeasureAsInt(componentKey, "comment_lines")).isEqualTo(2);

assertThat(getMeasure(componentKey, "ncloc_data").getValue())
.isEqualTo("1=1;3=1;4=1;5=1;6=1;7=1;8=1;10=1;11=1;12=1;13=1;14=1;16=1;17=1;18=1;20=1;21=1;22=1;23=1;24=1;25=1;" +
"26=1;27=1;28=1;29=1;30=1;31=1;32=1;33=1;35=1;36=1;37=1;38=1;39=1;40=1;41=1;46=1;47=1;48=1;49=1;50=1");

assertThat(getMeasureAsInt(componentKey, "functions")).isEqualTo(3);

assertThat(getMeasure(componentKey, "executable_lines_data").getValue())
.isEqualTo("32=1;36=1;37=1;38=1;40=1;49=1;22=1;23=1;25=1;26=1;27=1;29=1;30=1");
}
}
19 changes: 19 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ pluginManagement {
}
}

plugins {
id 'com.gradle.develocity' version '3.18.2'
}

develocity {
server = 'https://develocity.sonar.build'
}

def isCI = System.getenv('CI') != null
buildCache {
local {
enabled = !isCI
}
remote(develocity.buildCache) {
enabled = true
push = isCI
}
}

dependencyResolutionManagement {
def slangDependenciesVersion = '1.17.0.6351'
def analyzerCommonsVersion = '2.16.0.3141'
Expand Down