Мы разрабатываем продукт Eclipse из нескольких плагинов, некоторые из которых разработаны нами. Каждый из наших плагинов определяется как проект плагина Eclipse в рабочей области и имеет две папки, источник и тест. Недавно я заметил, что мы доставляем тестовые классы пользователю, как наши исходные классы. Теперь я хочу удалить тестовые классы из результата нашего продукта. Удалить тестовую папку из пути сборки Java (см. Вложение)? И что еще я должен сделать, чтобы не развертывать наши тесты для конечного пользователя?Должен ли я добавить свою тестовую папку модулей в путь сборки java в Eclipse?
Для создания проекта мы используем затмение стандартного муравья скрипт для создания нашего архива. Я не могу найти, где я могу исключить тестовые файлы. Вот сценарий Ant:
<property name="allElementsFile" value="${eclipse.pdebuild.scripts}/productBuild/allElements.xml"/>
<import file="${eclipse.pdebuild.scripts}/build.xml"/>
<property name="pluginPath" value=""/>
<property name="pluginList" value=""/>
<property name="featureList" value=""/>
<property name="includeLaunchers" value="true"/>
<property name="generatedBuildProperties" value=""/>
<condition property="nestedInclusions" value="true">
<istrue value="${p2.gathering}" />
</condition>
<!-- ===================================================================== -->
<!-- main entry point to setup, fetch, generate, build etc. Use -->
<!-- the customTargets.xml to modify the build behaviour. -->
<!-- ===================================================================== -->
<target name="main" description="the main build target">
<antcall target="preBuild" />
<antcall target="processRepos"/>
<antcall target="generateFeature"> <!-- Generate the feature to drive the fetch -->
<param name="verify" value="false"/>
</antcall>
<antcall target="fetch" />
<antcall target="generateFeature"> <!-- We are calling generate feature a second time so that we can get the pack/unpack clause fixed -->
<param name="verify" value="true"/>
</antcall>
<antcall target="generate" />
<antcall target="process" />
<antcall target="assemble" />
<antcall target="package" />
<antcall target="postBuild" />
</target>
<!-- ===================================================================== -->
<!-- Generate a container feature based on the product file -->
<!-- The plugin or feature containing the .product file will need to exist -->
<!-- already, use preSetup or postSetup to fetch it if necessary -->
<!-- ===================================================================== -->
<target name="generateFeature">
<eclipse.generateFeature
featureId="org.eclipse.pde.build.container.feature"
buildDirectory="${buildDirectory}"
baseLocation="${baseLocation}"
productFile="${product}"
verify="${verify}"
pluginPath="${transformedRepoLocation}${path.separator}${pluginPath}"
configInfo="${configs}"
pluginList="${pluginList}"
featureList="${featureList}"
includeLaunchers="${includeLaunchers}"
buildPropertiesFile="${generatedBuildProperties}"
nestedInclusions="${nestedInclusions}"
filterP2Base="${filterP2Base}"
/>
</target>
</project>
Я не слишком знаком с разработкой плагинов Eclipse, но я бы предложил место, которое вам нужно исправить, находится на этапе * развертывания * вашей сборки. Я бы предположил, что вам нужны ваши модульные тесты на пути сборки для целей разработки. Я не буду публиковать ответ, поскольку я подозреваю, что кто-то может посоветовать, как это сделать. –