Package: netbeansifier
netbeansifierSimple and dumb Python script that packages up Java files into a basic NetBeans project for ICS4U.Usage: netbeansify <input directory> [options]

Available Options:
    --help                  Display this help message.
    --out <dir>             Specify the output directory; if --zip is set, this is optional.
    --sourcepath <dir>      Specify the input directory (overrides the one already specified).
    --name <project_name>   Specify the project name (default: input directory name).
    --mainclass <class>     Specify the main class, including the package (default: project name).
    --sourcever <ver>       Specify the source code's compatible Java version (default: 11).
    --targetver <ver>       Specify the target's compatible Java version (default: 11).
    --jvmargs <args>        Specify additional args to pass to the JVM during execution.
    --javacargs <args>      Specify additional args to pass to javac during compilation.
    --precommand <cmd>      Specify a command to run before generating the files; the command is
                                executed in the source directory. Multiple commands can be
                                used by chaining with &&.
    --postcommand <cmd>     Specify a command to run after generating the files; the command is
                                executed in the destination directory. Multiple commands can be
                                used by chaining with &&.
    --template <dir>        Specify the template file directory (default: "template/" in the Python
                                file's directory).
    --zip                   Create a NetBeans project zip named ProjectName.zip in the current
                                directory; if this is set, --out is optional.
    --nologo                Do not include netbeanz.png in the output.
    --verbose               Print more output.

netbeansifier also supports gitignore-style ignore files.
Files named .nbignore contain patterns for files/directories that are excluded during copying.
The file itself is also ignored.

You can also make a netbeansifierfile. Each line will be treated as a command-line option.
Note: Because of the --precommand and --postcommand options, running an untrusted netbeansifierfile
could result in malicious commands being executed!Installationnetbeansifiercan be installed throughpipwithpip install netbeansifier.
Alternatively, clone this repository and runpython3 setup.py install(py setup.py installon Windows).UsageOnce installed, the program can be invoked throughpython3 -m netbeansifier(py -m netbeansifieron Windows),
or directly usingnetbeansify.Basic UsageFor the bare minimum, you need to specify an input directory and an output directory:netbeansifyproject_directory--outoutput_directoryThis will generate a NetBeans project inoutput_directory, with all your files inproject_directoryin the project.Often, you might also want to specify a project name and main class (entry point):netbeansifyproject_directory--outoutput_directory--nameMyProject--mainclassMyEntryPointClassFinally, passing the--zipoption will generate a project zip, which you can directly submit:netbeansifyproject_directory--nameMyProject--mainclassMyEntryPointClass--zipWhen--zipis used, you can omit the output directory to only generate a zip (the output will use a temporary directory and deleted after generation).
Alternatively, if both--outand--zipare specified, both the zip and the normal project directory will be generated.Advanced UsageYou can use the--precommandand--postcommandoptions to specify a command to execute before and after the files are generated.
This can be used for purposes such as removing old archives before generation, or moving files around.For example, suppose we want to remove the project zip before generating.
Suppose we also have aninput.txt, which we wish to place in the project root (by default, it will be placed in thesrcfolder with all the Java sources).
We can use the following command:netbeansifyproject_directory--precommand"rm -f ProjectName.zip"--postcommand"mv src/input.txt ./"Please note that the pre-command is executed in theinput directory, while the post-command is executed in theoutput directory.For more arguments, see the help message at the beginning..nbignoreBy default,netbeansifierwill copy over all the files and directories in your input directory (excluding.nbignores andnetbeansifierfiles).
To ignore certain files,netbeansifiersupports ignore files withgitignoresyntax.
Files and directories matching the patterns in a.nbignorefile will not be copied.For example, the following.nbignorefile ignores a Git repository and build output:.git/
bin/netbeansifierfileTo avoid typing in all the arguments every time you run the command, you can set up anetbeansifierfilefor your project.
When you runnetbeansifyin a directory, it will look for a file namednetbeansifierfilein the current directory to use.
Each line in the file is a command-line argument.
The these arguments come before the arguments you specify manually on the command-line, so you can override them manually by specifying an argument again if desired.Examplenetbeansifierfile:# This is a comment (only works at the beginning of the line)# Each line is a new command-line option--nameProjectName
--mainclassMyMainClass
--sourcepath.# Example pre-command to clean up old archives and make fresh Javadocs# Pre-commands are executed in the source directory--precommandrm-rfProjectName.zipdoc/&&javadoc-ddoc*.java# Example post-command to move the doc folder and other files into the correct location# Post-commands are executed in the destination directory (project root)--postcommandmvsrc/docsrc/input1.txtsrc/input2.txt.# Generate a zip--zipWith such a setup, you can simply runnetbeansifywithout giving it any arguments, since it will read them from thenetbeansifierfile.