public class J2SEProjectBuilder extends Object
new J2SEProjectBuilder(projectFolder, projectName). addSourceRoots(sourceFolders). addTestRoots(testFolders). setMainClass(mainClass). build();XXX: Uses Bundle from org.netbeans.modules.java.j2seproject package not to affect existing localizations.
Constructor and Description |
---|
J2SEProjectBuilder(File projectDirectory,
String name)
Creates a new instance of
J2SEProjectBuilder |
Modifier and Type | Method and Description |
---|---|
J2SEProjectBuilder |
addCompileLibraries(Library... libraries)
Adds compile time libraries
|
J2SEProjectBuilder |
addDefaultSourceRoots()
Adds the default source roots, "src" and "test".
|
J2SEProjectBuilder |
addJVMArguments(String jvmArgs)
Adds a JVM arguments
|
J2SEProjectBuilder |
addRuntimeLibraries(Library... libraries)
Adds runtime libraries
|
J2SEProjectBuilder |
addSourceRoots(File... sourceRoots)
Adds source roots into the project
|
J2SEProjectBuilder |
addTestRoots(File... testRoots)
Adds test roots into the project
|
AntProjectHelper |
build()
Creates the J2SEProject
|
static void |
createDefaultModuleProperties(EditableProperties ep,
boolean hasUnitTests)
Sets default module system properties if they are not set.
|
J2SEProjectBuilder |
setBuildXmlName(String name)
Sets a name of build.xml file
|
J2SEProjectBuilder |
setDistFolder(String distFolderName)
Sets a name of dist (build artifact) folder
|
J2SEProjectBuilder |
setJavaPlatform(JavaPlatform platform)
Sets a platform to be used for a new project
|
J2SEProjectBuilder |
setLibrariesDefinitionFile(String librariesDefinition)
Sets a library definition file for per project libraries,
|
J2SEProjectBuilder |
setMainClass(String mainClass)
Sets a main class
|
J2SEProjectBuilder |
setMainClassTemplate(String mainClassTemplatePath)
Sets a main class template
|
J2SEProjectBuilder |
setManifest(String manifest)
Sets a path to manifest file
|
J2SEProjectBuilder |
setSourceLevel(SpecificationVersion sourceLevel)
Sets a source level of the project
|
J2SEProjectBuilder |
skipTests(boolean skipTests)
Avoids creating the test root folder and adding JUnit dependencies.
|
public J2SEProjectBuilder(@NonNull File projectDirectory, @NonNull String name)
J2SEProjectBuilder
projectDirectory
- the directory in which the project should be createdname
- the name of the projectpublic J2SEProjectBuilder addDefaultSourceRoots()
public J2SEProjectBuilder skipTests(boolean skipTests)
SourceGroupModifier
with JavaProjectConstants.SOURCES_HINT_TEST
will work later.public J2SEProjectBuilder addSourceRoots(@NonNull File... sourceRoots)
sourceRoots
- the roots to be addedpublic J2SEProjectBuilder addTestRoots(@NonNull File... testRoots)
testRoots
- the roots to be addedpublic J2SEProjectBuilder addCompileLibraries(@NonNull Library... libraries)
libraries
- the libraries to be added to compile classpath.public J2SEProjectBuilder addRuntimeLibraries(@NonNull Library... libraries)
libraries
- the libraries to be added to runtime classpath.public J2SEProjectBuilder setMainClass(@NullAllowed String mainClass)
mainClass
- the fully qualified name of the main class,
if null main class is not createdpublic J2SEProjectBuilder setManifest(@NullAllowed String manifest)
manifest
- the name (path) to manifest file,
if not manifest is not setpublic J2SEProjectBuilder setLibrariesDefinitionFile(@NullAllowed String librariesDefinition)
librariesDefinition
- the name (path) to libraries definition file,
if null project libraries are not usedpublic J2SEProjectBuilder setSourceLevel(@NullAllowed SpecificationVersion sourceLevel)
sourceLevel
- the source level,
if null the default source level is used.public J2SEProjectBuilder setBuildXmlName(@NullAllowed String name)
name
- the name of build.xml file,
if null the default 'build.xml' is used@NonNull public J2SEProjectBuilder setDistFolder(@NullAllowed String distFolderName)
distFolderName
- the name of the dist folder
if null the default 'dist' is usedpublic J2SEProjectBuilder setMainClassTemplate(@NullAllowed String mainClassTemplatePath)
mainClassTemplatePath
- the path to main class template on the system filesystem,
if null the default template is usedpublic J2SEProjectBuilder addJVMArguments(@NonNull String jvmArgs)
jvmArgs
- the arguments to be addedpublic J2SEProjectBuilder setJavaPlatform(@NonNull JavaPlatform platform)
platform
- to be usedpublic AntProjectHelper build() throws IOException
AntProjectHelper
of the created projectIOException
- when creation failspublic static void createDefaultModuleProperties(@NonNull EditableProperties ep, boolean hasUnitTests)
ep
- the EditableProperties
to write the properties into.