How To Treat Genexus Warnings in KB as UNSTABLE build in Jenkins/MSBuild - genexus

Is it possible to detect (and display) Genexus warnings when building a KB from a Jenkins Job?
I tried using the %ERROR_LEVEL% variable, but the value is '0' even if there where warnings in the build process.
Thanks

This is not exactly what I was looking for, but it´s a decent workaround: https://plugins.jenkins.io/log-parser/
This plugin can be configured as a post-build action (in freestyle jobs or declarative pipelines), parsing the build output and looking for the pattern "warning :"
Sample rules file used:
# GX build errors
error /error :/
# GX build warnings
warning /warning :/

Related

Coverity Scan for JS

I have initiated the Coverity scan for the JS using Coverity Wizards.
The capture build step has been completed & failed in to Run analysis step.
The failed message is "failed with error code 8. See console for details.
Some of your source code may not have been captured, which can result in fewer issues being found.
Please check that all project files in compiled languages are being built by the provided build command, and that all interpreted language files are parsable by the appropriate interpreter.
Please refer to the console for the build errors you are getting and see if your build is successful. Once your build will be successful ,then only you can run the cov-analysis .
For JavaScript you need to perform buildless capture. Please Run the cov-capture command for the repository/directory that contains your project(s).Kindly refer to cov_analysis_administration_guide.html document .You can find it under /doc/en/ folder.
Furthermore, which version of Coverity you are using ? Use of Coverity Wizard has been deprecated since 2021.09. You can try running the central build or point&scan .

Xcode 10, sourcery & swiftlint build phases order

After updating to Xcode 10 there are some issues with initial project configurations. The steps look like this:
Generating some files using Sourcery
Linting with SwiftLint
Build
And configuration works like this:
And this was working fine in Xcode 9, but apparently, it's not working under Xcode 10 build system. The issue is if I download repository (.generated files are not a part of the repository). And hit build it will show me results like:
...
Using configuration file at '.sourcery.yml'
Scanning sources...
Found 239 types.
Loading templates...
Loaded 9 templates.
Generating code...
Finished.
Processing time 0.491948962211609 seconds
...
So sourcery works ok, then linting:
Linting 'FromResponse.generated.swift' (1/186)
Works fine as well as a process, but in the end, build will fail with:
error: Build input files cannot be found:
'/path/Generated/FromResponse.generated.swift',
...
So it's strange since a files are physically there and according to build settings file should be compiled later than generating them. How should I approach sourcery in build process then?
We are able to "fix" this in a similar way as this Github issue:
https://github.com/mac-cain13/R.swift/issues/438#issuecomment-416982928
We have to add each of the generated files by Sourcery to the output folder and it will get picked up by the Xcode correctly.
This relates to changes in the New Xcode Build System that has been enabled by default in Xcode 10. If a build phase creates files which are needed as an input to a later build phase then it needs to specify them explicitly in the Output Files or Output File List.
In your example the Sourcery build phase is generating Swift source file(s) which are needed as input to the Compile Sources phase.
However, the issue at this point is that after you specify the output files for Sourcery, the build phase doesn't re-run every time as it sees the output file is already there. So far I haven't worked out a useable solution to this part, beyond running tools like Sourcery and SwiftGen manually or keeping the generated files in Git so that they are always present.
I was having a similar problem with a buildphase calling mogenerator to build my data model classes. The approach given by #Yuchen should work.
#Andrew: To force always (re-)running this build phase, I add the line
touch .alwaysRun
as the last line in the shell command to run and mark the build phase "Input Files" to have $(SRCROOT)/.alwaysRun. That seems to do the trick.

intellij idea: terminal window: making a filepath/file clickable

I'm implementing the Maven CPD PMD plug-in to to spot and (fail the build) if any instances of code duplication are presennt in the project.
This all works fine. However, The output error to the terminal in intellij idea is in the form:
Terminal output:
CPD Failure: Found 31 lines of duplicated code at locations:
[INFO]
C:\Users\bob\Documents\Project\Folder\src\main\java\HelloWorld.java
line 330
[INFO]
C:\Users\bob\Documents\Project\Folder\src\main\java\HelloWorld.java
line 428
This works fine and how it should do,
although, I recently had experience implementing Maven Check Style plug-in, which output error looks like this :
[INFO]
C:\Users\bob\Documents\Project\Folder\src\main\java\HelloWorld.java:428
This is infinitely more useful as I can just click on this "file path" and go directly to the file and line where this error occurs ie. HelloWorld.java at line 428.
so, my question is, is there anyway of getting intellij idea to "recognise" the output in the form:
[INFO]
C:\Users\bob\Documents\Project\Folder\src\main\java\HelloWorld.java
line 428
and making this "clickable" ??
Any help or insights will be greatly appreciated as having to manually navigate to the class is really annoying :( (especially as I have hundreds of errors).
Thanks all.. :)
With Intellij can you run your code using a Run Configuration rather than using the terminal? This will give you what you want.
Also, as a comment, Visual Studio Code does exactly what you want out of the box.

Maven build is very slow to load Flex air-config.xml

I'm stumped as to why a maven build for a project I just started working on is taking so long. The huge slow down is for Flex sdk to load the air-config.xml file. I am using Jenkins, but the build the build is just as slow if I build manually using the same commands. On the command line, it looks like Flex is actually building the .swf, because I see a bunch of warnings etc output that are not outputted in Jenkins.
Here's the build output (Jenkins output so you can see the timestamps). It takes 28 mins to load the air-config.xml file...
11:07:12 compile:
11:07:12 Loading configuration file
/usr/local/Adobe_Flex_Builder_Linux/sdks/3.3/frameworks/air-config.xml
11:35:50
/opt/dpf/.hudson/jobs/myprojectlocation/workspace/branch/web/target/app.swf
(4694359 bytes)
Any ideas? I'm not finding any info as to why it would take this long to load the file.
Ends up the problem was something to do with MAVEN_OPTS settings too high. Lowering the perm gen setting made a massive difference.

xcodebuild gives “profiling: invalid magic number”, doesn't generate coverage files

Let's get this out of the way first: This question is not a duplicate of this earlier question. I'll explain why below.
I'm running the command xcodebuild test -scheme 'ISO8601ForCocoa' SYMROOT=../build, and here's the output:
Executed 16 tests, with 0 failures (0 unexpected) in 0.047 (0.051) seconds
profiling: invalid magic number (0x656d6954)
profiling: invalid magic number (0x00000000)
** TEST SUCCEEDED **
The person who asked that earlier question got the same error message, but they fixed it by cleaning their build folder.
In my case, cleaning will not help, because I don't have a build folder yet. I still get this error message even on a completely fresh build. In fact, the .gcda and .gcno files are not even created, so there is nothing to clean.
xcodebuild puts build products in $SYMROOT, but stores profile products in $OBJROOT.
If you want to completely confine a build, including all intermediate and ultimate products, to a single directory, you need to set three build settings:
SYMROOT: Build Products Path (ultimate products, such as apps and test bundles)
OBJROOT: Intermediate Build Files Path (intermediate products, such as per-module object files—generated by the compiler, read by the linker—and .gcno/.gcda files)
SHARED_PRECOMPS_DIR: Precompiled Headers Cache Path (guess)

Resources