顯示具有 Open Source 標籤的文章。 顯示所有文章
顯示具有 Open Source 標籤的文章。 顯示所有文章

2017年12月8日 星期五

[Android] sync code


  • version control tools
    • repo
      • 簡介: 主要靠 Manifest 來記錄 remote, remote url, 各 project revision等資訊. Manifest 為一個 XML格式的檔案, 記錄各 project git 資訊, 預設的檔案名稱是 default.xml
      • 用法:
        • repo init -u mainfestURL -b branch
          • 通常第一步即透過 mainfest 的 URL得到想要的 manifest資訊, 會產生一個隱藏資料夾 .repo, 通常也可以製作 snapshot.xml
        • repo sync
          • 通常緊接於 repo init 或是透過 snapshot init後, 需要由 repo 通知各 project 進行 git checkout的動作
        • repo upload
          • 較少用到, Manifest 裡 remote 的欄位有設 review url的話, 便會進行 git push 的動作.
    • git
      • git checkout -b localBranchName remoteBranchName
      • git commit
        git commit --amend
        可修改最後一次 commit的內容
      • git push
        將 change 上到 remote
      • git pull
        sync .git 的資訊, 更新 metadata, 檔案等尚未進行 sync
      • 與 repo 可以整合應用, e.g.:
        repo forall -c 'git checkout branch'
      • git config
        設定 git的 configuration, 通常用在設定 user name跟 e-mail
      • git add fileName
      • git reset
      • 僅更改 file status
      • git checkout
      • 會重新抓檔案
      • git update-index --chmod=-x fileName
      • git diff (--cached)
      • git status
        非常常用, 看各個檔案目前是在什麼 status: tracked, untracked,...
  • Sync Android code
    • Setup repo
      • mkdir ~/bin
      • PATH=~/bin:$PATH
      • curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
      • chmod a+x ~/bin/repo
    • Setup git
      • git config --global user.name "Your Name"
      • git config --global user.email "you@example.com"
      • P.S.: 若是在 synology nas上操作的話, 可能遇到
        error: could not lock config file /var/services/homes/yourName/.gitconfig: No such file or directory
        的問題
        • 在 Control Panel->User Account->Advanced Option中啟用家目錄即可
      • repo init -u https://android.googlesource.com/platform/manifest
      • repo sync -j8
    • Reference: Downloading the Source

2012年11月26日 星期一

[Mac] build wxWidgets2.8.12 from source code in MacOSX


  • 執行以下程式
    • mkdir build
    • cd build
    • arch_flags="-arch -i386"
    • ../configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" --enable-unicode --enable-debug --disable-shared --with-osx_cocoa --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
    • make
    • cd ..
    • cd build-carbon-debug/samples;make;cd ../..
    • cd build-carbon-debug/demos;make;cd ../..
  • 發生以下錯誤
    • ../include/wx/mac/carbon/private.h:1459: error: 'Cursor' does not name a type
  • 解決辦法
    • Apple Developer Center 下載 XCode 4.3.3
    • 右鍵選擇 Package Content
    • 將 /Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSC10.6.sdk 整個資料夾 copy到 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
    • build clean
    • build
  • 參考網站