Home · Overviews · Reference · Classes codeless banner

Project Javascript Class Reference

Class Project inherits Object

In addition to the methods inherited from Object,

Methods

rule([name]): Rule

Returns a new rule object. If name is provided, it will be a named rule, otherwise an anonymous Rule will be created.

existingFile: null

XXX do not use

isVirtual: boolean

Returns true if this is a virtual project, otherwise returns false. A virtual project is one that has no associated qbuild.pro file on disk and is instead running the generic blank project files.

sproject(): SolutionProject

Returns the SolutionProject instance associated with this project.

projectFile(): SolutionFile

Returns the SolutionFile instance for this project.

config(name): boolean

Returns true if the name option is set in the CONFIG variable, otherwise returns false.

message(message): null

Prints the message message and continues.

warning(message): null

Prints the warning message and continues.

error(message): null

Prints the error message and aborts project processing immediately.

run(snippet): null

Runs the .pro file snippet.

file(filename): SolutionFile

Returns a SolutionFile for the provided filename, or null if the file doesn't exist. filename may be relative to the project, contain glob wildcards and is evaluated in both project space and against the actual filesystem. If more than one file matches, an arbitrary choice is returned, with entries in the build tree taking priority over entries in the project tree, and entries in either the build or project tree taking priority over raw filesystem files.

files(filename): list<SolutionFile>

Returns an array of SolutionFile instances for the provided filename. filename may be relative to the project, contain wildcards and is evaluated in both project space and against the raw filesystem.

projectFile(filename): SolutionFile

Returns a SolutionFile for the provided filename, or null if the file doesn't exist. filename may be relative to the project, contain glob wildcards and is evaluated in project space. If more than one file matches, an arbitrary choice is returned, with entries in the build tree taking priority over entries in the project tree.

projectFiles(filename): list<SolutionFile>

Returns an array of SolutionFile instances for the provided filename. filename may be relative to the project, contain wildcards and is evaluated in project space.

filesystemFile(filename): SolutionFile

Returns a SolutionFile for the provided filename, or a null SolutionFile if filename doesn't exist. filename may be relative to the project's location on the actual filesystem and contain wildcards. If more than one file matches, an arbitrary choice is returned.

filesystemFiles(filename): list<SolutionFile>

Returns an array of SolutionFile instances for the provided filename. filename may be relative to the project's location on the actual filesystem and contain wildcards. filename is not evaluated in project space, but rather directly against the machines filesystem.

buildFile(filename): SolutionFile

Returns a SolutionFile for filename in the projects build area. filename may be relative, but cannot (obviously) contain wildcards.

buildPath(path): string

Returns the filesystem path equivalent to path in the projects build area. path may be relative, but cannot (obviously) contain wildcards. Calling buildPath() without arguments returns the projects build directory.

paths(path): list<SolutionFile>

Returns the set of qualified paths in project space and the filesystem given by path. path may be relative to the project and contain glob wildcards.

projectPaths(path): list<SolutionFile>

Returns the set of qualified paths in project space given by path. path may be relative to the project and contain glob wildcards.

filesystemPaths(path): list<SolutionFile>

Converts a project path into a set of filesystem paths. path may be relative to the project and contain glob wildcards.

expression(expr): list<string>

Evaluates the expr expression in the project, and returns the result.

pathIterator(): PathIterator

Returns a new PathIterator instance set to the project's solution and base directory.

reset(string): undefined

Reset the project because of reason string. Note that a project can only be reset once per reason.

resetReason(): QStringList

Returns the reasons that have caused the project to reset.

See also Object and Javascript Binding.


Copyright © 2009 Trolltech
Qt Extended - QBuild Maintainer Guide