{
    "version": 1,
    "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ],
    "id": "M.BoostAutoTest",
    "category": "I.TestProject",
    "trDescription": "Creates a new unit test project using Boost. Unit tests allow you to verify that the code is fit for use and that there are no regressions.",
    "trDisplayName": "Boost Test Project",
    "trDisplayCategory": "Test Project",
    "icon": "../autotest.png",
    "iconKind": "Themed",
    "enabled": "%{JS: isPluginRunning('cppeditor')}",

    "options":
    [
        { "key": "ProjectFilePath",
          "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFileName') : (value('BuildSystem') == 'qbs' ? value('QbsFileName') : value('CMakeFileName')) }"
        },
        { "key": "ProFileName",
          "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}"
        },
        {
          "key": "QbsFileName",
          "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}"
        },
        {
          "key": "CMakeFileName",
          "value": "%{ProjectDirectory}/CMakeLists.txt"
        },
        { "key": "MainCppName",
          "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src') }"
        },
        {
          "key": "GUARD",
          "value": "%{JS: value('TestCaseFileWithHeaderSuffix').toUpperCase().replace('.', '_') }"
        },
        {
          "key": "TestCaseFileWithCppSuffix",
          "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src') }"
        }
    ],

    "pages":
    [
        {
            "trDisplayName": "Project Location",
            "trShortTitle": "Location",
            "typeId": "Project",
            "data":
            {
                "trDescription": "This wizard creates a simple unit test project using Boost."
            }
        },
        {
            "trDisplayName": "Project and Test Information",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data":
            [
                {
                    "name": "TestFrameWork",
                    "trDisplayName": "Test framework:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 0,
                        "items":
                        [
                            {
                                "trKey": "Boost Test (header only)",
                                "value": "BoostTest"
                            },
                            {
                                "trKey": "Boost Test (shared libraries)",
                                "value": "BoostTest_dyn"
                            }
                        ]
                    }
                },
                {
                    "name": "TestSuiteName",
                    "trDisplayName": "Test suite name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": { "validator": "^[a-zA-Z_0-9]+$" }
                },
                {
                    "name": "TestCaseName",
                    "trDisplayName": "Test case name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": { "validator": "^[a-zA-Z_0-9]+$" }
                },
                {
                    "name": "BoostIncDir",
                    "trDisplayName": "Boost include directory (optional):",
                    "visible": "%{JS: value('TestFrameWork') == 'BoostTest'}",
                    "mandatory": false,
                    "type": "PathChooser",
                    "data": {
                        "kind": "existingDirectory"
                    }
                },
                {
                    "name": "BoostInstallDir",
                    "trDisplayName": "Boost install directory (optional):",
                    "visible": "%{JS: value('TestFrameWork') == 'BoostTest_dyn'}",
                    "mandatory": false,
                    "type": "PathChooser",
                    "data": {
                        "kind": "existingDirectory"
                    }
                },
                {
                    "name": "BuildSystem",
                    "trDisplayName": "Build system:",
                    "type": "ComboBox",
                    "persistenceKey": "BuildSystemType",
                    "visible": "%{JS: !value('IsSubproject')}",
                    "data":
                    {
                        "index": 1,
                        "items":
                        [
                            {
                                "trKey": "qmake",
                                "value": "qmake",
                                "condition": "%{JS: isPluginRunning('qmakeprojectmanager')}"
                            },
                            {
                                "trKey": "CMake",
                                "value": "cmake",
                                "condition": "%{JS: isPluginRunning('cmakeprojectmanager')}"
                            },
                            {
                                "trKey": "Qbs",
                                "value": "qbs",
                                "condition": "%{JS: isPluginRunning('qbsprojectmanager')}"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "trDisplayName": "Kit Selection",
            "trShortTitle": "Kits",
            "typeId": "Kits",
            "data": {
                 "projectFilePath": "%{ProjectFilePath}",
                 "requiredFeatures": [ "%{JS: value('BuildSystem') === 'qmake' ? 'QtSupport.Wizards.FeatureQt' : 'DeviceType.Desktop' }" ]
            }
        },
        {
            "trDisplayName": "Project Management",
            "trShortTitle": "Summary",
            "typeId": "Summary"
        }
    ],
    "generators":
    [
        {
            "typeId": "File",
            "data":
            [
                {
                    "source": "../files/tst.pro",
                    "target": "%{ProjectFilePath}",
                    "condition": "%{JS: value('BuildSystem') == 'qmake'}",
                    "openInEditor": false,
                    "openAsProject": true
                },
                {
                    "source": "../files/tst.qbs",
                    "target": "%{ProjectFilePath}",
                    "condition": "%{JS: value('BuildSystem') == 'qbs'}",
                    "openInEditor": false,
                    "openAsProject": true
                },
                {
                    "source": "../files/tst.txt",
                    "target": "CMakeLists.txt",
                    "condition": "%{JS: value('BuildSystem') == 'cmake'}",
                    "openInEditor": false,
                    "openAsProject": true
                },
                {
                    "source": "../files/tst_main.cpp",
                    "target": "%{MainCppName}",
                    "openInEditor": true
                },
                {
                    "source": "../files/tst_src_boost.cpp",
                    "target": "%{TestCaseFileWithCppSuffix}",
                    "condition": "%{JS: value('TestFrameWork') === 'BoostTest_dyn'}"
                },
                {
                    "source": "../../projects/git.ignore",
                    "target": ".gitignore",
                    "condition": "%{JS: ( !value('IsSubproject') && value('VersionControl') === 'G.Git' )}"
                }
            ]
        }
    ]
}
