All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qualinsight.plugins.sonarqube.badges.BadgesPluginProperties Maven / Gradle / Ivy

Go to download

This plugin adds a webservice to SonarQube that allows the retrieval of different types of badges that display as a SVG image the quality of a project or a view.

There is a newer version: 3.0.1
Show newest version
/*
 * qualinsight-plugins-sonarqube-badges
 * Copyright (c) 2015-2016, QualInsight
 * http://www.qualinsight.com/
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program. If not, you can retrieve a copy
 * from .
 */
package com.qualinsight.plugins.sonarqube.badges;

import java.util.ArrayList;
import java.util.List;
import org.sonar.api.PropertyType;
import org.sonar.api.config.PropertyDefinition;

/**
 * Declares all properties the plugin uses.
 * 
 * @author Michel Pawlak
 */
public final class BadgesPluginProperties {

    private static final String CATEGORY = "SVG Badges";

    /**
     * Key for quality gate badges activation.
     */
    public static final String GATE_BADGES_ACTIVATION_KEY = "qualinsight.badges.activation.gate";

    /**
     * Key for measure badges activation.
     */
    public static final String MEASURE_BADGES_ACTIVATION_KEY = "qualinsight.badges.activation.measure";

    private BadgesPluginProperties() {
        // Helper class
    }

    /**
     * Plugin properties retrieval method.
     *
     * @return list of properties declared by the plugin.
     */
    public static List properties() {
        final List properties = new ArrayList<>();
        properties.add(PropertyDefinition.builder(GATE_BADGES_ACTIVATION_KEY)
            .category(CATEGORY)
            .name("Enable quality gate badges")
            .description("Setting this property to true enables the quality gate badge generation webservice.")
            .type(PropertyType.BOOLEAN)
            .defaultValue("true")
            .build());
        properties.add(PropertyDefinition.builder(MEASURE_BADGES_ACTIVATION_KEY)
            .category(CATEGORY)
            .name("Enable measures badges")
            .description(
                "Setting this property to true enables the measures badge generation webservice. Note that this type of badges can be resource consuming and scalability hasn't been tested yet.")
            .type(PropertyType.BOOLEAN)
            .defaultValue("false")
            .build());
        return properties;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy