mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Build System
- Added new src/commands and src/columns intermediate libs. - Began implementation of the first Command object. - Began implementation of the first Column object. - TDB2, Variant updates.
This commit is contained in:
parent
f1fa315342
commit
0471c17f12
20 changed files with 513 additions and 184 deletions
14
src/commands/CMakeLists.txt
Normal file
14
src/commands/CMakeLists.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
cmake_minimum_required (VERSION 2.8)
|
||||
include_directories (${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/commands
|
||||
${CMAKE_SOURCE_DIR}/src/columns
|
||||
${TASK_INCLUDE_DIRS})
|
||||
|
||||
set (commands_SRCS Command.cpp Command.h
|
||||
Install.cpp Install.h)
|
||||
|
||||
add_library (commands STATIC ${commands_SRCS})
|
||||
|
||||
set (CMAKE_BUILD_TYPE debug)
|
||||
set (CMAKE_C_FLAGS_DEBUG "-ggdb3")
|
||||
set (CMAKE_C_FLAGS_RELEASE "-O3")
|
|
@ -27,9 +27,21 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <Command.h>
|
||||
#include <Context.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Command* Command::factory (const std::string& name)
|
||||
{
|
||||
/*
|
||||
if (name == "install") return new Install ();
|
||||
|
||||
throw std::string ("Unrecognized command '") + name + "'";
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Command::Command ()
|
||||
{
|
||||
|
|
|
@ -38,6 +38,8 @@ public:
|
|||
bool operator== (const Command&) const; // TODO Is this necessary?
|
||||
~Command ();
|
||||
|
||||
static Command* factory (const std::string&);
|
||||
|
||||
bool implements (const std::string&) const;
|
||||
std::string execute (const std::string&);
|
||||
|
||||
|
|
91
src/commands/Install.cpp
Normal file
91
src/commands/Install.cpp
Normal file
|
@ -0,0 +1,91 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free Software
|
||||
// Foundation; either version 2 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 General Public License for more
|
||||
// details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with
|
||||
// this program; if not, write to the
|
||||
//
|
||||
// Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor,
|
||||
// Boston, MA
|
||||
// 02110-1301
|
||||
// USA
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <iostream>
|
||||
#include <Install.h>
|
||||
#include <Context.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Install::Install ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Install::Install (const Install& other)
|
||||
{
|
||||
/*
|
||||
_minimum = other._minimum;
|
||||
*/
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Install& Install::operator= (const Install& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
/*
|
||||
_name = other._name;
|
||||
*/
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Install::operator== (const Install& other) const
|
||||
{
|
||||
return false;
|
||||
/*
|
||||
return _name == other._name &&
|
||||
_minimum == other._minimum &&
|
||||
_maximum == other._maximum &&
|
||||
_wrap == other._wrap &&
|
||||
_just == other._just &&
|
||||
_sizing == other._sizing;
|
||||
*/
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Install::~Install ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Install::implements (const std::string&) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Install::execute (const std::string&)
|
||||
{
|
||||
return "output";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
49
src/commands/Install.h
Normal file
49
src/commands/Install.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free Software
|
||||
// Foundation; either version 2 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 General Public License for more
|
||||
// details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with
|
||||
// this program; if not, write to the
|
||||
//
|
||||
// Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor,
|
||||
// Boston, MA
|
||||
// 02110-1301
|
||||
// USA
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef INCLUDED_INSTALL
|
||||
#define INCLUDED_INSTALL
|
||||
|
||||
#include <string>
|
||||
#include <Command.h>
|
||||
|
||||
class Install : Command
|
||||
{
|
||||
public:
|
||||
Install ();
|
||||
Install (const Install&);
|
||||
Install& operator= (const Install&);
|
||||
bool operator== (const Install&) const; // TODO Is this necessary?
|
||||
~Install ();
|
||||
|
||||
bool implements (const std::string&) const;
|
||||
std::string execute (const std::string&);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
Loading…
Add table
Add a link
Reference in a new issue