Question

I have Teamcity 7.0.3 installed with different projects. I want to use PHP Mess Detector. I want to have limited set of rules from PHP Mess Detector. And different set of rules for every project. So my questions are 1: How can I modify default rules of PHP Mess Detector? 2: How can I have different set of rules defined against each project in Teamcity?

My current build file content is :

<?xml version="1.0" encoding="UTF-8"?>
<project name="bnnpoa" default="analyse" basedir=".">
    <property name="project-name" value="${ant.project.name}" />
    <property name="work-dir" value="%system.teamcity.build.workingDir%" />
    <property name="folder-to-check" value="${work-dir}\sites" />
    <target name="analyse">
      <exec executable="C:\php\PEAR\scripts\phpmd.bat">
        <arg value="${folder-to-check}"/>
        <arg value="html"/>
        <arg value="C:\php\PEAR\resources\rulesets\naming.xml,C:\php\PEAR\resources\rulesets\codesize.xml,C:\php\PEAR\resources\rulesets\controversial.xml"/>
        <arg value=">"/>
        <arg value="${project-name}_analysis.htm"/>
      </exec>
    </target>
</project>
Was it helpful?

Solution

Add a build step and use same code for every project. To define your own rules you can modify XML files or copy them , modify rules as per needs, place files in same path and other option is to create new XML and import required rules from files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top