Skip to content

Commit

Permalink
#1317 Windows環境でcmake、VCビルド、インストール、プラグイン作成までを行う BuildInstall.bat と全ての…
Browse files Browse the repository at this point in the history
…環境でプラグインを作成するための Ant ビルドファイル BuildPlugin.xmlの追加
  • Loading branch information
k.saeki committed Mar 30, 2010
1 parent 83e0063 commit 98fe90a
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 0 deletions.
97 changes: 97 additions & 0 deletions BuildInstall.bat
@@ -0,0 +1,97 @@
@echo off
setlocal

rem set INSTALL_DIR=%ProgramFiles%\OpenHRP
set VC_PLATFORM=Visual Studio 9 2008
set VC_COMMAND=C:/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/VCExpress.exe
set ECLIPSE_LAUNCHER=C:\eclipse\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar

if "%1"=="" (
call :AllStart
goto :EndBatch
)

if /i "%1"=="cmake" (
call :CMake
goto :EndBatch
)

if /i "%1"=="debug-build-install" (
call :DebugBuild
goto :EndBatch
)

if /i "%1"=="build-install" (
call :Build
goto :EndBatch
)

if /i "%1"=="build-plugin" (
call :Plugin
goto :EndBatch
)

echo "Usage: BuildInstall [Option]"
echo "Option List:"
echo " cmake"
echo " build-install"
echo " debug-build-install"
echo " build-plugin"
goto :EndBatch

:AllStart
call :CMake
if errorlevel 1 goto :EOF

call :Build
if errorlevel 1 goto :EOF

call :Plugin
if errorlevel 1 goto :EOF
goto :EOF

:CMake
if defined INSTALL_DIR (
echo Output solution file. It install in %INSTALL_DIR%
call cmake -G "%VC_PLATFORM%" -DCMAKE_INSTALL_PREFIX:PATH=%INSTALL_DIR%
) else (
echo Output solution file. It install in %ProgramFiles%\OpenHRP
call cmake -G "%VC_PLATFORM%"
)
goto :EOF

:Build
if not exist OpenHRP.sln (
echo Not Found OpenHRP.sln. Please "BuildInstall cmake".
exit /b 1
)
echo Build solution. Log file is make_release.log
call "%VC_COMMAND%" OpenHRP.sln /rebuild Release /out make_release.log
echo Install OpenHRP. Log file is install_release.log
call "%VC_COMMAND%" OpenHRP.sln /build Release /project INSTALL.vcproj /out install_release.log
goto :EOF

:DebugBuild
if not exist OpenHRP.sln (
echo Not Found OpenHRP.sln. Please "BuildInstall cmake".
exit /b 1
)
echo Build debug solution. Log file is make_debug.log
call "%VC_COMMAND%" OpenHRP.sln /rebuild Debug /out make_debug.log
echo Install OpenHRP. Log file is install_debug.log
call "%VC_COMMAND%" OpenHRP.sln /build Debug /project INSTALL.vcproj /out install_debug.log
goto :EOF

:Plugin
if not exist bin\Release\openhrp-controller-bridge.exe (
echo not build OpenHRP. Please "BuildInstall Build".
exit /b 1
)
echo Build eclipse pliugin.
call java -jar %ECLIPSE_LAUNCHER% -application org.eclipse.ant.core.antRunner -data "workspace" -buildfile BuildPlugin.xml
if exist workspace rmdir /s /q workspace
goto :EOF

:EndBatch
endlocal
@echo on
33 changes: 33 additions & 0 deletions BuildPlugin.xml
@@ -0,0 +1,33 @@
<!--
usage : java -jar <eclipse launcher jar> -application org.eclipse.ant.core.antRunner -data <workspace dir> -buildfile plugin.xml
example : java -jar C:\eclipse\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar -application org.eclipse.ant.core.antRunner -data "workspace" -buildfile BuildPlugin.xml
-->

<project default="main">

<target name="main">
<property name="baseLocation" value="${eclipse.home}"/>
<property name="buildspace.dir" value="${basedir}" />
<property name="builder" value="${buildspace.dir}" />
<property name="buildDirectory" value="${buildspace.dir}/GrxUIonEclipse-project-0.9.8"/>

<property name="pluginPath" value="${buildspace.dir}" />

<eclipse.buildScript
elements="plugin@com.generalrobotix.ui.grxui"
baseLocation="${baseLocation}"
buildDirectory="${buildDirectory}"
/>

<ant antfile="${buildDirectory}/build.xml" dir="${buildDirectory}" target="build.update.jar" >
<property name="javacTarget" value="1.6"/>
<property name="javacSource" value="1.6"/>
</ant>

<copy todir="./">
<fileset dir="${buildDirectory}" includes="com.generalrobotix.ui.grxui*.jar"/>
</copy>

</target>
</project>

0 comments on commit 98fe90a

Please sign in to comment.