LoginSignup
20
20

More than 5 years have passed since last update.

openFrameworksでのプライベートなマルチプラットフォーム開発環境の構築

Last updated at Posted at 2014-08-06

環境

  • OS X 10.9.3
  • openFrameworks 0.8.3
  • Xcode 5.1.1

目的

openFrameworksの開発環境を、以下の要求を満たすように構築する。

  • マルチプラットフォーム(後々Windowsともリポジトリを共有するため)
  • gitリポジトリの容量を節約する
  • projectGeneratorはマルチプラットフォーム環境確保のためソースから必要
    • とりあえずOSX版のみビルドしとく

手順

GitHubから目的のバージョンをDLする

容量を減らすために、gitの履歴は不要なのでcloneしません。
下手にうまくやろうとせず、素直にzipなりなんなりで落としてきた方が単純で早いです。

また、マルチプラットフォームの要求を満たすため、openFrameworks公式からのDLもしません。

容量を軽くするため、極力削除する

  • apps/devApps
  • apps/projectGenerator/ProjectGeneratorSimple (submodule addで生成するので消しておきます)
  • CHANGELOG.md
  • CONTRIBUTING.md
  • docs
  • examples
  • (LICENSE.md)
  • other
  • README.md
  • tutorials

※ LICENSE.mdは人道的にも容量的にも消さないでいいと思います。

git initする

$ git init

Initialized empty Git repository in /path/to/of/directory/openFrameworks-0.8.3/.git/

projectGeneratorを追加

submodule addする

$ git submodule add git@github.com:ofZach/projectGeneratorSimple.git apps/projectGenerator/projectGeneratorSimple

Cloning into 'apps/projectGenerator/projectGeneratorSimple'...
remote: Counting objects: 738, done.
remote: Total 738 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (738/738), 848.68 KiB | 384.00 KiB/s, done.
Resolving deltas: 100% (396/396), done.
Checking connectivity... done

oFとprojectGeneratorとのバージョン不整合が心配な場合はGitHubで該当バージョンのハッシュをチェックしてcheckoutしてください
https://github.com/openframeworks/openFrameworks/tree/0.8.3/apps/projectGenerator

(0.8.3の場合)
$ cd apps/projectGenerator/projectGeneratorSimple
$ git checkout 3de40be

ちなみに0.8.3でこのバージョン(3de40be)はビルドできません(笑)
http://forum.openframeworks.cc/t/fix-for--cvdisplaylinkrelease-etc-errors/16423

ビルドしてコピーする

  1. apps/projectGenerator/projectGeneratorSimple/projectGenerator.xcodeprojをXcodeで開いてビルド
  2. ルートにprojectGeneratorディレクトリを作成
  3. apps/projectGenerator/projectGeneratorSimple/bin/内のdataprojectGeneratorDebug.appprojectGenerator以下にコピー
  4. projectGenerator/data/settings/projectGeneratorSettings.xmlをテキストエディタで開き、appToRootの値を修正
<appToRoot>./../</appToRoot>

projectGeneratorのための.gitignoreを作成

ルートにある.gitignore*.app/がignoreされているのでこのままだとprojectGenerator/projectGeneratorDebug.appがaddされない。
projectGenerator/.gitignoreを以下の内容で作成する。

projectGenerator/.gitignore
!*.app/

コミットする

$ git add .
$ git commit -m "first commit"

line endingss関連のwarningがたくさん出ても気にしない。

pushする

$ git remote add origin ssh://your.remote/repo.git
$ git push -u origin master

Counting objects: 2678, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2544/2544), done.
Writing objects: 100% (2678/2678), 192.87 MiB | 2.00 MiB/s, done.
Total 2678 (delta 508), reused 0 (delta 0)
remote: Resolving deltas: 100% (508/508)
remote: Updating references: 100% (1/1)
To ssh://your.remote/repo.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.

結果

ワーキングディレクトリ(.gitディレクトリ含む)の容量は約1GB。
$ git gcしたあとの.gitディレクトリの容量は約200MB。
それぞれoF0.8.3を丸ごとcloneした場合は1.8GBと935MBなのでそこそこ節約できているかと思います。

20
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
20