'설치'에 해당되는 글 2건

  1. 2009.09.14 [SVN] 설치하기
  2. 2009.03.03 [Ant] 설치 및 따라해보기 2

[SVN] 설치하기

자료 2009. 9. 14. 13:33

갈릴레오를 쓰다가 프로젝트를 위해 이클립스SDK를 받았다.
SVN을 설치해야 하는데 어떻게 했었는지 그새 잊어버려서...

주소를 입력한다.
서브버전의 버전이 높아서 안된다. 즉, 이클립스가 후달린다...

버전을 1.2.x로 했더니 된다.
Posted by zeide
,
설명을 안써서...
매뉴얼에 나와있지만 써본다.
Apache Ant is a Java-based build tool. In theory, it is kind of like make, without make's wrinkles.

사실 설치하는 것을 설명할 필요는 없다.
http://ant.apache.org/manual/index.html
매뉴얼이 친절하게 알려준다.

여기서 중요한 점은 환경변수 설정인데
- Add the bin directory to your path.
- Set the ANT_HOME environment variable to the directory where you installed Ant. On some operating systems, Ant's startup scripts can guess ANT_HOME (Unix dialects and Windows NT/2000), but it is better to not rely on this behavior.
라고 나와있다.
PATH에 빈디렉터리를 추가해주고 ANT_HOME을 만들어서 ANT의 경로를 추가해주면 된다.
도스창에 들어가서 ant를 치면 메시지가 띡-하고 뜬다. 그 다음에 버전을 체크하면 버전표시가 띡-하고 뜬다.

그 다음 중요한 점은 buildfile 작성하기.
ant의 빌드파일은 xml로 되어있다.

빌드파일의 예제

<project name="MyProject" default="dist" basedir=".">
    <description>
        simple example build file
    </description>
  <!-- set global properties for this build -->
  <property name="src" location="src"/>
  <property name="build" location="build"/>
  <property name="dist"  location="dist"/>

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init"
        description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}"/>
  </target>

  <target name="dist" depends="compile"
        description="generate the distribution" >
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
  </target>

  <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>

http://pcguy7.springnote.com/pages/546569
다음에 올라온 예제를 실행해본 결과,

Buildfile: E:\project\ztest\WebContent\build.xml
prepare:
     [echo] Build Start!! ======> 2009.03.04-10:41
clean:
   [delete] Deleting directory E:\project\ztest\WebContent\dist
compile:
    [mkdir] Created dir: E:\project\ztest\WebContent\build
mkjar:
    [mkdir] Created dir: E:\project\ztest\WebContent\dist
      [jar] Warning: skipping jar archive E:\project\ztest\WebContent\dist\1.0_helloprint.jar because no files were included.
      [jar] Building MANIFEST-only jar: E:\project\ztest\WebContent\dist\1.0_helloprint.jar
dist:
     [copy] Copied 1 empty directory to 1 empty directory under E:\project\ztest\WebContent\dist\lib
     [copy] Copied 1 empty directory to 1 empty directory under E:\project\ztest\WebContent\dist\src
      [zip] Building zip: E:\project\ztest\WebContent\2009.03.04_1.0_helloprint.zip
BUILD SUCCESSFUL
Total time: 203 milliseconds
경고만 빼면...그럭저럭 돌아가는 듯하다.
Posted by zeide
,