34.5.1 Create a Project (Mixed-Language Capable)
createProject <project_path> [-workingset [-newwindow]] [-force] [-close_others]
[-f|-F <file_path>] [-top <top_file_path>] [-test <test_file_path>]
[-map <link_name> <target_path>] [-name <project_name>]
[-lang <lang>] [-perspective <perspective>] [-clearcase]
[-git <repo1:repo2:...:repoN>] [-p4 <connection_parameters>]
[-openResourceFilterDialog]
[-include auto[:<threshold>]] [-include first_level] [-disable_fs_check]
[-exclude|include [[name|location|projectRelativePath[_regex]=<pattern>]|[symlink=true|false]]][,root=folder1[:sub/folderN]][,applies=f|d|rf|rd]]
[-build <name>] [-<name>.build <build configuration directives ...>]
Mandatory arguments:
<project_path> Absolute path to project (must exist).
-lang Enable support for <lang> language: E, VLOG, VHDL, CPP, CPP_EXT, PSS, SLN, SDL.
CPP, CPP_EXT are only valid when DVT CDT Integration feature is installed.
At least one language must be specified.
Optional arguments:
-<name>.build Create the build configuration file <project>/.dvt/<name>.build with
<build configuration directives> as content. All flags up to the end of the
command line, or up to the next -<name>.build flag are considered build
configuration directives. This flag cannot be used in conjunction with
-f, -F, -test, or -top.
-build <name> Set <name> as active build configuration.
-clearcase Share project with ClearCase Eclipse plugin.
-include auto[:<threshold>]
Automatically create resource filters, based on the active build configuration.
Only compilation related directories are included, for example +incdirs, -y libdirs,
$SPECMAN_PATH entries and parent directories of top files.
If specified, directories with more than <threshold> files will be excluded; otherwise,
all relevant directories containing compiled files will be included.
Some configuration resources are always included: .buildpath, .classpath, .cproject, .dvt,
.project, .pydevproject, .settings
[NOTE] The -include auto argument can be combined with any further user-specified include or exclude filters
-include first_level
Automatically create resource filters to include only the files and directories (without their content)
located directly under the project root.
The directories' content can be brought on demand, level by level, by double clicking on a directory
in the Project Explorer View.
Some configuration resources are always included: .dvt, .settings
For more details see the Lazy Bring up Resources chapter.
-disable_fs_check By default, a filesystem check is performed to determine if the project directory sits on top of
a large filesystem tree (more than 50000 children) or if the project directory is located on a slow filesystem
(listing all the files takes more than 10 seconds).
In such a situation, there is a high risk of running into refresh performance problems. To avoid this,
the -include auto and -include first_level options are added automatically to the command.
Use this flag to disable the filesystem check and the automatic injection of -include auto and -include first_level.
-exclude|include [name|location|projectRelativePath[_regex]=<pattern>,][root=folder1[:sub/folderN],][applies=f|d|rf|rd]
or
[symlink=[true|false],][root=folder1[:sub/folderN],][applies=f|d|rf|rd]
Create resource filters.
Use include to keep files or directories matching <pattern>.
Use exclude to filter out files or directories matching <pattern>.
[name|location|projectRelativePath[_regex]=]<pattern>
If only <pattern> is specified it is equivalent with name=<pattern>.
For <name|location|projectRelativePath>=<pattern>, the pattern is case insensitive and allows simple wildcards (* and ?).
For <name_regex|location_regex|projectRelativePath_regex>=<pattern>, the pattern is case sensitive and allows regular expressions.
symlink=true|false
When symlink=true only symlinked resources are matched by the filter.
When symlink=false only non-symlinked resources are matched by the filter.
root=folder1[:sub/folderN]
By default filter applies to project root children, unless you specify one or more roots.
applies=f|d|fr|dr
By default filter applies recursively to files and directories under root(s), unless you restrict it:
f = filter applies only to _f_iles under root(s)
d = filter applies only to _d_irectories under root(s)
rf = filter applies _r_ecursively to _f_iles under root(s)
rd = filter applies _r_ecursively to _d_irectories under root(s)
For example, given this project hierarchy:
| cli_resource_filters_example
|-- .dvt
| |-- default.build
|-- folder_1
| |-- folder_1_1
| | |-- folder_1_1.log
| | |-- some_file.sv
| |-- folder_1_2
| | |-- folder_1_2.log
| | |-- some_file.sv
| |-- folder_1.log
| |-- some_file.sv
|-- folder_2
| |-- folder_2_1
| | |-- folder_2_1.log
| | |-- some_file.sv
| |-- folder_2_2
| | |-- folder_2_2.log
| | |-- some_file.sv
| |-- folder_2.log
| |-- some_file.sv
|-- .project
|-- dvt_build.log
* to exclude a sub-directory of the project, including all of its content:
dvt_cli.sh -workspace ~/dvt_workspace createProject ~/projects/cli_resource_filters_example/ -lang VLOG -exclude projectRelativePath=folder_2,applies=d
| cli_resource_filters_example
|-- .dvt
| |-- default.build
|-- folder_1
| |-- folder_1_1
| | |-- folder_1_1.log
| | |-- some_file.sv
| |-- folder_1_2
| | |-- folder_1_2.log
| | |-- some_file.sv
| |-- folder_1.log
| |-- some_file.sv
|-- .project
|-- dvt_build.log
* to include only particular sub-directories of the project:
dvt_cli.sh -workspace ~/dvt_workspace createProject ~/projects/cli_resource_filters_example/ -lang VLOG -include projectRelativePath=folder_1 -include projectRelativePath=folder_1/folder_1_1
-include projectRelativePath=folder_1/folder_1_1/*
| cli_resource_filters_example
|-- .dvt
| |-- default.build
|-- folder_1
| |-- folder_1_1
| | |-- folder_1_1.log
| | |-- some_file.sv
|-- .project
* to exclude all the files which have their names matching a regular expression:
dvt_cli.sh -workspace ~/dvt_workspace createProject ~/projects/cli_resource_filters_example/ -lang VLOG -exclude name_regex=.*.log,applies=rf
| cli_resource_filters_example
|-- .dvt
| |-- default.build
|-- folder_1
| |-- folder_1_1
| | |-- some_file.sv
| |-- folder_1_2
| | |-- some_file.sv
| |-- some_file.sv
|-- folder_2
| |-- folder_2_1
| | |-- some_file.sv
| |-- folder_2_2
| | |-- some_file.sv
| |-- some_file.sv
|-- .project
The root parameter instructs the filter application to a relative point in the project hierarchy.
* Suppose the case of removing some log files, but only starting with a certain point in the project hierarchy:
dvt_cli.sh -workspace ~/dvt_workspace createProject ~/projects/cli_resource_filters_example/ -lang VLOG -exclude name_regex=.*.log,root=folder_2,applies=rf
| cli_resource_filters_example
|-- .dvt
| |-- default.build
|-- folder_1
| |-- folder_1_1
| | |-- folder_1_1.log
| | |-- some_file.sv
| |-- folder_1_2
| | |-- folder_1_2.log
| | |-- some_file.sv
| |-- folder_1.log
| |-- some_file.sv
|-- folder_2
| |-- folder_2_1
| | |-- some_file.sv
| |-- folder_2_2
| | |-- some_file.sv
| |-- some_file.sv
|-- .project
|-- dvt_build.log
* If the case, you can also specify multiple roots for a filter (for example exclude all the log files in folder_1/folder_1_2 and folder_2):
dvt_cli.sh -workspace ~/dvt_workspace createProject ~/projects/cli_resource_filters_example/ -lang VLOG -exclude name_regex=.*.log,root=folder_1/folder_1_2:folder_2,applies=rf
| cli_resource_filters_example
|-- .dvt
| |-- default.build
|-- folder_1
| |-- folder_1_1
| | |-- folder_1_1.log
| | |-- some_file.sv
| |-- folder_1_2
| | |-- some_file.sv
| |-- folder_1.log
| |-- some_file.sv
|-- folder_2
| |-- folder_2_1
| | |-- some_file.sv
| |-- folder_2_2
| | |-- some_file.sv
| |-- some_file.sv
|-- .project
|-- dvt_build.log
[NOTE] Resource filters are also applied for linked resources (such as those created by -map)
[NOTE] You can specify any number of include or exclude filters.
[NOTE] Regardless the specified order, all the include filters will be applied before the exclude filters.
[NOTE] Do not use trailing slashes when specifying a directory pattern.
[NOTE] DVT provides a user interface for managing Resource Filters as a simpler and more
intuitive alternative to the Eclipse built-in Resource Filters management UI.
However, DVT's UI only works for <projectRelativePath> filters that do not
contain wildcards or regular expressions.
-f|-F Specify a command file for the project. -f and -F are mutually exclusive.
-force Overwrite existing project.
-git Add the specified repositories to the Git Repositories View. A colon (:) separated
list of repository paths must be provided.
[NOTE] Repository paths must include (end with) the /.git segment.
-map Create a linked resource called <link_name> pointing to <link_target>.
-name Use as project name instead of project's directory name.
-newwindow Open a new window with the working set selected.
-p4 Share project with Perforce Eclipse plugin. The <connection_parameters>
argument must be specified as a list of <parameter>=<value> separated by commas.
Mandatory parameters:
P4PORT=<host:port> (P4PORT=company_server:1666)
P4CLIENT=<perforce_workspace_name> (P4CLIENT=perforce-work)
P4USER=<username> (P4USER user1)
Optional parameters:
P4CHARSET=<charset_type> (P4CHARSET=none)
P4PASSWD=<password> (P4PASSWD=password123)
SAVEPASS=<save_in_secure_storage_or_not> (SAVEPASS=false)
OFFLINE=<working_offline_or_not> (OFFLINE=false)
-perspective Switch to <perspective> after creating the project.
By default, DVT switches to the DVT Perspective if multiple -lang directives are provided.
If a single language is enabled, the corresponding perspective is activated.
Valid argument values: DVT, E, VLOG, VHDL, CPP, PSS, SLN, SDL, or a perspective ID.
Perspective IDs provided by the additional plugins included in the DVT distro:
JDT - org.eclipse.jdt.ui.JavaPerspective
LUA - org.eclipse.ldt.ui.luaperspective
PERL - org.epic.core.Perspective
PYTHON - org.python.pydev.ui.PythonPerspective
RUBY - org.eclipse.dltk.ruby.ui.RubyPerspective
TCL - org.eclipse.dltk.tcl.ui.TclPerspective
CVS - org.eclipse.team.cvs.ui.cvsPerspective
GIT - org.eclipse.egit.ui.GitRepositoryExploring
SVN - org.eclipse.team.svn.ui.repository.RepositoryPerspective
PERFORCE - com.perforce.team.ui.perforcePerspective
COLLABORATOR - com.smartbear.collaborator.ui.collabPerspective
-svn Share project with the Subversive SVN Eclipse plugin.
The SVN repository URL must be provided.
The repository is added to the SVN Repositories View if not existing.
-test Specify a test file for the project. You can specify this option multiple times.
-top Specify a top file for the project. You can specify this option multiple times.
-workingset Add project to a working set.
-close_others Close all projects in the workspace except the newly created one.