Netbeans Excludes to excluded files from compilation doesn't work

668 views
Skip to first unread message

thomas

unread,
Apr 6, 2012, 3:59:33 PM4/6/12
to codenameone...@googlegroups.com
I tried excluding some source files from the build using Excludes (project Properties - Sources - [Includes/Excludes...]). The excluded file appears correctly in the box with Excluded files, but when I compile the file is still included. This blocks me compiling - any solutions?  (and sorry if the answer is obvious, I'm not familiar with the whole environment)

Mikhail Zemlyanukha

unread,
Apr 6, 2012, 4:07:04 PM4/6/12
to codenameone...@googlegroups.com
Since CN1 uses an Ant build script to compile and send project on
server, I think that exclusions in NB won't work. You probably need to
modify build.xml for this matter as well.

I believe you need to change this statement there:
<target name="jar" description="Create a jar for project">
<jar jarfile="${dist.jar}" includes="**/*" basedir="bin" />
</target>

> --
> You received this message because you are subscribed to the Google
> Groups "CodenameOne Discussions" group.
>
> For more information about Codename One please visit
> http://www.codenameone.com/
>
> To post to this group, send email to
> codenameone...@googlegroups.com
> To unsubscribe from this group, send email to
> codenameone-discu...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/codenameone-discussions?hl=en?hl=en

Mixa

unread,
Apr 6, 2012, 4:12:39 PM4/6/12
to codenameone...@googlegroups.com
Or I may be wrong - the bin directory shouldn't already have the files you excluded. You may try to clean the project then - may be old class files remain there?


On Saturday, April 7, 2012 12:07:04 AM UTC+4, Mixa wrote:
Since CN1 uses an Ant build script to compile and send project on
server, I think that exclusions in NB won't work. You probably need to
modify build.xml for this matter as well.

I believe you need to change this statement there:
        <target name="jar" description="Create a jar for project">
                <jar jarfile="${dist.jar}" includes="**/*" basedir="bin" />
        </target>

> I tried excluding some source files from the build using Excludes (project
> Properties - Sources - [Includes/Excludes...]). The excluded file appears
> correctly in the box with Excluded files, but when I compile the file is
> still included. This blocks me compiling - any solutions?  (and sorry if the
> answer is obvious, I'm not familiar with the whole environment)
>
> --
> You received this message because you are subscribed to the Google
> Groups "CodenameOne Discussions" group.
>
> For more information about Codename One please visit
> http://www.codenameone.com/
>
> To post to this group, send email to

> codenameone-discussions@googlegroups.com


> To unsubscribe from this group, send email to

> codenameone-discussions+unsub...@googlegroups.com

Shai Almog

unread,
Apr 7, 2012, 12:13:45 AM4/7/12
to codenameone...@googlegroups.com

Or I may be wrong - the bin directory shouldn't already have the files you excluded. You may try to clean the project then - may be old class files remain there?

I think you were right initially.

thomas

unread,
Apr 7, 2012, 3:41:31 AM4/7/12
to codenameone...@googlegroups.com
Thanks Mixa. So far I've staid away from build.xml etc. and only used the Netbeans GUI - I hope I can continue that way to focus on writing the code ;-). It wasn't a pb of cleaning up as your next mail suggested - I had already tried that. Anyway, I ended up deleting the file for now while hoping that the CN1 team will look at it (excluding files was extremely easy in Netbeans J2ME). Br, Thomas


On Friday, April 6, 2012 10:07:04 PM UTC+2, Mixa wrote:
Since CN1 uses an Ant build script to compile and send project on
server, I think that exclusions in NB won't work. You probably need to
modify build.xml for this matter as well.

I believe you need to change this statement there:
        <target name="jar" description="Create a jar for project">
                <jar jarfile="${dist.jar}" includes="**/*" basedir="bin" />
        </target>


On Fri, Apr 6, 2012 at 11:59 PM, thomas <@gmail.com> wrote:
> I tried excluding some source files from the build using Excludes (project
> Properties - Sources - [Includes/Excludes...]). The excluded file appears
> correctly in the box with Excluded files, but when I compile the file is
> still included. This blocks me compiling - any solutions?  (and sorry if the
> answer is obvious, I'm not familiar with the whole environment)
>
> --
> You received this message because you are subscribed to the Google
> Groups "CodenameOne Discussions" group.
>
> For more information about Codename One please visit
> http://www.codenameone.com/
>
> To post to this group, send email to

> codenameone-discussions@googlegroups.com


> To unsubscribe from this group, send email to

> codenameone-discussions+unsub...@googlegroups.com

Shai Almog

unread,
Apr 7, 2012, 4:30:01 AM4/7/12
to codenameone...@googlegroups.com
We have no plans for enabling something like that. I'm not exactly sure why it would be useful?
The whole purpose of Codename One is in allowing the same code to run for all devices and we want to avoid a case where people abuse something like that to effectively create multiple code bases. Do you have a specific use case in mind for requiring a feature like that?

Mikhail Zemlyanukha

unread,
Apr 7, 2012, 5:44:32 AM4/7/12
to codenameone...@googlegroups.com
May be I do not understand something - in Eclipse I would expect
excluded files to be deleted from project 'bin' folder, at least after
clean. In other words, excluded files should not be present in the bin
folder. Correct me if I'm wrong...

> --
> You received this message because you are subscribed to the Google
> Groups "CodenameOne Discussions" group.
>
> For more information about Codename One please visit
> http://www.codenameone.com/
>
> To post to this group, send email to

> codenameone...@googlegroups.com


> To unsubscribe from this group, send email to

> codenameone-discu...@googlegroups.com

thomas

unread,
Apr 7, 2012, 6:15:36 AM4/7/12
to codenameone...@googlegroups.com
My use case is simply that I tend to have various versions of source (.java) files, some of them backup copies, incomplete sketches or prototypes with errors. I like to leave them in the same package, but since they often have errors, I don't want them to be compiled. In Netbeans J2ME projects, I could exclude them in the project Properties -> Build -> Sources Filtering, by simply unchecking the individual source files. So I was hoping to be able to do the same in CN1 projects. But maybe it's just a bad habit, and there's a better practice?

Shai Almog

unread,
Apr 7, 2012, 6:20:53 AM4/7/12
to codenameone...@googlegroups.com
Since we always use the build.xml for everything I don't think the Eclipse or NetBeans settings would make much of a difference.
We chose this approach for architectural simplicity so we don't need to get too deep into IDE semantics.
Reply all
Reply to author
Forward
0 new messages