You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Laszlo Kishalmi <la...@gmail.com> on 2019/05/19 06:16:21 UTC

Re: Request for Help : Java Hint to enable Preview feature in gradle project

I'm replying through the dev mailing list as others could help and/or 
comment that way.

In my personal point of view as Gradle build scripts are read-only. The 
are wide variety of those files out there.

An editor hint might work. Though detecting if the given compiler arg is 
set for a source set may require support from the plugin and the 
generated additional code might not work at all.

On 5/15/19 6:20 AM, Arunava Sinha wrote:
> Hi laszlo,
>
> I am working on below issue to enable preview feature in java 
> projects.(Planned to support for ant/maven/gradle projects).
> https://issues.apache.org/jira/browse/NETBEANS-2457
>
> Hints will add below parameters in build.gradle file to enable preview.
>
> compileJava {
>     options.compilerArgs =['--enable-preview']
> }
> run{
>     jvmArgs(['--enable-preview'])
> }
>
>
> I am not able to find and utility/model class to read and write into 
> build.gradle. So I am planning to read  build.gradle as text file line 
> by line and then will manipulate the lines to add the parameters .
>
> I will be using the below APIs
>
> java.nio.file.Files.readAllLines(<build.gradle file path>, 
> StandardCharsets.UTF_8);
> java.nio.file.File.write(<build.gradle file path>, lines, 
> StandardCharsets.UTF_8);
>
> Also I found that even if parameters were added in build.gradle, in 
> editor it still shows error for that below fix I am proposing
>
> https://github.com/arusinha/incubator-netbeans/pull/3
>
> Please let me know is there any better approach to read/write 
> build.gradle file.
>
> Regards,
> Arunava sinha

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Laszlo Kishalmi <la...@gmail.com>.
Well,

In Gradle you need to add the '--enable-preview' jvm arg to multiple 
places in Gradle (compiler, test runner, and the Java Exec itself). The 
most elegant way doing that is adding a plugin to the Gradle project 
which takes care of the internals.

The plugin can be a public one (I'd probably go that way) or just can 
leave in our repo next to those plugins which makes our run/test single 
actions possible by extending the Gradle build process (Gradle Project 
Properties > Build > Compile > Augmented Build Execution)

So I guess it could be a feature under Augmented build, that we could 
add "enable-preview" and merely alter Gradle execution. The real 
drawback of altering the build that the experience from building the 
project from the IDE would be different than from the command line. (So 
some link with details shall be put in the IDE to a Wiki page.)

So in summary:

  * There is no perfect solution for this.
  * Hint and change several lines in a gradle file is not a real option
  * Put the logic as a Gradle Plugin is preferred
  * We have a way to inject that plugin into a Gradle build
  * The users needs to be properly informed what exactly happens under
    the hood.


On 5/20/19 4:09 AM, Geertjan Wielenga wrote:
> Not sure either, but if there’s no way (Laszlo might be able to advise
> here) to set “enable-preview” on project level, then global (at least as a
> fallback) would seem to be the only way to go.
>
> Gj
>
>
> On Mon, 20 May 2019 at 12:24, Neil C Smith <ne...@apache.org> wrote:
>
>> On Mon, 20 May 2019 at 11:12, Geertjan Wielenga <ge...@apache.org>
>> wrote:
>>> Maybe read “enable-preview” as a fallback in netbeans.conf? I.e., if not
>>> set anywhere else, check in netbeans.conf for -J-Denable-preview and, if
>>> present, apply to all Java projects, which would include Gradle projects?
>> If you really wanted it as a global property (not sure!), maybe
>> somewhere in build.properties as a key related to the chosen Java
>> platform?  eg. platforms.JDK_12.enable-preview=true
>>
>> Best wishes,
>>
>> Neil
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
>>

Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Geertjan Wielenga <ge...@apache.org>.
Good point. :-)

Gj

On Mon, 20 May 2019 at 13:36, Neil C Smith <ne...@apache.org> wrote:

> On Mon, 20 May 2019 at 12:10, Geertjan Wielenga <ge...@apache.org>
> wrote:
> > Not sure either, but if there’s no way (Laszlo might be able to advise
> > here) to set “enable-preview” on project level, then global (at least as
> a
> > fallback) would seem to be the only way to go.
>
> I was suggesting (badly) that somewhere in between project level and
> globally affecting every project in the IDE is the Java Platform API.
> Still not a great fallback, and doesn't ensure that anything is
> portable or compilable, but at least you can then choose which
> projects are affected by any "global" hint that way.
>
> Best wishes,
>
> Neil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Neil C Smith <ne...@apache.org>.
On Mon, 20 May 2019 at 12:10, Geertjan Wielenga <ge...@apache.org> wrote:
> Not sure either, but if there’s no way (Laszlo might be able to advise
> here) to set “enable-preview” on project level, then global (at least as a
> fallback) would seem to be the only way to go.

I was suggesting (badly) that somewhere in between project level and
globally affecting every project in the IDE is the Java Platform API.
Still not a great fallback, and doesn't ensure that anything is
portable or compilable, but at least you can then choose which
projects are affected by any "global" hint that way.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Geertjan Wielenga <ge...@apache.org>.
Not sure either, but if there’s no way (Laszlo might be able to advise
here) to set “enable-preview” on project level, then global (at least as a
fallback) would seem to be the only way to go.

Gj


On Mon, 20 May 2019 at 12:24, Neil C Smith <ne...@apache.org> wrote:

> On Mon, 20 May 2019 at 11:12, Geertjan Wielenga <ge...@apache.org>
> wrote:
> > Maybe read “enable-preview” as a fallback in netbeans.conf? I.e., if not
> > set anywhere else, check in netbeans.conf for -J-Denable-preview and, if
> > present, apply to all Java projects, which would include Gradle projects?
>
> If you really wanted it as a global property (not sure!), maybe
> somewhere in build.properties as a key related to the chosen Java
> platform?  eg. platforms.JDK_12.enable-preview=true
>
> Best wishes,
>
> Neil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Neil C Smith <ne...@apache.org>.
On Mon, 20 May 2019 at 11:12, Geertjan Wielenga <ge...@apache.org> wrote:
> Maybe read “enable-preview” as a fallback in netbeans.conf? I.e., if not
> set anywhere else, check in netbeans.conf for -J-Denable-preview and, if
> present, apply to all Java projects, which would include Gradle projects?

If you really wanted it as a global property (not sure!), maybe
somewhere in build.properties as a key related to the chosen Java
platform?  eg. platforms.JDK_12.enable-preview=true

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Geertjan Wielenga <ge...@apache.org>.
Maybe read “enable-preview” as a fallback in netbeans.conf? I.e., if not
set anywhere else, check in netbeans.conf for -J-Denable-preview and, if
present, apply to all Java projects, which would include Gradle projects?

Not 100% sure, but just an idea.

Gj


On Mon, 20 May 2019 at 11:47, Arunava Sinha <ar...@oracle.com>
wrote:

> Hi,
>
> I tried org.gradle.jvmargs=--enable-preview. It didn't worked.
>
> Considering the scenarios as there and n number of ways to specify jvm
> parms for compilation/run and also currently support is not present to
> read/write gradle configuration from the plugin. I would choose to not
> provide the hint in gradle project.
>
> Regards,
>
> Arunava Sinha
>
> On 5/19/2019 7:05 PM, Eric Bresie wrote:
> > How is what’s being discussed different from a “gradle template” type
> scenario?
> >
> > That said, where in the code are the “hints API” locates? Where does a
> given hint get it’s possible options?
> >
> > As I understand Gradle, it’s a flavor of groovy coding with some DSL
> build specifics for the Gradle domain?
> >
> > In the end would this be a mixture of groovy with addition domain
> specific tips/hints?
> >
> > Eric Bresie
> > Ebresie@gmail.com
> >> On May 19, 2019 at 2:20:34 AM CDT, Antonio <an...@vieiro.net> wrote:
> >> Hi,
> >>
> >> What about adding (or requesting to add)
> >>
> >> org.gradle.jvmargs=--enable-preview
> >>
> >> inside gradle.settings? Would that do?
> >>
> >> Cheers,
> >> Antonio
> >>
> >> El 19/5/19 a las 8:16, Laszlo Kishalmi escribió:
> >>> I'm replying through the dev mailing list as others could help and/or
> >>> comment that way.
> >>>
> >>> In my personal point of view as Gradle build scripts are read-only. The
> >>> are wide variety of those files out there.
> >>>
> >>> An editor hint might work. Though detecting if the given compiler arg
> is
> >>> set for a source set may require support from the plugin and the
> >>> generated additional code might not work at all.
> >>>
> >>> On 5/15/19 6:20 AM, Arunava Sinha wrote:
> >>>> Hi laszlo,
> >>>>
> >>>> I am working on below issue to enable preview feature in java
> >>>> projects.(Planned to support for ant/maven/gradle projects).
> >>>>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.apache.org_jira_browse_NETBEANS-2D2457&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=0iEQnHhKGriSNkCA1-Ki6rDkb-drwubOsNfMCo_m5Ck&m=TcOkMvLD7qc02lagR7KuBiLDeNKXztf_6Bvny3re7l4&s=x0CMWxWnIBHkx3QOtpL0PEqyCThBrNx-142YfHmhrt0&e=
> >>>>
> >>>> Hints will add below parameters in build.gradle file to enable
> preview.
> >>>>
> >>>> compileJava {
> >>>> options.compilerArgs =['--enable-preview']
> >>>> }
> >>>> run{
> >>>> jvmArgs(['--enable-preview'])
> >>>> }
> >>>>
> >>>>
> >>>> I am not able to find and utility/model class to read and write into
> >>>> build.gradle. So I am planning to read build.gradle as text file line
> >>>> by line and then will manipulate the lines to add the parameters .
> >>>>
> >>>> I will be using the below APIs
> >>>>
> >>>> java.nio.file.Files.readAllLines(<build.gradle file path>,
> >>>> StandardCharsets.UTF_8);
> >>>> java.nio.file.File.write(<build.gradle file path>, lines,
> >>>> StandardCharsets.UTF_8);
> >>>>
> >>>> Also I found that even if parameters were added in build.gradle, in
> >>>> editor it still shows error for that below fix I am proposing
> >>>>
> >>>>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_arusinha_incubator-2Dnetbeans_pull_3&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=0iEQnHhKGriSNkCA1-Ki6rDkb-drwubOsNfMCo_m5Ck&m=TcOkMvLD7qc02lagR7KuBiLDeNKXztf_6Bvny3re7l4&s=dE0lSzvPoiUK67lxrpK8ta3NErDqV9kpUNWwmsSLlaQ&e=
> >>>>
> >>>> Please let me know is there any better approach to read/write
> >>>> build.gradle file.
> >>>>
> >>>> Regards,
> >>>> Arunava sinha
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >>> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>>
> >>> For further information about the NetBeans mailing lists, visit:
> >>>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_NETBEANS_Mailing-2Blists&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=0iEQnHhKGriSNkCA1-Ki6rDkb-drwubOsNfMCo_m5Ck&m=TcOkMvLD7qc02lagR7KuBiLDeNKXztf_6Bvny3re7l4&s=8kammtOHNs0JsWL8YLvJy35cdaWNoobF4aP6jv22ECE&e=
> >>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>
> >> For further information about the NetBeans mailing lists, visit:
> >>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_NETBEANS_Mailing-2Blists&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=0iEQnHhKGriSNkCA1-Ki6rDkb-drwubOsNfMCo_m5Ck&m=TcOkMvLD7qc02lagR7KuBiLDeNKXztf_6Bvny3re7l4&s=8kammtOHNs0JsWL8YLvJy35cdaWNoobF4aP6jv22ECE&e=
> >>
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Arunava Sinha <ar...@oracle.com>.
Hi,

I tried org.gradle.jvmargs=--enable-preview. It didn't worked.

Considering the scenarios as there and n number of ways to specify jvm 
parms for compilation/run and also currently support is not present to 
read/write gradle configuration from the plugin. I would choose to not 
provide the hint in gradle project.

Regards,

Arunava Sinha

On 5/19/2019 7:05 PM, Eric Bresie wrote:
> How is what’s being discussed different from a “gradle template” type scenario?
>
> That said, where in the code are the “hints API” locates? Where does a given hint get it’s possible options?
>
> As I understand Gradle, it’s a flavor of groovy coding with some DSL build specifics for the Gradle domain?
>
> In the end would this be a mixture of groovy with addition domain specific tips/hints?
>
> Eric Bresie
> Ebresie@gmail.com
>> On May 19, 2019 at 2:20:34 AM CDT, Antonio <an...@vieiro.net> wrote:
>> Hi,
>>
>> What about adding (or requesting to add)
>>
>> org.gradle.jvmargs=--enable-preview
>>
>> inside gradle.settings? Would that do?
>>
>> Cheers,
>> Antonio
>>
>> El 19/5/19 a las 8:16, Laszlo Kishalmi escribió:
>>> I'm replying through the dev mailing list as others could help and/or
>>> comment that way.
>>>
>>> In my personal point of view as Gradle build scripts are read-only. The
>>> are wide variety of those files out there.
>>>
>>> An editor hint might work. Though detecting if the given compiler arg is
>>> set for a source set may require support from the plugin and the
>>> generated additional code might not work at all.
>>>
>>> On 5/15/19 6:20 AM, Arunava Sinha wrote:
>>>> Hi laszlo,
>>>>
>>>> I am working on below issue to enable preview feature in java
>>>> projects.(Planned to support for ant/maven/gradle projects).
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.apache.org_jira_browse_NETBEANS-2D2457&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=0iEQnHhKGriSNkCA1-Ki6rDkb-drwubOsNfMCo_m5Ck&m=TcOkMvLD7qc02lagR7KuBiLDeNKXztf_6Bvny3re7l4&s=x0CMWxWnIBHkx3QOtpL0PEqyCThBrNx-142YfHmhrt0&e=
>>>>
>>>> Hints will add below parameters in build.gradle file to enable preview.
>>>>
>>>> compileJava {
>>>> options.compilerArgs =['--enable-preview']
>>>> }
>>>> run{
>>>> jvmArgs(['--enable-preview'])
>>>> }
>>>>
>>>>
>>>> I am not able to find and utility/model class to read and write into
>>>> build.gradle. So I am planning to read build.gradle as text file line
>>>> by line and then will manipulate the lines to add the parameters .
>>>>
>>>> I will be using the below APIs
>>>>
>>>> java.nio.file.Files.readAllLines(<build.gradle file path>,
>>>> StandardCharsets.UTF_8);
>>>> java.nio.file.File.write(<build.gradle file path>, lines,
>>>> StandardCharsets.UTF_8);
>>>>
>>>> Also I found that even if parameters were added in build.gradle, in
>>>> editor it still shows error for that below fix I am proposing
>>>>
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_arusinha_incubator-2Dnetbeans_pull_3&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=0iEQnHhKGriSNkCA1-Ki6rDkb-drwubOsNfMCo_m5Ck&m=TcOkMvLD7qc02lagR7KuBiLDeNKXztf_6Bvny3re7l4&s=dE0lSzvPoiUK67lxrpK8ta3NErDqV9kpUNWwmsSLlaQ&e=
>>>>
>>>> Please let me know is there any better approach to read/write
>>>> build.gradle file.
>>>>
>>>> Regards,
>>>> Arunava sinha
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_NETBEANS_Mailing-2Blists&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=0iEQnHhKGriSNkCA1-Ki6rDkb-drwubOsNfMCo_m5Ck&m=TcOkMvLD7qc02lagR7KuBiLDeNKXztf_6Bvny3re7l4&s=8kammtOHNs0JsWL8YLvJy35cdaWNoobF4aP6jv22ECE&e=
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_NETBEANS_Mailing-2Blists&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=0iEQnHhKGriSNkCA1-Ki6rDkb-drwubOsNfMCo_m5Ck&m=TcOkMvLD7qc02lagR7KuBiLDeNKXztf_6Bvny3re7l4&s=8kammtOHNs0JsWL8YLvJy35cdaWNoobF4aP6jv22ECE&e=
>>
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Eric Bresie <eb...@gmail.com>.
How is what’s being discussed different from a “gradle template” type scenario?

That said, where in the code are the “hints API” locates? Where does a given hint get it’s possible options?

As I understand Gradle, it’s a flavor of groovy coding with some DSL build specifics for the Gradle domain?

In the end would this be a mixture of groovy with addition domain specific tips/hints?

Eric Bresie
Ebresie@gmail.com
> On May 19, 2019 at 2:20:34 AM CDT, Antonio <an...@vieiro.net> wrote:
> Hi,
>
> What about adding (or requesting to add)
>
> org.gradle.jvmargs=--enable-preview
>
> inside gradle.settings? Would that do?
>
> Cheers,
> Antonio
>
> El 19/5/19 a las 8:16, Laszlo Kishalmi escribió:
> > I'm replying through the dev mailing list as others could help and/or
> > comment that way.
> >
> > In my personal point of view as Gradle build scripts are read-only. The
> > are wide variety of those files out there.
> >
> > An editor hint might work. Though detecting if the given compiler arg is
> > set for a source set may require support from the plugin and the
> > generated additional code might not work at all.
> >
> > On 5/15/19 6:20 AM, Arunava Sinha wrote:
> > > Hi laszlo,
> > >
> > > I am working on below issue to enable preview feature in java
> > > projects.(Planned to support for ant/maven/gradle projects).
> > > https://issues.apache.org/jira/browse/NETBEANS-2457
> > >
> > > Hints will add below parameters in build.gradle file to enable preview.
> > >
> > > compileJava {
> > > options.compilerArgs =['--enable-preview']
> > > }
> > > run{
> > > jvmArgs(['--enable-preview'])
> > > }
> > >
> > >
> > > I am not able to find and utility/model class to read and write into
> > > build.gradle. So I am planning to read build.gradle as text file line
> > > by line and then will manipulate the lines to add the parameters .
> > >
> > > I will be using the below APIs
> > >
> > > java.nio.file.Files.readAllLines(<build.gradle file path>,
> > > StandardCharsets.UTF_8);
> > > java.nio.file.File.write(<build.gradle file path>, lines,
> > > StandardCharsets.UTF_8);
> > >
> > > Also I found that even if parameters were added in build.gradle, in
> > > editor it still shows error for that below fix I am proposing
> > >
> > > https://github.com/arusinha/incubator-netbeans/pull/3
> > >
> > > Please let me know is there any better approach to read/write
> > > build.gradle file.
> > >
> > > Regards,
> > > Arunava sinha
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

Re: Request for Help : Java Hint to enable Preview feature in gradle project

Posted by Antonio <an...@vieiro.net>.
Hi,

What about adding (or requesting to add)

	org.gradle.jvmargs=--enable-preview

inside gradle.settings? Would that do?

Cheers,
Antonio

El 19/5/19 a las 8:16, Laszlo Kishalmi escribió:
> I'm replying through the dev mailing list as others could help and/or 
> comment that way.
> 
> In my personal point of view as Gradle build scripts are read-only. The 
> are wide variety of those files out there.
> 
> An editor hint might work. Though detecting if the given compiler arg is 
> set for a source set may require support from the plugin and the 
> generated additional code might not work at all.
> 
> On 5/15/19 6:20 AM, Arunava Sinha wrote:
>> Hi laszlo,
>>
>> I am working on below issue to enable preview feature in java 
>> projects.(Planned to support for ant/maven/gradle projects).
>> https://issues.apache.org/jira/browse/NETBEANS-2457
>>
>> Hints will add below parameters in build.gradle file to enable preview.
>>
>> compileJava {
>>     options.compilerArgs =['--enable-preview']
>> }
>> run{
>>     jvmArgs(['--enable-preview'])
>> }
>>
>>
>> I am not able to find and utility/model class to read and write into 
>> build.gradle. So I am planning to read  build.gradle as text file line 
>> by line and then will manipulate the lines to add the parameters .
>>
>> I will be using the below APIs
>>
>> java.nio.file.Files.readAllLines(<build.gradle file path>, 
>> StandardCharsets.UTF_8);
>> java.nio.file.File.write(<build.gradle file path>, lines, 
>> StandardCharsets.UTF_8);
>>
>> Also I found that even if parameters were added in build.gradle, in 
>> editor it still shows error for that below fix I am proposing
>>
>> https://github.com/arusinha/incubator-netbeans/pull/3
>>
>> Please let me know is there any better approach to read/write 
>> build.gradle file.
>>
>> Regards,
>> Arunava sinha
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists