| Summary: | build.properties - Impossible to exclude a file or a directory via build.properties at compile! time | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Mitko Mising name <me2stk> | ||||
| Component: | Build | Assignee: | pde-build-inbox <pde-build-inbox> | ||||
| Status: | RESOLVED DUPLICATE | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | aniefer, me2stk | ||||
| Version: | 3.3.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
You can add additional jars to the build classpath using the "extra.<library>" and "jars.extra.classpath" properties: http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.pde.doc.user/reference/pde_feature_generating_build.htm This would allow you to compile the tests without requiring a dependency on the junit plugins. *** This bug has been marked as a duplicate of bug 105631 *** |
Created attachment 105009 [details] Example project which contains the problem Build ID: M20080221-1800 Steps To Reproduce: 1.Create new osgi bundle. 2.Create folder src/test/java add it to build path. 3.Write a simple Unit test in this folder. 4. configure the bundle as described below** 5.Export the plugin/bundle. 6. The export yields an error. ** If one should define the test cases inside the plug-in or pure osgi bundle, one must live whether with a warning or with hacks. The existence of the src/test/java folder requires several things: * the test folder has to be a source folder in java, it contais java code (a must) * the test contains unit test, it must not be packed in the plugin (a must) Let's say one uses JUnit library for tests, which are in the plugin directory. Let's say one adds the src/test/java (notation taken from Maven 2 standard directory layout) folder to the build path. This is natural, because it contains source files. 1)add the src/test/java in the project classpath. Write a simple test - a test method with a System.out. in this case a warning is shown in build.xml that the src/test/java is not in the list of source folders. Putting the folder in the source source.. = src/main/java/,\ src/test/java/ on the other hand results to several things: Whether 1.1 one should have a plugin dependency to JUnit and then exclude the tests from the distribution with bin.excludes or 1.2 one should be able to exclude it from the compiler! list of flies. 1.1 is of course unacceptable, because the production bundle does not actually require junit. 1.2 does not work in any way. Placing **/Test*.java (or src/test/java/) as an exclude property has no effect at compile time!. Summary: One should live whether with a warning or with hacks in his\her projects concering build. More information: The bin.excludes property works only after the sources are already compiled. In my case it is not enough.