This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 140909 - Conditional Inclusion of Resource Folders & Files
Summary: Conditional Inclusion of Resource Folders & Files
Status: NEW
Alias: None
Product: javame
Classification: Unclassified
Component: Build System (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Petr Suchomel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-20 16:09 UTC by earamsey
Modified: 2008-07-20 16:09 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description earamsey 2008-07-20 16:09:44 UTC
Hi,

First let me explain my problem which hopefully will elucidate why I want this feature.

I have different types of test data sets that I want to test MIDlet against so I included them all into my resources 
directory. Which particular 'test data set' is loaded is determined at compiled by preprocessor flags. This is a 
inconvenient because I have to physically remove test data sets from resources directory when I do final deployment, I 
can't use just one statement to load data for instance;
[code]
	public InputStream what_I_do_now_Method() throws IOException
	{
//#ifdef TEST_SCENARIO_1
		return getClass().getResourceAsStream("/dataset1.bin");
//#elif TEST_SCENARIO_2
		return getClass().getResourceAsStream("/dataset2.bin");
//#elif TEST_SCENARIO_3
		return getClass().getResourceAsStream("/dataset3.bin");
//#else		
		return getClass().getResourceAsStream("/dataset.bin");
//#endif		
	}
[/code]
[code]
	public InputStream preferred_Method() throws IOException
	{
		return getClass().getResourceAsStream("/dataset.bin");
	}
[/code]

Then as you can see, I would have to physically copy dataset[1-3].bin to resource directory and remember to remove them 
for deployment which is very cumbersome.

Finally, the enhancement to build system that I am requesting is a way to conditionally add folders, and or files, 
to "Libraries & Resources" under the project properties settings. Currently, my fix is to modify the add custom code to 
build.xml, however, it would be very helpful if in the future I can do this directly from the project properties 
because it is easier to manage from there!

Thanks,
Please help out!