컴파일 순서 및 병렬화

기본적으로 PDE/빌드는 기능 구조를 이용한 위임을 통해 플러그인을 컴파일합니다. 먼저 기능을 종방향으로 탐색하여 각 기능 내의 플러그인을 종속성 순(OSGi 분석기에서 판별함)으로 컴파일합니다.

즉, 주어진 번들의 모든 하위가 기능 포함 계층 구조의 종방향 순회에서 앞서 표시되는 기능 또는 동일한 기능에 포함되어 있어야 합니다. 이 때문에 기능 구성이 어려울 수 있습니다.

종속성 무시

3.5의 새로운 점은 빌더 특성 flattenDependencies입니다. 이 특성을 true로 설정하면 PDE/빌드는 기능 경계를 무시하고 모든 플러그인을 정렬합니다. 그런 다음 PDE/빌드는 종속성에 따른 정렬 순서대로 모든 플러그인을 나열하는 Bu새 빌드 스크립트 compile.<feature>.xml을 생성합니다. 이를 통해 사용자는 종속성 혼합에 대한 우려 없이 기능에 따라 번들을 여러 기능으로 파티션할 수 있습니다.

병렬 컴파일

flattenDependencies을 지정하는 경우 PDE/빌드는 병렬로 번들을 컴파일할 수 있습니다. 즉, 정렬된 번들 목록을 그룹으로 파티션하여 병렬 컴파일을 수행하는데, 각 그룹에는 전적으로 이전 그룹의 번들에 따라 번들이 포함됩니다.

그런 후 각 그룹은 Ant <parallel> 태스크로 랩핑됩니다. 다음 특성이 병렬 작동을 제어합니다.

parallelCompilation병렬 컴파일을 사용하려면 true로 설정하십시오. (flattenDependencies=true가 필요함)
parallelThreadCount사용할 최대 스레드 수. 기본값은 3입니다. Ant 병렬 태스크의 threadCount에 해당합니다.
parallelThreadsPerProcessor사용 가능한 프로세서당 최대 스레드 수. Ant 병렬 태스크의 threadsPerProcessor에 해당합니다.

생성되는 컴파일 스크립트는 다음과 유사합니다.

  <project name="Compile master" default="main">
     <target name="main">
        <parallel threadsPerProcessor='3'>
             <ant antfile="build.xml" dir="plugins/org.eclipse.osgi" target="build.jars"/>
        </parallel>
        <parallel threadsPerProcessor='3'>
             <ant antfile="build.xml" dir="plugins/org.eclipse.equinox.common" target="build.jars"/>
             <ant antfile="build.xml" dir="plugins/org.eclipse.equinox.p2.jarprocessor" target="build.jars"/>
        </parallel>
        <parallel threadsPerProcessor='3'>
             <ant antfile="build.xml" dir="plugins/org.eclipse.update.configurator" target="build.jars"/>
             <ant antfile="build.xml" dir="plugins/org.eclipse.equinox.simpleconfigurator" target="build.jars"/>
             <ant antfile="build.xml" dir="plugins/org.eclipse.equinox.frameworkadmin" target="build.jars"/>
             <ant antfile="build.xml" dir="plugins/org.eclipse.core.jobs" target="build.jars"/>
             <ant antfile="build.xml" dir="plugins/org.eclipse.core.databinding.observable" target="build.jars"/>
             <ant antfile="build.xml" dir="plugins/org.eclipse.swt" target="build.jars"/>
             ...