0
我正在更新sonar 3.6的聲納插件,但有一個問題: 這個插件包括工作流程類,但沒有類,比如自api 3.6 有沒有其他的類或方法來做到這一點?Sonar不支持api
這是我的工作代碼:
package org.sonar.plugins.redmine.reviews;
import org.sonar.api.ServerExtension;
import org.sonar.api.workflow.Workflow;
import static org.sonar.api.workflow.condition.Conditions.*;
import org.sonar.api.workflow.screen.CommentScreen;
import org.sonar.plugins.redmine.RedmineConstants;
public class RedmineWorkflowBuilder implements ServerExtension {
private final Workflow workflow;
private final RedmineLinkFunction linkFunction;
public RedmineWorkflowBuilder(Workflow workflow, RedmineLinkFunction linkFunction) {
this.workflow = workflow;
this.linkFunction = linkFunction;
}
public void start() {
workflow.addCommand(RedmineConstants.LINK_TO_REDMINE_ID);
workflow.setScreen(RedmineConstants.LINK_TO_REDMINE_ID, new CommentScreen());
workflow.addFunction(RedmineConstants.LINK_TO_REDMINE_ID, linkFunction);
// conditions for this function
// - on the review ("IDLE" is the non-persisted status of an non-existing review = when a violation does have a review yet)
workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, not(hasReviewProperty(RedmineConstants.ISSUE_ID)));
workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, statuses("IDLE", "OPEN", "REOPENED"));
// - on the project
workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, hasProjectProperty(RedmineConstants.HOST));
workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, hasProjectProperty(RedmineConstants.API_ACCESS_KEY));
workflow.addCondition(RedmineConstants.LINK_TO_REDMINE_ID, hasProjectProperty(RedmineConstants.PROJECT_KEY));
}
}
我的問題是繼續:(我怎樣才能得到任何違反信息(主題,描述..)與API?我還沒有找出這個任何類。 – gurpinars