2011-05-03 4 views
2

OSGi에 대한 지식의 단일체를 다루고 있으며 예제의 지시 사항이 Ant에 익숙하지 않은 사람에게는 불충분 한 문제가 발생했습니다.OSGi 예제를위한 ant build.xml 파일 편집 - 명령어를 이해하지 못함

예제 챕터 6의 OSGi in Action에 설명 된대로 jEdit을 가져 와서 번들로 분해하는 예는 다음과 같습니다. 첫 번째 단계 중 하나는 build.xml 파일을 편집하여 jar 작업을 제거하고 bnd 정의로 바꾸는 것입니다. 그리고 나서 '생성 된 번들을 어디에 넣을지를 bnd에게 알려주는 지침을 추가하라'는 명령을 받는다. 그리고 이것은 내가 혼란스러워하는 부분입니다. 왜냐하면 전에 Ant와 함께 일한 적이 없기 때문에 Maven을이 예제를 넘어서 사용할 계획이기 때문입니다. 예를 들어 설명 할 사람이 누구인지 설명 할 수 있기를 바랍니다. 텍스트 (채널 6의 209 페이지)은 다음과 같다 : 기본적으로

First, comment out the jar task: 

<!-- jar jarfile="jedit.jar"     
    manifest="org/gjt/sp/jedit/jedit.manifest" 
    compress="false"> 
... 
</jar --> 

The first line above shows where to put the JAR file, 
and the second lists fixed manifest entries. Next, 
add the bnd definition and target task: 

<taskdef resource="aQute/bnd/ant/taskdef.properties" 
    classpath="../../../lib/bnd-0.0.384.jar" /> 
<bnd classpath="${build.directory}"   
    files="jedit-mega.bnd" /> 

Here, you first give the location of the bnd JAR file to tell 
Ant where it can find the bnd task definition. Then you specify 
a bnd task to create your bundle JAR file, giving it the project 
class path and the file containing your bnd instructions....The 
first thing you must add is an instruction to tell bnd where to 
put the generated bundle: 

-output: jedit.jar 

The bnd task can also copy additional manifest headers into the final 
manifest, so let’s ask bnd to include the original jEdit manifest rather 
than duplicate its content in your new file: 

-include: org/gjt/sp/jedit/jedit.manifest 

, 나는 - 출력과 -include 함께 할 수있는 무엇인지 전혀 모른다. 여기에이 공식 당신 BND 작업의 문서 것으로 보인다

jEdit build.xml screenshot

답변

2

: 내 편집 지금까지 다음과 같다 작업의 속성 것 같다

http://www.aqute.biz/Bnd/Ant

출력을 포함

이렇게 될 수 있습니다 :

<bnd classpath="${build.directory}"   
    files="jedit-mega.bnd" 
    output = 'jedit.jar'/> 

그리고 명령 행 옵션 페이지에서 출력이 다음을 수행 보인다 : 의

재정의 기본 출력 이름 번들 또는 디렉터리를. 출력이 디렉토리 인 경우 이름은 이며 bnd 파일 이름에서 파생됩니다.

하지만 여기에 포함되지는 않습니다. 이 값은 BND-파일 자체에 대한 의미하는 것으로

또한이 될 수는 (타당) : http://www.aqute.biz/Bnd/Format

+0

아아 - 예. bnd-File에 대해 옳습니다. 지금이 섹션을 완전히 다르게 읽고 있습니다. 어떤 이유로 나는 bnd 파일이 내가 직접 만들어야 만하는 것이 아니라 생산 된 결과물이라고 생각했다. – Aurora

관련 문제