2009-10-29 7 views
2

리눅스에서 Eclipse Plugin 실행 쉘 스크립트가 필요합니다. 나는 아름다운 Rsync 스크립트를 가지고 있으며 이클립스에서 버튼을 활성화하려고한다.Eclipse 커맨드 라인 플러그인

가장 좋은 해결책은 Stuff를 저장할 때 Rsync 셸 스크립트도 활성화 되었기 때문에 스크립트 작성기 또는 이와 비슷한 것을 추가 할 수 있습니다.

누구나 솔루션에 대한 단서가 있습니까?

답변

7

external tools feature을 사용할 수 있습니다. 쉘 스크립트를 실행하려면 위치 필드 /bin/sh에 넣고 인수는 쉘 스크립트 자체 여야합니다.

저장 중에 스크립트를 실행하려면 Eclipse의 내부 빌더를 사용할 수 있습니다.

프로젝트 -> 속성 -> 빌더 -> 새 ... -> 프로그램

당신이 확인하십시오하여 "빌드 옵션"탭의 옵션 "자동 빌드하는 동안", "클린 후".

+0

대단히 고맙습니다. 빌더 기능은 내가 원하는 것입니다. 콘솔에 Rsync 스크립트 출력을 표시 할 수도 있습니다. 이제 내 서버는 항상 내 Dev Machine과 동기화됩니다. 안녕 FTP –

+0

새 답변을 찾았습니다. Netbeans; D –

0

지금 Netbeans을 사용 중입니다.

7.0 베타는 좋은 이 명령 줄, 및 리눅스와 PHP 위대한 작품 공개 키와 FTP/SFTP 지원을 포함 있습니다.

나는 변화를 주저했지만 이제는 Eclipse보다 더 좋아합니다. 내가 놓칠 수있는 것은 내 빠른 Rsync 스크립트 뿐이지 만 한 가지주의해야 할 점이 있습니다!

# !/bin/sh 

#Important Notes: 
# 0) Requrirements: RSYNC and SSH support on your Machine (install cygwin under windows, all good OS should already have it) 
# 1) You have to configure your ssh so yout do not have to enter the Password and the Port for your Server 
# 2) You have to edit the Paths and directorys to fit your Environment 
# 3) You may be interested in changing some RSYNC Options 
# 4) You may want to add this Script as Eclipse Builder to be run on autosave, to always keep your Server in sync. 

누군가 Eclipse에서이 스크립트를 사용하려는 경우 여기에 스크립트가 있습니다.

Eclipse ($ USER 등)에 환경 변수를 설정하기 만하면됩니다. Netbeans를 찾을 때까지 나에게 큰 도움이되었습니다.

# Push: rsync [OPTION...] SRC... [[email protected]]HOST:DEST 

# Useful rsync Options 
# -v verbose 
# -q quiet, supress non-error Messages 
# -r recursive, recurse sub-directorys 
# -u update, skip files that are newer on the server 
# -E preserve Executability 
# --chmod=CHMOD directory permissions to be set 
# -z compress file data during transfer 
# --compress-level NUM explicitly set compression level 
# --skip-compress=LIST skip compressing files with suffix in list (for jpg, png) 
# --exclude=PATTERN (for svn and eclipse config files) 
# --port (maybe we want a weird port) 
# -h output numbers in a human readable format (that is always good) 
# --progress (may be interesting) 
# --password-file read daemon-access password from file 
# --bwlimit=KBPS bandwith limit 
# -t transfer the modification times with the files ... makes next transfer more effective 
# --delete delete files that do not exist on other side 
# -C cvs-exclude - exclude RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/ .git/ .bzr/ 
# --stats ... could be interesting 

TARGET_HOST="www.example.com" 
TARGET_DIR="/var/www/" 
TARGET_USER="root" 

SOURCE_DIR="/home/user/workspace/myeclipseproject/" 

#Make this Variable empty if you do not want nonexisting Files on the Server to be deleted 
#DELETE=" --delete" 
DELETE="" 

OPTIONS=" -r -u -E -z -h --progress -t --stats --chmod=a+rwx --exclude-from=exclude.txt --chmod=a+rwx "$DELETE 

COMMAND="$OPTIONS $SOURCE_DIR [email protected]$TARGET_HOST:$TARGET_DIR" 
echo 'rsync '$COMMAND 
rsync $COMMAND 
관련 문제