Import("env")
import Version

################################################################################
# Flags
################################################################################

if env["SCONS_STAGE"] == "flags" :
    env["SWIFT_CONTROLLERS_FLAGS"] = {
            "LIBPATH": [Dir(".")],
            "LIBS": ["SwiftControllers"]
        }


################################################################################
# Build
################################################################################

if env["SCONS_STAGE"] == "build" :
    myenv = env.Clone()
    myenv.BuildVersion("BuildVersion.h", project = "swift")
    myenv.UseFlags(env["SWIFTEN_FLAGS"])
    myenv.UseFlags(env["SWIFTEN_DEP_FLAGS"])
    myenv.StaticLibrary("SwiftControllers", [
            "Chat/ChatController.cpp",
            "Chat/ChatControllerBase.cpp",
            "Chat/ChatsManager.cpp",
            "Chat/MUCController.cpp",
            "Chat/MUCSearchController.cpp",
            "Chat/UserSearchController.cpp",
            "Chat/ChatMessageParser.cpp",
            "ContactSuggester.cpp",
            "MainController.cpp",
            "ProfileController.cpp",
            "ShowProfileController.cpp",
            "ContactEditController.cpp",
            "FileTransfer/FileTransferController.cpp",
            "FileTransfer/FileTransferOverview.cpp",
            "FileTransfer/FileTransferProgressInfo.cpp",
            "Roster/RosterController.cpp",
            "Roster/RosterGroupExpandinessPersister.cpp",
            "Roster/ContactRosterItem.cpp",
            "Roster/GroupRosterItem.cpp",
            "Roster/RosterItem.cpp",
            "Roster/Roster.cpp",
            "Roster/RosterVCardProvider.cpp",
            "Roster/TableRoster.cpp",
            "EventWindowController.cpp",
            "SoundEventController.cpp",
            "SystemTrayController.cpp",
            "XMLConsoleController.cpp",
            "HistoryViewController.cpp",
            "HistoryController.cpp",
            "FileTransferListController.cpp",
            "BlockListController.cpp",
            "StatusTracker.cpp",
            "PresenceNotifier.cpp",
            "EventNotifier.cpp",
            "AdHocManager.cpp",
            "AdHocController.cpp",
            "XMPPEvents/EventController.cpp",
            "UIEvents/UIEvent.cpp",
            "UIInterfaces/XMLConsoleWidget.cpp",
            "UIInterfaces/ChatListWindow.cpp",
            "UIInterfaces/HighlightEditorWindow.cpp",
            "PreviousStatusStore.cpp",
            "ProfileSettingsProvider.cpp",
            "Settings/SettingsProviderHierachy.cpp",
            "Settings/XMLSettingsProvider.cpp",
            "Storages/CertificateStorageFactory.cpp",
            "Storages/CertificateStorage.cpp",
            "Storages/CertificateFileStorage.cpp",
            "Storages/CertificateMemoryStorage.cpp",
            "Storages/AvatarFileStorage.cpp",
            "Storages/FileStorages.cpp",
            "Storages/RosterFileStorage.cpp",
            "Storages/CapsFileStorage.cpp",
            "Storages/VCardFileStorage.cpp",
            "StatusUtil.cpp",
            "Translator.cpp",
            "XMPPURIController.cpp",
            "ChatMessageSummarizer.cpp",
            "SettingConstants.cpp",
            "WhiteboardManager.cpp",
            "StatusCache.cpp",
            "HighlightAction.cpp",
            "HighlightEditorController.cpp",
            "HighlightManager.cpp",
            "HighlightRule.cpp",
            "Highlighter.cpp",
            "ContactsFromXMPPRoster.cpp",
            "ContactProvider.cpp",
            "Contact.cpp"
        ])

    env.Append(UNITTEST_SOURCES = [
            File("Roster/UnitTest/RosterControllerTest.cpp"),
            File("Roster/UnitTest/RosterTest.cpp"),
            File("Roster/UnitTest/LeastCommonSubsequenceTest.cpp"),
            File("Roster/UnitTest/TableRosterTest.cpp"),    
            File("UnitTest/PreviousStatusStoreTest.cpp"),
            File("UnitTest/PresenceNotifierTest.cpp"),
            File("Chat/UnitTest/ChatsManagerTest.cpp"),
            File("Chat/UnitTest/MUCControllerTest.cpp"),
            File("Chat/UnitTest/ChatMessageParserTest.cpp"),
            File("UnitTest/MockChatWindow.cpp"),
            File("UnitTest/ChatMessageSummarizerTest.cpp"),
            File("Settings/UnitTest/SettingsProviderHierachyTest.cpp"),
            File("UnitTest/HighlightRuleTest.cpp"),
            File("UnitTest/ContactSuggesterTest.cpp")
        ])