Re: Gradle: how to get IDE pickup source from open project

2022-09-22 Thread Laszlo Kishalmi
Well, if I see well, you try to bring the jvi-cmd:run task down to the 
project level by defining a task that depends on that.


The defined run task would be a DefaultTask, so it is not taking the 
--debug-jvm argument.


Here instead of defining a new run task, I'd configure the ide's run and 
debug action to use :jvi-cmd:run  or (jvi-cmd:run I'm not sure that the 
first : is needed) instead of run.


On 9/22/22 19:37, Ernie Rael wrote:

On 9/22/22 9:15 AM, László Kishalmi wrote:

You may find reading this one useful:
https://docs.gradle.org/current/userguide/composite_builds.html

Thanks, this looks promising. I started, only for one project, with 
settings.gradle


   rootProject.name = 'jvi-ide'

   includeBuild '/src/jvi-dev/jvi'

Mixed in some build.gradle

   def jvi_proj = [ ':jvi-core', ':jvi-swing', ':jvi-cmd' ]

   void deps(Task t, String proj, List subprojs, String subt) {
        for(sp in subprojs) {
        t.dependsOn gradle.includedBuild(proj).task(sp + subt)
        }
   }

   tasks.register('clean') { task ->
        deps(task, 'jvi', jvi_proj, ':clean')
   }
   ...
   tasks.register('run') {
        dependsOn gradle.includedBuild('jvi').task(':jvi-cmd:run')
   }

I thought it was weird that I had to enumerate the sub-projects, but 
some think I'm weird.


Opening this project in ide I can build, clean, Use the GREEN button 
to run the project, but the DEBUG button fails. Suggestions? IDE output:


cd /src/jvi-dev/jvi-ide; ./gradlew --configure-on-demand run
...
> Configure project :jvi:jvi-swing
namedservicesMerge-1: project ':jvi:jvi-swing' 
'jVi/init/com.raelity.jvi.ViInitialization'

Configuration on demand is an incubating feature.

> Task :jvi:jvi-core:compileJava UP-TO-DATE
...

> Task :jvi:jvi-cmd:run

==
cd /src/jvi-dev/jvi-ide; ./gradlew --configure-on-demand run --debug-jvm
...
> Configure project :jvi:jvi-swing
namedservicesMerge-1: project ':jvi:jvi-swing' 
'jVi/init/com.raelity.jvi.ViInitialization'

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Problem configuring task :run from command line.
> Unknown command-line option '--debug-jvm'.



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

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





Re: Gradle: how to get IDE pickup source from open project

2022-09-22 Thread Ernie Rael

On 9/22/22 9:15 AM, László Kishalmi wrote:

You may find reading this one useful:
https://docs.gradle.org/current/userguide/composite_builds.html

Thanks, this looks promising. I started, only for one project, with 
settings.gradle


   rootProject.name = 'jvi-ide'

   includeBuild '/src/jvi-dev/jvi'

Mixed in some build.gradle

   def jvi_proj = [ ':jvi-core', ':jvi-swing', ':jvi-cmd' ]

   void deps(Task t, String proj, List subprojs, String subt) {
    for(sp in subprojs) {
    t.dependsOn gradle.includedBuild(proj).task(sp + subt)
    }
   }

   tasks.register('clean') { task ->
    deps(task, 'jvi', jvi_proj, ':clean')
   }
   ...
   tasks.register('run') {
    dependsOn gradle.includedBuild('jvi').task(':jvi-cmd:run')
   }

I thought it was weird that I had to enumerate the sub-projects, but 
some think I'm weird.


Opening this project in ide I can build, clean, Use the GREEN button to 
run the project, but the DEBUG button fails. Suggestions? IDE output:


cd /src/jvi-dev/jvi-ide; ./gradlew --configure-on-demand run
...
> Configure project :jvi:jvi-swing
namedservicesMerge-1: project ':jvi:jvi-swing' 
'jVi/init/com.raelity.jvi.ViInitialization'

Configuration on demand is an incubating feature.

> Task :jvi:jvi-core:compileJava UP-TO-DATE
...

> Task :jvi:jvi-cmd:run

==
cd /src/jvi-dev/jvi-ide; ./gradlew --configure-on-demand run --debug-jvm
...
> Configure project :jvi:jvi-swing
namedservicesMerge-1: project ':jvi:jvi-swing' 
'jVi/init/com.raelity.jvi.ViInitialization'

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Problem configuring task :run from command line.
> Unknown command-line option '--debug-jvm'.


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

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





Re: Gradle: how to get IDE pickup source from open project

2022-09-22 Thread László Kishalmi
You may find reading this one useful:
https://docs.gradle.org/current/userguide/composite_builds.html

On Thu, Sep 22, 2022 at 7:43 AM Ernie Rael  wrote:

> Thanks László,
>
> Since I got thing back in sync, have not seen the problem. I tried what
> I think were similar steps, it /did not reproduce/. Did not get into a
> situation where it seemed like I needed to nuke the on disk cache.
> Here's the steps, I see some things I'm not sure about, clarification on
> expectations would be great.
>
> Given two separate projects: app, lib. Where lib publishes to maven
> repository
>
>  1. put method "void XXX(String)" in lib
> Publish lib local from console, access it from lib in IDE, build ok.
>  2. modify lib sig to "void XXX(int)", publish lib local to new version
> from console
>  3. In app's buildSrc to reference new version. (but don't fix call to
> XXX new arg type)
> IDE shows no error, build app from IDE, build gets error
>  4. build lib in IDE, IDE still shows no error in app
>  5. change sig in app to call "XXX(int)"
> IDE shows error, but IDE builds with no error
>  6. Close IDE, flush IDE cache, restart IDE
> IDE shows no error, seems like flush cleared up problem in IDE cache
>
> So I could not reproduce a problem that required gradle cache cleanup.
> (though it seems I had reproducible steps that required IDE flush) I
> tried similar steps again, but instead in step 2, I used IDE to run
> action from navigator to publish lib to local maven, and IDE picked up
> the change and were consistent. So it seems like running stuff from
> console, isn't always picked up from the IDE. Was I hallucinating?
>
> Good to know about "Reload" project. If I see something peculiar, I can
> try that.
>
> I will stop using SNAPSHOTS, thanks. I guess the key is to turn off
> mavenLocal() to verify that I need to publish something :-)
>
> -ernie
>
> On 9/20/22 10:53 PM, László Kishalmi wrote:
> > I would say the on-disk cache is pretty stable by now, probably we
> > should remove that from being experimental.
> > I would check the project properties, the Sources section, and the
> > compile classpath section if that looks right.
> > You could check if reloading the project (right click on the project
> > node, the Reload) would help. That one would clear the cache and get a
> > fresh information from Gradle.
> > So, if that's not helping then, there is something else that the IDE
> > does not pick up.
> >
> > If the project could be disclosed, I could take a look.
> >
> > Hint: One of the bad things Maven introduced were the SNAPSHOT
> > versions. They created them as in the early days (probably pre 3.0)
> > the only way to reference dependencies between entities (sub projects
> > in Gradle term) of in a multi-pom projects was through the deployed
> > SNAPSHOT version of the library in the Local Maven repository. That's
> > gone now. SNAPSHOT versions should be avoided.
> >
> > On Tue, Sep 20, 2022 at 6:00 PM Ernie Rael  wrote:
> >
> > (Apologies if you see a duplicate)
> >
> > Using NB-15, jdk-11
> >
> > I have a library on MavenCentral (published from a gradle
> > project), that
> > I use in another project. I'm creating new version of that
> > library. I'm
> > into problems and peculiarities.
> >
> > 1. NetBeans remembered some method signatures that were not valid
> > 2. In debugger opened source from snapshot jar file, rather than from
> > open file from open project
> >
> > 1 seemed like a clear error; found a dance that got rid of the
> > problem,
> > see below.
> >
> > If 2 is correct, how can I set things up during dev/debug to get
> > around it?
> >
> > ** Some notes on 1. **
> >
> > I've created a v1.1-SNAPSHOT and publishToMavenLocal.
> >
> > I've got the following in BuildSrc in a project that uses the
> snapshot
> >
> > repositories {
> >  mavenCentral()
> >  mavenLocal()
> >  // maven { url
> > 'https://oss.sonatype.org/content/repositories/snapshots/' }
> > }
> >
> > I use mavenLocal to access the snapshot..
> >
> > In NetBeans, working on a project that uses the snapshot, although
> > I can
> > do a clean build, I had error indicators referring to some signatures
> > that are not valid in the snapshot. I tried closing NetBeans and
> > clearing it's cache, restart NetBeans. What finally worked (or at
> > least
> > seemed to be related) was toggling off
> >
> > Tools > Options > Java > Gradle > Experimental > Use on-disk
> cache
> >
> > followed by close NB, clear NB cache, restart NB. Perhaps a button:
> > "clear NetBeans gradle cache" would be a better UI, at least until
> > the
> > cache is reliable. How flakey is the experimental use on-disk cache?
> >
> > -ernie
> >
> >
> > -
> > To unsubscribe, e-mail: 

RE: Bringing apidoc back

2022-09-22 Thread Eric Barboni
Hi,
 Private and friend module will still be there.
But the javadoc is limited to public signature and package. 
If there is a private field/method in a class from a published javadoc it twill 
not be accessible. I guess this like that since a long time.

Best Regards,
Eric

-Message d'origine-
De : Jean-Marc Borer  
Envoyé : jeudi 22 septembre 2022 11:57
À : dev@netbeans.apache.org
Objet : Re: Bringing apidoc back

Hi Eric,

Thank you for the job.

There is one thing that I am unsure to have properly understood. As a NBP 
advanced user, I often refer and use the Javadoc of private and friend modules.

 Will the new site still provide it for the DEV version (currently on 
bits.netbeans.org it is broken)?

This is something really important for me.

Best Regards,

JM

On Thu, Sep 8, 2022 at 9:05 AM Eric Barboni  wrote:

> Hi
>
> A PR https://github.com/apache/netbeans/pull/4450 with almost all the 
> link break fixes is there.
>
>
> I would like to merge ASAP so we can keep future version as clean as 
> possible according to missing link.
> I will have to patch build system / json to have a second jdk for javadoc.
>
> Two PR to have former links via webarchive on  our website.
> https://github.com/apache/netbeans-website/pull/608
> https://github.com/apache/netbeans-website/pull/607
>
>
> Best Regards
> Eric
>
> -Message d'origine-
> De : Jaroslav Tulach  Envoyé : samedi 13 
> août 2022 12:57 À : dev  Objet : Re: Bringing 
> apidoc back
>
> Amazing! Thank you for fixing the broken links.
> -jt
>
>
> Dne po 8. 8. 2022 19:51 uživatel Eric Barboni  napsal:
>
> > Hi folks,
> >
> > I started a PR to clean up the api doc. The main goal is that we 
> > need javadoc to success with failonerror set to true. Because if it 
> > fails only architecture and api change are generated but not the javadoc.
> >
> >
> > The most important issue is the following :
> > On the master it’s currently not possible to build using jdk 11 
> > because java.source.base need a classpath with nbjavac (jdk 18) 
> > (they may be other modules involved). I’m not sure if providing a 
> > javadoc for nbjavac could help as Neil comment.
> > For being able to fix javadoc  issue in source
> > - I use a jdk 18 to be consitent with the jdk nb-javac use.
> > - I changed the javadoc checker to check all the html file to remove 
> > maximum issue
> >
> > And there is a lots of issues 
> >
> > fixed the apichanges,arch.xml
> > fixed typos on doc ( like <   ; ) removed links that were using 
> > private/protected reference. (we expose only  org.netbeans.api.*, 
> > org.netbeans.spi.*) using our new netbeans.apache.org url as much as 
> > possible. And also coherent url pattern.
> >
> >
> > So 1000 modifications later it compile on master with only a few bad 
> > links remaining
> >
> > Here is a list of the faulty links
> >
> > https://cwiki.apache.org/confluence/display/NETBEANS/NetBeans+apidoc
> > +r
> > eferenced+url That the second issue: the missing page from fomer
> > netbeans website and blogs. Web.archive.org get them all.
> >
> > So I need your advise what to do with that.
> > 1) Change the links to web.archiva.org
> > 2) Remove the links
> > 3) Copy from webarchive to our site but I'm unsure of the copyright here.
> > 4) other idea
> >
> > In the case of 3) could we have.
> > netbeans.apache.org/projects/autoupdate,
> > netbeans.apache.org/projects/ui
> >
> > Best regards
> > Eric
> >
> >
> >
> > 
> > - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> > For additional commands, e-mail: dev-h...@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-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: dev-h...@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-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

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





Re: netbeans module coding questions

2022-09-22 Thread Jean-Marc Borer
Hello,

You have a very good example here:

https://github.com/junichi11/netbeans-color-codes-preview

BTW, it is a very useful plugin that I would expect be part of core NB
eventually.

Hope it helps.

Cheers,

JM

On Sun, Sep 11, 2022 at 3:20 PM Christian Lenz 
wrote:

> Hey Peter,
>
> you can have a look here:
> https://github.com/joakim-eriksson/nb-eslint/tree/master/src/se/jocke/nb/eslint/annotation
> we did this with Annotations. Unfortunatly, I couldn’t find a solution, how
> to add the glyph Icon, just before or after the line number. Now it is on
> top. If you do this by your own with a sidebar, just have a look at this
> cool repo: https://github.com/junichi11/netbeans-color-codes-preview
> there you can see, that this is the other implementation that was
> suggested, with the Sidebar factory.
>
>
> Cheers
>
> Chris
>
> Von: Peter Cheung
> Gesendet: Mittwoch, 7. September 2022 20:30
> An: dev@netbeans.apache.org
> Betreff: netbeans module coding questions
>
> hi
>1. I want to customize the editor's side bar (the one showing the line
> number), I want to add some icon to it. Any example for this?
>2. The highlightfactory + highlighter is highlighting the editor by
> char offset. Is it possible to highlight some rows?
> thanks
> Peter
>
>


Re: Bringing apidoc back

2022-09-22 Thread Jean-Marc Borer
Hi Eric,

Thank you for the job.

There is one thing that I am unsure to have properly understood. As a NBP
advanced user, I often refer and use the Javadoc of private and friend
modules.

 Will the new site still provide it for the DEV version (currently on
bits.netbeans.org it is broken)?

This is something really important for me.

Best Regards,

JM

On Thu, Sep 8, 2022 at 9:05 AM Eric Barboni  wrote:

> Hi
>
> A PR https://github.com/apache/netbeans/pull/4450 with almost all the
> link break fixes is there.
>
>
> I would like to merge ASAP so we can keep future version as clean as
> possible according to missing link.
> I will have to patch build system / json to have a second jdk for javadoc.
>
> Two PR to have former links via webarchive on  our website.
> https://github.com/apache/netbeans-website/pull/608
> https://github.com/apache/netbeans-website/pull/607
>
>
> Best Regards
> Eric
>
> -Message d'origine-
> De : Jaroslav Tulach 
> Envoyé : samedi 13 août 2022 12:57
> À : dev 
> Objet : Re: Bringing apidoc back
>
> Amazing! Thank you for fixing the broken links.
> -jt
>
>
> Dne po 8. 8. 2022 19:51 uživatel Eric Barboni  napsal:
>
> > Hi folks,
> >
> > I started a PR to clean up the api doc. The main goal is that we need
> > javadoc to success with failonerror set to true. Because if it fails
> > only architecture and api change are generated but not the javadoc.
> >
> >
> > The most important issue is the following :
> > On the master it’s currently not possible to build using jdk 11
> > because java.source.base need a classpath with nbjavac (jdk 18) (they
> > may be other modules involved). I’m not sure if providing a javadoc
> > for nbjavac could help as Neil comment.
> > For being able to fix javadoc  issue in source
> > - I use a jdk 18 to be consitent with the jdk nb-javac use.
> > - I changed the javadoc checker to check all the html file to remove
> > maximum issue
> >
> > And there is a lots of issues 
> >
> > fixed the apichanges,arch.xml
> > fixed typos on doc ( like <   ; )
> > removed links that were using private/protected reference. (we expose
> > only  org.netbeans.api.*, org.netbeans.spi.*) using our new
> > netbeans.apache.org url as much as possible. And also coherent url
> > pattern.
> >
> >
> > So 1000 modifications later it compile on master with only a few bad
> > links remaining
> >
> > Here is a list of the faulty links
> >
> > https://cwiki.apache.org/confluence/display/NETBEANS/NetBeans+apidoc+r
> > eferenced+url That the second issue: the missing page from fomer
> > netbeans website and blogs. Web.archive.org get them all.
> >
> > So I need your advise what to do with that.
> > 1) Change the links to web.archiva.org
> > 2) Remove the links
> > 3) Copy from webarchive to our site but I'm unsure of the copyright here.
> > 4) other idea
> >
> > In the case of 3) could we have.
> > netbeans.apache.org/projects/autoupdate,
> > netbeans.apache.org/projects/ui
> >
> > Best regards
> > Eric
> >
> >
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> > For additional commands, e-mail: dev-h...@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-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: dev-h...@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>