顯示具有 Software Engineer 標籤的文章。 顯示所有文章
顯示具有 Software Engineer 標籤的文章。 顯示所有文章

2018年7月7日 星期六

[Software Engineering] use CMake to add version


  • Problem: 如何在軟體中加入版號?
  • How:
    • 工具: CMake (跨平台的 configuration tool, 可建立各平台的 build solution/project file)
    • 流程:
      • 在 project setting 檔案 (CMakeLists.txt) 內加入版號
      • set (APP_VERSION_MAJOR 1)
        set (APP_VERSION_MINOR 0)
        
      • 在 source code 中新增特定的預設 config.h.in 檔 (config.h 會是 build config.h.in 後的產物)
      • // the configured options and settings for App 
        #define APP_VERSION_MAJOR @APP_VERSION_MAJOR@
        #define APP_VERSION_MINOR @APP_VERSION_MAJOR@
        
      • CMakeLists.txt 中指定此 config.h 檔及預設的 config.h.in參考檔
      • configure_file (
            "${PROJECT_SOURCE_DIR}/config.h.in"
            "${PROJECT_BINARY_DIR}/config.h"
        ))
      • 如此就可以在 source code 中, include config.h 並使用 APP_VERSION_MAJOR, APP_VERSION_MINOR
      • 另外, 若 build成 shared binary 的話, 也可以像 linux一樣設計成 app_3.1.2 這樣的 binary, 然後 app為 symbolic link to app_3.1.2
        • CMakeLists.txt 中加入 target property VERSION 與 SONAME
        • set(APP_VERSION_STRING ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH})
          
          set_target_properties(App PROPERTIES 
              VERSION ${APP_VERSION_STRING} 
              SOVERSION ${APP_VERSION_MAJOR}
          )
          
  • Reference: CMake tutorial

2012年9月19日 星期三

[Mantis] 安裝與使用


  1. Requirements:
    1. Apache
    2. MySQL
    3. PHP: 5.3 up
    4. 前兩個沒寫主要是我用 Apache 2.2跟 MySQL 5.07並沒遇到啥問題, 反倒是 PHP 5.2.6被 argue了, 所以特別註明一下
  2. 基本安裝
    1. 下載
    2. 解壓縮並丟到 apache上執行該資料夾下 admin/install.php, 其快速安裝在其 doc/INSTALL, 詳細 document在 doc/lang中
    3. 過程中會幫你設定 MySQL, 若沒給定具有建 database權限的使用者, 將會有點 issue, 必須手動建立一下
    4. 安裝完執行 admin/check.php 看是否相容
      1. 一般就是 upload file的 size問題, 稍微改一下 php.ini的 upload_max_filesize應該就可以通過
    5. 移除 admin資料夾
  3. 更改預設帳號 (帳號: administrator/密碼: root)
    1. 以預設帳號登入後, 選擇 Manage-> Manage Users
    2. Create User並將其權限設為 Administrator
    3. 移除預設 administrator帳號
  4. 用 stmp發送信件(預設為 php.mail()), 底下以 gmail為例
    1. 開啟 mantis資料夾下\config_defaults_inc.php
    2. 修改參數
      1. $g_phpMailer_method= PHPMAILER_METHOD_SMTP;
      2. $g_smtp_host = 'smtp.gmail.com';
      3. $g_smtp_username = 'gmail帳號';
      4. $g_smtp_password = 'gmail密碼';
      5. $g_smtp_connection_mode = 'ssl';
      6. $g_smtp_port = 465;
    3. 搞定! (若還是不行, 可參考 Joomla Gmail設定中修改 php.ini)
  5. 開始使用
    1. 語言設定
      1. 若不習慣英文, 每個人可自行調整看到的介面
        1. My Profile->Preference->language調整即可
    2. 個人設定
      1. 我的帳號-> 基本資料->可以加入平常操作環境, 等回報 bug時選擇環境即可
    3. Manage Projects-> Create New Project
    4. 使用者管理
      1. 如果 config_defaults_inc.php設定 $g_enable_email_notification = ON (預設為 ON), 則使用者註冊需通過 email來建立帳號
    5. 回報問題

    6. Issue 生命週期與流程
      1. 建立 issue
      2. issue狀態
  6. Ref:
    1. 中文化問題
    2. Mantis操作說明
    3. Mantis安裝設定

[Software] 開發工具

其實開發輔助工具超級多的, 像是

  1. build chain 就有 configure工具、make工具
  2. IDE (Integrated Development environment) 就更不用說了, 萬萬種, e.g. Code Blocks, Visual Studio, XCode, etc.
  3. 版本控制: 有名的有 CVS, SVN, Git
  4. Bug Tracker: BugZilla, Mantis
  5. CI: jenkins
  6. Code review: gerrit
  7. Code formatter: AStyle (setting)