sbt-netbeans

sbt-netbeans is an SBT plugin designed to simplify the generation of Netbeans project configuration files for SBT projects. This plugin allows opening SBT projects in Netbeans when absolutely necessary, as when working with legacy projects containing .form files.

In such cases this plugin can be used to allow editing these files in Netbeans; and the remainder using your IDE of choice.

Features

  • Project Configuration: Generates Netbeans project configuration files (project.xml and project.properties).
  • Copy to Default Directory: Optionally copies generated files to the Netbeans default configuration directory.
  • Clean Configuration: Deletes generated Netbeans configuration files.

Usage

To use the sbt-netbeans plugin, add the following to your project/plugins.sbt file:

addSbtPlugin("africa.shuwari.sbt" % "sbt-netbeans" % "[latest tag]")

In your build.sbt file, you can configure the plugin settings as follows:

name := "my-netbeans-project"

version := "0.1.0"

enablePlugins(NetbeansPlugin)

netbeansCopyDefault := true // true by default

This example sets up a Netbeans project and enables copying generated files to the Netbeans default configuration directory.

Recommendation: Add the default Netbeans configuration directory (nbproject) to your .gitignore file to avoid committing generated configuration files to your repository:

# Ignore Netbeans configuration directory
nbproject/

Settings

The following settingKey is available:

  • netbeansCopyDefault [SettingKey[Boolean]]: Copies generated files to the Netbeans default configuration directory. true by default.

Tasks

  • netbeans: Generates the Netbeans project configuration files.
  • netbeansClean: Cleans the generated Netbeans configuration files.

Opening the Project in Netbeans

To open a module in Netbeans once a configuration has been generated using the sbt-netbeans plugin, follow these steps:

  1. Generate the Netbeans Configuration: Run the following SBT task to generate the Netbeans project configuration files:

    sbt netbeans
  2. Open Netbeans: Launch the Netbeans IDE.

  3. Open the Project:

    • Go to File > Open Project.
    • Navigate to the directory where your SBT project is located.
    • Select the project directory (it should contain the nbproject folder generated by the plugin).
    • Click Open Project.
  4. Build and Run:

    • Once the project is opened, you can build and run it using the standard Netbeans options.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests to help improve the plugin.

License

Copyright © Shuwari Africa Ltd. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance
with the License. You may obtain a copy of the License at:

    [`https://www.apache.org/licenses/LICENSE-2.0`](https://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License.