Community
Participate
Working Groups
I want to exclude some files from the bin folder after packaging it as single jar, I add 'bin.excludes' property in build.properties following link[1]. And it works well if exporting my plug-in to jar via Eclipse IDE. But the final jar built by Tycho doesn't exclude those files. I roughly read the source of tycho package plug-in, it has code to handle the properties 'bin.includes' and 'bin.excludes' in the build.properties. But it doesn't work well. [1] http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Freference%2Fpde_feature_generating_build.htm
Created attachment 209121 [details] example project There are two files named a.c and Makefile under src/, I want to exclude them from the final built jar.
(In reply to comment #1) > Created attachment 209121 [details] > example project > > There are two files named a.c and Makefile under src/, I want to exclude them > from the final built jar. I was under the impression that bin.includes are relative to the project root (same as for bin.includes), see integration test [1] However you are right there should be a way to exclude resources which are copied from the source to the output folder. Not sure if in addition to project root, we should also apply bin.excludes filters to the output folder. Do you have references how this is done exactly in PDE headless build? I can't find the details in the docs you linked. [1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-its/projects/MNGECLIPSE1007
(In reply to comment #2) > Not sure if in addition to project root, we should also apply bin.excludes > filters to the output folder. Do you have references how this is done exactly in > PDE headless build? I can't find the details in the docs you linked. PDE build creates the ant script based on the build.properties on the air. It uses the copy task to include and exclude the files listed in build.properties. See http://git.eclipse.org/c/pde/eclipse.pde.build.git/tree/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ant/FileSet.java
(In reply to comment #3) > (In reply to comment #2) > > Not sure if in addition to project root, we should also apply bin.excludes > > filters to the output folder. Do you have references how this is done exactly in > > PDE headless build? I can't find the details in the docs you linked. > PDE build creates the ant script based on the build.properties on the air. It > uses the copy task to include and exclude the files listed in build.properties. > > See > http://git.eclipse.org/c/pde/eclipse.pde.build.git/tree/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ant/FileSet.java Could not figure out the details because generated ant scripts are not retained but the sample shows that bin.excludes are applied to resources copied from source to output folder too. In the meantime, I found a workaround. You can configure <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-compiler-plugin</artifactId> <version>${tycho-version}</version> <configuration> <excludeResources> <exludeResource>a.c</exludeResource> <exludeResource>Makefile</exludeResource> </excludeResources> </configuration> </plugin> This should achieve what you want.
http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=a26e10dc7a55cabf9b4bb86eacb6249cecc480ac
Thanks for below workaround and quick fix. :) (In reply to comment #4) > In the meantime, I found a workaround. > > You can configure > > <plugin> > <groupId>org.eclipse.tycho</groupId> > <artifactId>tycho-compiler-plugin</artifactId> > <version>${tycho-version}</version> > <configuration> > <excludeResources> > <exludeResource>a.c</exludeResource> > <exludeResource>Makefile</exludeResource> > </excludeResources> > </configuration> > </plugin> > > This should achieve what you want.