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 - Need a preprocessor bridge API for a compilation task
Summary: Need a preprocessor bridge API for a compilation task
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.2
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks: 253248
  Show dependency tree
 
Reported: 2016-08-16 12:27 UTC by Martin Entlicher
Modified: 2016-09-01 01:52 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 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.