From 146f3a73b00cbbafc734578c767b932030bc1aec Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Feb 21 2013 12:07:35 +0000 Subject: Web UI development environment directory structure and configuration Added symbolic links which points to directories which should contain files of Web UI layers. By changing those links we can switch between debugging (using source codes) or testing (compiled version). util/change-profile.sh utility serves for changing symbolic links in js/ dir and therefore for switching between debugging and testing. Default configuration for development is: * freeipa source files * libs as in git * compiled Dojo layer https://fedorahosted.org/freeipa/ticket/112 --- diff --git a/install/ui/js/dojo b/install/ui/js/dojo new file mode 120000 index 0000000..d6b3ac7 --- /dev/null +++ b/install/ui/js/dojo @@ -0,0 +1 @@ +../build/dojo \ No newline at end of file diff --git a/install/ui/js/freeipa b/install/ui/js/freeipa new file mode 120000 index 0000000..6f2b861 --- /dev/null +++ b/install/ui/js/freeipa @@ -0,0 +1 @@ +../src/freeipa \ No newline at end of file diff --git a/install/ui/js/libs b/install/ui/js/libs new file mode 120000 index 0000000..8fa90e2 --- /dev/null +++ b/install/ui/js/libs @@ -0,0 +1 @@ +../src/libs/ \ No newline at end of file diff --git a/install/ui/util/change-profile.sh b/install/ui/util/change-profile.sh new file mode 100755 index 0000000..676e8dd --- /dev/null +++ b/install/ui/util/change-profile.sh @@ -0,0 +1,142 @@ +#!/bin/bash + +# Authors: +# Petr Vobornik +# +# Copyright (C) 2012 Red Hat +# see file 'COPYING' for use and warranty information +# +# 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 3 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, see . + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +RDIR=$DIR/../release + +usage() { +cat <<-__EOF__; +NAME + change-profile.sh - Changes development enviroment. + +SYNOPSIS + path/to/change-profile.sh [--help] [--profile] NAME + +DESCRIPTION + Changes symbolic links to switch between development profiles. Run + with --git-ignore option to prevent git change notifications. + +OPTIONS + --help print the help message + + -p PROFILE + --profile PROFILE + allsource: both dojo, freeipa uses source files + compiled: both dojo, freeipa uses compiled versions + source: dojo compiled, freeipa source files + default: source + --git-ignore + set git --assume-unchanged on dojo and freeipa symlinks + --git-undo + undo --git-ignore + +__EOF__ +} + +args=`getopt -u -l help,profile:,git-ignore,git-undo p: $*` + +if test $? != 0 +then + usage + exit 1 +fi + +set -- $args +for i +do + case "$i" in + --help) + shift; + HELP=1 + ;; + --profile | -p) + shift; + PROFILE=$1 + shift; + ;; + --git-ignore) + shift; + GIT_IGNORE=1 + ;; + --git-undo) + shift; + GIT_UNDO=1 + ;; + *) + ;; + esac +done + +set -- $args + +if [[ $HELP ]] ; then + usage + exit 0 +fi + +if [[ $# = 2 ]] ; then + PROFILE=$2 +fi + +if [[ $# = 1 ]] ; then + PROFILE='source' +fi + +printprofile() { + echo "Setting profile: $PROFILE" +} + + +pushd $DIR/../js + rm -f ./dojo + rm -f ./freeipa + + case "$PROFILE" in + 'source') + printprofile + ln -s ../build/dojo ./dojo + ln -s ../src/freeipa ./freeipa + ;; + 'allsource') + printprofile + ln -s ../src/dojo ./dojo + ln -s ../src/freeipa ./freeipa + ;; + 'compiled') + printprofile + ln -s ../build/dojo ./dojo + ln -s ../build/freeipa ./freeipa + ;; + *) + echo "Error: Unknown profile: $PROFILE" + ;; + esac + + if [[ $GIT_IGNORE ]] ; then + git update-index --assume-unchanged ./dojo + git update-index --assume-unchanged ./freeipa + fi + + if [[ $GIT_UNDO ]] ; then + git update-index --no-assume-unchanged ./dojo + git update-index --no-assume-unchanged ./freeipa + fi +popd \ No newline at end of file