Skip to main content

LG3Dアプリ作成用のスクリプト

1 reply [Last post]
Anonymous

??????

JavaOne??????????????????
LG3D?????????????????
???0.8??????????????????
????????????????????

?????
makelg3dapp foo.bar.Hello
????????main?????????
build.xml??????????

????????????incubator????????
??????????????????
.
|-- build.xml
|-- ext/
`-- src/
|-- build-scripts/
| `-- build-bar.xml
|-- classes/
| `-- foo/
| `-- bar/
| |-- Hello.java
| `-- resources/
| `-- images/
| `-- icon/
| `-- bar.png
`-- config/
`-- bar.lgcfg

?????????????????????
-m menuGroup
???????????
-d description
???????????
-h
?????

?????????
???????????????
????LG3DHOME????????????????
????????????CVS?0.8?????????
0.7???????????lgcfg??????????????
0.7.1???????src/config/*.lgcfg?
StartMenuItemConfig??????
org.jdesktop.lg3d.apps.startmenu.StartMenuItemConfig
????menuGroup??????????
??????????
?????????????????????
bash???????????????
?ImageMagick????????????
convert???????? /usr/bin/convert ???????
???????????????
?build-scripts?build-xxx.xml??????????
src???incubator??????????????????
?????????????

#!/bin/sh
generateBuildXML() {
local clsName=$1
local baseName=${clsName##*.}
local pkgName=${clsName%.*}
local outputDir=$2
local pkgBase=${pkgName##*.}
local pkgDir=${pkgName//.//}

cat > $outputDir/build.xml <

EOF
}

generateBuildScript() {
local clsName=$1
local baseName=${clsName##*.}
local pkgName=${clsName%.*}
local pkgBase=${pkgName##*.}
local pkgDir=${pkgName//.//}
local outputFile=$2

cat > $outputFile <

EOF
}

generateConfig() {
local clsName=$1
local description="$2"
local menuGroup="$3"
local output=$4

local baseName=${clsName##*.}
local pkgName=${clsName%.*}
local pkgBase=${pkgName##*.}

cat > $output <

java $clsName

$description

ICON

resources/images/icon/$pkgBase.png

$menuGroup

${baseName}

EOF
}

generateLG3DMain() {
local clsName=$1
local pkgName=${clsName%.*}
local baseName=${clsName##*.}
local dir=$2
local sourceFile=${clsName//.//}.java

cat > $2/$sourceFile < makelg3dapp foo.bar.Hello
options)
-d description
-m menuGroup

EOF
}

if [ x"$LG3DHOME" = x ]; then
echo The environment LG3DHOME was not set.
exit -1
fi

description="description-of-app"
menuGroup="Applications"

while getopts hd:m: OPT
do
case $OPT in
d) description="$OPTARG"
;;
m) menuGroup="$OPTARG"
;;
?) usage
exit -1
;;
esac
done
shift `expr $OPTIND - 1`

if [ $# -lt 1 ]; then
usage
exit -1
fi

clsName=$1
if ! (echo $clsName | grep '\.' > /dev/null); then
usage
exit -1
fi

pkgName=${clsName%.*}
pkgBase=${pkgName##*.}
pkgDir=${pkgName//.//}

if [ -e $pkgBase ]; then
echo The directory $pkgBase already exits.
exit -1
fi

mkdir $pkgBase
mkdir $pkgBase/ext
mkdir -p $pkgBase/src/build-scripts $pkgBase/src/classes $pkgBase/src/config
mkdir -p $pkgBase/src/classes/$pkgDir/resources/images/icon

generateBuildXML $clsName $pkgBase
generateBuildScript $clsName $pkgBase/src/build-scripts/build-$pkgBase.xml
generateConfig $clsName "$description" "$menuGroup" $pkgBase/src/config/$pkgBase.lgcfg
generateIcon $pkgBase $pkgBase/src/classes/$pkgDir/resources/images/icon
generateLG3DMain $clsName $pkgBase/src/classes
---------------------------------------------------------------------
To unsubscribe, e-mail: interest_ja-unsubscribe@lg3d.dev.java.net
For additional commands, e-mail: interest_ja-help@lg3d.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hideya
Offline
Joined: 2003-07-22

えんどうさん,こんにちは.ひでやです.

LG3Dアプリ作成用スクリプトの公開,どうもありがとうございました.
早速,0.8の環境にあわせて頂いて,助かります.

> src以下をincubatorに入れられるように作っておきました。

こちらの方もご配慮ありがとうございますっ.
Incubatorのディレクトリ構造を各プロジェクトの独立性がもっと
高くなるように(つまりアプリのビルドに必要なもの(srcやconfigなど
も)はすべてアプリのディレクトリの下に置く)変更した方が良いね,
という議論はあるのですが,お話レベルで止まっています...
(そうすれば,Incubatorへのインテグレーションが簡単になるのですが)

ひでや