Last active
August 29, 2015 14:08
-
-
Save mattfelsen/b50762ed68a9e43f7388 to your computer and use it in GitHub Desktop.
Local Projects openFrameworks New Project Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# NOTE: The openFrameworks folder structure (particularly with regard to the projectGenerator) | |
# has changed since this script was written, so this will probably not work! | |
# (The parts about creating a new project toward the end, at least.) | |
# | |
# | |
# usage: | |
# | |
# ./setup.sh <project-name> <git-remote-url> | |
# | |
# examples: | |
# | |
# For a GitHub-hosted project: | |
# ./setup.sh ProjectName https://github.com/local-projects/ProjectName.git | |
# | |
# For an Assembla-hosted project: | |
# ./setup.sh ProjectName [email protected]:project-name.repo-name.git | |
# | |
# TODO | |
# need to do some checking on $1 and $2 to see if they're empty, whether | |
# $1 is a URL and we're already inside the project dir, etc. | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# | |
# project folder setup | |
# | |
# create the project folder, move in | |
mkdir $1 | |
cd $1 | |
# make the folder structure | |
mkdir Apps | |
mkdir Configs | |
mkdir Deployment | |
mkdir Deployment/Scripts | |
mkdir Documentation | |
mkdir ExternalAddons | |
mkdir Scripts | |
mkdir Sketches | |
# create stubs for scripts | |
touch build.command | |
touch Scripts/start.command | |
touch Scripts/stop.command | |
# create stub for readme | |
touch README.md | |
# | |
# git repo setup | |
# | |
# make a repo | |
git init | |
# add origin remote to point at new project repo | |
git remote add origin $2 | |
# | |
# openFrameworks setup | |
# | |
# add as submodule | |
git submodule add https://github.com/local-projects/openFrameworks.git | |
# switch to the stable branch | |
# this corresponds to the latest release | |
cd openFrameworks | |
git checkout stable | |
# add the official OF repo as a remote | |
# so changes can be synced | |
git remote add upstream https://github.com/openframeworks/openFrameworks.git | |
# stage the submodule's commit to the stable branch instead of master | |
cd .. | |
git add openFrameworks | |
# | |
# openFrameworks projectGenerator | |
# | |
# build the projectGenerator | |
cd openFrameworks/apps/devApps/projectGenerator/ | |
xcodebuild | |
# set the projectGenerator OF root to our newly cloned OF repo | |
echo $DIR/$1/openFrameworks > ~/.ofprojectgenerator/config | |
# create the first app for the new project | |
./bin/emptyExample.app/Contents/MacOS/emptyExample | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment