On 23/01/26 10:25 AM, Scott Palmer wrote:
Well, yeah of course.. but is there a documented public API?
The maven plugin doesn't actually do refactoring, right?  It just
identifies hints?

At: https://netbeans.apache.org/jackpot/

To apply the changes produced by the declarative hints, run jackpot30:apply:
$ mvn -q jackpot30:apply && git diff

Haven't tried it, but sure looks like it does the refactoring.

-ernie

I was just wondering if there are notes somewhere that go a bit deeper than
showing how to use it from the command line or NetBeans.

I did find a README in the cmdline folder.  So at least that's a start for
getting something to build.

Thanks,

Scott

On Thu, Jan 26, 2023 at 11:22 AM Michael Bien <mbie...@gmail.com> wrote:

you check how the maven plugin is implemented and adopt it for gradle?

-mbien

On 26.01.23 17:13, Scott Palmer wrote:

I don't use Maven if I can help it.

But you misunderstand, I want to call Jackpot from my code to get it to
perform some refactoring from control of my program. Getting a list of
possible hints may happen later.
Or perhaps a more general use... What would I do if I wanted to write a
Gradle plugin to do the same as the Maven plugin? Assuming I know the
Gradle side, how do I call the Jackpot methods?

Regards,

Scott


On Thu, Jan 26, 2023 at 10:50 AM Michael Bien <mbie...@gmail.com> wrote:

On 26.01.23 16:01, Scott Palmer wrote:
I wanted to experiment with Jackpot for a project I'm working on.  How
dependent on the NetBeans Platform is the Jackpot code at
https://github.com/apache/netbeans-jackpot30 ?
Is there such a thing as a jackpot library jar that does not depend on
NetBeans classes?
If I wanted to make a standalone tool to do certain transformations on a
Java code base where would I start?

Thanks for any help you can provide,

Scott

you should be able to use it from maven in your build:

              <plugin>
<groupId>org.apache.netbeans.modules.jackpot30</groupId>
<artifactId>jackpot30-maven-plugin</artifactId>
                  <version>13.0</version>
                  <configuration>
<configurationFile>jackpot-settings.xml</configurationFile>
<failOnWarnings>true</failOnWarnings>
                  </configuration>
                  <executions>
                      <execution>
                          <id>jackpot</id>
                          <phase>compile</phase>
                          <goals>
                              <goal>analyze</goal>
                          </goals>
                      </execution>
                  </executions>
              </plugin>


I use it mostly from within NetBeans itself for refactoring or
inspection tasks with the help of the ".hint" files.

I sometimes upload the inspections which I think are reusable or more
generic here:

https://github.com/mbien/jackpot-inspections

readme explains how to use hint files.

-mbien




---------------------------------------------------------------------
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



Reply via email to