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

Summary: Conditional Inclusion of Resource Folders & Files
Product: javame Reporter: earamsey <earamsey>
Component: Build SystemAssignee: Petr Suchomel <psuchomel>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

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!