Skip to main content
Inspiring
December 2, 2010
Question

Is there a way to fail a build on duplicate code detected by FlexCPD

  • December 2, 2010
  • 1 reply
  • 839 views

Hi,

In Ant scripts we could set failonruleviolation="true" when executing FlexPMD and this will lead to failed build on violations.

Is there something similar for FlexCPD?

Thanks

This topic has been closed for replies.

1 reply

clintmodien
Known Participant
December 2, 2010

Here's the targets i used... it requires ant-contrib though...

<mkdir dir="$/reports/flexcpd" /> <cpd minimumTokens="40" outputFile="reports/flexcpd/cpd.xml" sourceDirectory="$" />

</target

Inspiring
December 3, 2010

Thanks for the reply.

I believe the target which you sent is for executing FlexCPD however it won't mark the build as failed in case there are code duplications. It will always finish as "BUILD SUCCESSFUL".

I was looking for something quick I could implement to have the build failed on code duplications.