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 267601

Summary: Need a preprocessor bridge API for a compilation task
Product: java Reporter: Martin Entlicher <mentlicher>
Component: SourceAssignee: Tomas Zezula <tzezula>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 253248    

Description Martin Entlicher 2016-08-16 12:27:26 UTC
To implement issue #253248, I need to create a compilation task with a context of a particular FileObject/JavaSource and an offset.

I've tested the compilation with:

JavaCompiler.CompilationTask task = ToolProvider.getSystemJavaCompiler().
                getTask(null, jfm, diagnostics, Arrays.asList("-source", "1.8", "-target", "1.8", "-proc:none"), null, Arrays.asList(file));
task.call();

and it works for code not accessing the project code.

An API that would accept a function (String) -> OutputStream called with the class' bytecode would be great. I also need an access to 
Diagnostic in case of a failure.
Comment 1 Tomas Zezula 2016-08-22 08:50:03 UTC
Fixed jet-main http://hg.netbeans.org/jet-main/rev/f4d9319a9d29
Comment 2 Quality Engineering 2016-08-27 02:20:14 UTC
Integrated into 'main-silver', will be available in build *201608270002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f4d9319a9d29
User: Tomas Zezula <tzezula@netbeans.org>
Log: #267601:Need a preprocessor bridge API for a compilation task
Comment 3 Martin Entlicher 2016-08-31 11:52:40 UTC
A small correction pushed in changeset:   300359:23206a826ce9
http://hg.netbeans.org/jet-main/rev/23206a826ce9
Comment 4 Quality Engineering 2016-09-01 01:52:53 UTC
Integrated into 'main-silver', will be available in build *201609010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/23206a826ce9
User: mentlicher@netbeans.org
Log: #267601: A small correction to compilation task.