페이스북 플래시웹앱 개발 ANT 설정

페이스북 플래시웹앱 개발 ANT 설정

1 ant 설치 확인[ | ]

플래시 빌더 4.6에는 ANT가 포함되어 있다.

  • 플래시 빌더 --- Window --- Show View --- Other...

Fb 4 6 show view.png

→ Ant가 설치되어 있다.[1]
  • "Show View" --- Ant --- Ant --- [OK]
  • Ant영역을 하단에 배치

2 jar 모듈 추가[ | ]

FTP에 업로드하려면 commons-net-3.1.jar이, SFTP에 업로드하려면 jsch-0.1.48.jar이 필요하다. 둘 다 추가해두자.

jars 폴더 생성
  • 플래시 빌더 --- File --- Switch Workspace --- Other... --- Workspace 위치 확인
"Workspace Launcher" --- Workspace에 있는 것이 workspace 위치이다.
( 필자의 경우 D:\Adobe Flash Builder 4.6 )
  • 이 문자열(workspace 위치)을 복사( Ctrl+C )해두고 [Cancel]
  • [시작] --- Ctrl+V Enter (즉, 탐색기에서 workspace 폴더로 이동)
  • jars 폴더 생성
commons-net 다운로드
jsch 다운로드
연동 설정
  • 플래시 빌더 --- Window --- Preferences
  • "Preferences" --- Ant --- Runtime --- Classpath 탭 --- Ant Home Entries (Default) 선택 --- [Add External JARs...]
  • "열기" --- jars 폴더로 이동 --- commons-net-3.1.jar와 jsch-0.1.48.jar 선택 --- [열기(O)]
  • "No tools.jar" --- [Yes] --- [OK]

3 build.xml 생성[ | ]

  • 패키지 탐색기 --- RelightMyFireWeb 우클릭 --- New --- Folder
  • "New Folder" --- Folder name: build --- [Finish]
  • 패키지 탐색기 --- RelightMyFireWeb --- build 폴더 우클릭 --- New --- File
  • "New File" --- File name: build.xml --- [Finish]
  • build.xml에 다음 내용을 기입
<?xml version="1.0" encoding="UTF-8"?>
<project name="RelightMyFireWeb" basedir=".." default="all">
	<property file="build/build.properties" />
	<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
	<target name="clean">
		<delete file="bin-debug/*.*"/>
	</target>
	<target name="upload">
		<scp todir="${scp.username}:${scp.password}@${scp.server}:${scp.directory}" trust="yes">
		<fileset dir="bin-debug">
		<include name="*.*" />
		<exclude name="**/images" />
		</fileset>
		</scp>	
	</target>
	<target name="chrome">
		<exec executable="${chrome.exe}" spawn="true">
    		<arg value="http://jmnote.com/flex/RelightMyFire/"/>
		</exec>
	</target>
	<target name="all" depends="clean,upload,chrome"/>
</project>
→ bin-debug 중 images 폴더는 제외하고 업로드 한다.
→ 이 예제는 scp(SFTP)를 통해 업로드한다. (FTP 접속이 필요하다면 build.xml 참고)

4 build.properties 생성[ | ]

  • 패키지 탐색기 --- RelightMyFireWeb --- build 폴더 우클릭 --- New --- File
  • "New File" --- File name: build.properties --- [Finish]
scp.server = 서버주소
scp.directory = 배포폴더
scp.username = SSH계정
scp.password = 패스워드

FLEX_HOME = 플렉스SDK위치

chrome.exe = 크롬실행파일
예시
scp.server = jmnote.com
scp.directory = /var/www/html/RelightMyFire
scp.username = deployuser
scp.password = P@ssw0rd

FLEX_HOME = C:/Program Files (x86)/Adobe/Adobe Flash Builder 4.6/sdks/4.6.0

chrome.exe = D:/Portable/Chrome/chrome.exe

5 실행 테스트[ | ]

  • 플래시 빌더 --- Package Explorer --- build --- build.xml를 드래그하여 Ant 탭 영역에 추가
  • Ant 탭의 all을 더블클릭하여 실행
Buildfile: D:\Adobe Flash Builder 4.6\RelightMyFireWeb\build\build.xml
clean:
upload:
      [scp] Connecting to jmnote.com:22
      [scp] done.
chrome:
all:
BUILD SUCCESSFUL
Total time: 5 seconds
→ rebuild 되어 서버로 업로드된 후 브라우저가 열린다.

6 같이 보기[ | ]

7 주석[ | ]

  1. 만약 없다면 http://cometkorea.tistory.com/69?srchid=IIMurVcR000 참고하여 설치

8 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}