Skip to content

Commit b75a42a

Browse files
committed
fix: Tried updating the jenkins sonarcloud config for plc4c
1 parent 2d1466a commit b75a42a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

plc4c/SonarcloudBuildWrapperHack.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cmakeExecutable.renameTo(cmakeRenamedExecutable)
3535
cmakeExecutable.write("#!/bin/bash\n")
3636
cmakeExecutable.append("echo \"Arguments: \$@\"\n")
3737
cmakeExecutable.append("if [[ \"\$1\" == \"--build\" ]]; then\n")
38-
cmakeExecutable.append(" " + cmakeRoot.absolutePath + "/../../build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir " + project.properties["sonar.cfamily.build-wrapper-output"] + " " + cmakeRoot.absolutePath + "/cmakeOrig \"\$@\"\n")
38+
cmakeExecutable.append(" " + cmakeRoot.absolutePath + "/../../../build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir " + project.properties["sonar.cfamily.build-wrapper-output"] + " " + cmakeRoot.absolutePath + "/cmakeOrig \"\$@\"\n")
3939
cmakeExecutable.append("else\n")
4040
cmakeExecutable.append(" " + cmakeRoot.absolutePath + "/cmakeOrig \"\$@\"\n")
4141
cmakeExecutable.append("fi\n")

plc4c/pom.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
<!-- When running on jenkins, download the sonar build-wrapper, so we can do a code analysis -->
4747
<profile>
4848
<id>jenkins-build</id>
49+
<!-- This is needed by the groovy hack script -->
50+
<properties>
51+
<cmake.root>${project.build.directory}/dependency/cmake/bin</cmake.root>
52+
</properties>
4953
<build>
5054
<plugins>
5155
<plugin>
@@ -69,14 +73,14 @@
6973
</execution>
7074
</executions>
7175
</plugin>
72-
<!--plugin>
76+
<plugin>
7377
<groupId>org.codehaus.gmaven</groupId>
7478
<artifactId>groovy-maven-plugin</artifactId>
7579
<executions>
76-
<!- - rename the cmake binary and generate a script that adds the sonar build-wrapper - ->
80+
<!-- rename the cmake binary and generate a script that adds the sonar build-wrapper -->
7781
<execution>
7882
<id>modify-cmake</id>
79-
<phase>process-sources</phase>
83+
<phase>process-test-sources</phase>
8084
<goals>
8185
<goal>execute</goal>
8286
</goals>
@@ -92,7 +96,7 @@
9296
<version>${groovy.version}</version>
9397
</dependency>
9498
</dependencies>
95-
</plugin-->
99+
</plugin>
96100
</plugins>
97101
</build>
98102
</profile>
@@ -295,7 +299,7 @@
295299
<!-- Generate the configuration for the test compilation -->
296300
<execution>
297301
<id>cmake-generate-test-compile</id>
298-
<phase>test-compile</phase>
302+
<phase>generate-test-sources</phase>
299303
<goals>
300304
<goal>generate</goal>
301305
</goals>

0 commit comments

Comments
 (0)