1. Field of the Invention
The present invention relates generally to application development in an integrated development environment (IDE). In particular, described embodiments are directed to automatic discovery of implicit dependencies by the IDE.
2. Description of Related Art
Modern software development is typically carried out using an integrated development environment (IDE). An IDE generally provides a source code editor, a compiler, a debugger and build tools. Build tools, which collectively can be referred to as a build system, perform compiling, linking, copying and similar activities in order to produce an application or other output from inputs such as source code.
In an IDE such as Xcode, available from Apple Inc. of Cupertino, Calif., a “target” specifies a product to build and contains the instructions for building the product from a set of files in a project. A target defines a single product; it organizes the inputs into the build system—the source files and instructions for processing those source files—required to build that product.
Generally, a single project may contain a number of targets, and each target builds a single product. The particular files required by the target to build its product may themselves be products of other targets. In that event, one target is said to depend on the other target.
If a first target depends upon a second target, then the second target must be built before the first target. To ensure this, developers explicitly specify target dependencies in the IDE. Once the dependencies are specified, they are enforced during build of the project by the IDE. Thus, if the first target depends upon the second, then the IDE will build the second target before attempting to build the first. If the second target cannot be built, for example because of an error, then the IDE will typically not attempt to build the first.
The present invention enables the use of implicit workspace dependencies. Implicit dependences allow a user to add multiple independent software components to a workspace, which results in the automatic establishment of ad-hoc dependencies.
An IDE system of the present invention includes a workspace module that provides a workspace to users of the IDE system. A workspace is a container for multiple projects that the user can use to group projects and other files that are related. In one embodiment, all the projects in the workspace share the same build directory.
By relating projects in a common workspace, each project can use the products of another project while building. If one project depends on the products of another in the same workspace, a dependency manager detects this, causing a build engine to automatically build the projects in the correct sequence.
Because each file in one project is visible to the other projects in the workspace, the user does not need to copy shared libraries into each project folder separately.
Each project retains its individual identity, so a project can be included in more than one workspace or removed from a workspace without affecting the project. The workspace module maintains pointers to the projects and other files that the workspace includes. The pointers to the source files, included libraries, build configurations, and other data are stored in the project files.
A target and the product it creates can be related to another target. That is, a first target that requires the output of a second target in order to build depends upon the second. If both targets are in the same workspace, the dependency manager discovers the dependency, for example using a heuristic such as file name recognition, and the build engine then builds the products in the required order. Such a relationship is referred to as an implicit dependency. The user can also specify explicit target dependencies. For example, the user might build both a library and an application that links against that library in the same workspace. The dependency manager discovers this relationship and the build engine will automatically build the library first. However, if the user actually wants to link against a version of the library other than the one built in the workspace, the user can create an explicit dependency in the build settings, which overrides this implicit dependency. In one embodiment any or all implicit dependencies can be prevented through a preference setting or other control.
Workspace module 104 provides functionality associated with the workspace of an IDE. For example workspace module 104 provides text-editing functionality, the ability to add and remove source folders and files from a project, specify explicit dependencies and linkages for a target, and other input/output features conventionally available in an IDE.
Code database 108 provides computer-readable data storage media for source code, object code, and other files used either by modules of IDE system 100 or by the user. Although illustrated in
Dependency manager 106 is responsible for tracking explicit and implicit dependencies between build targets in the workspace. Build engine 102 executes building operations to create build products. The operation of dependency manager 106 and build engine 102 are described further below.
As the user creates the code and structure of his project, he explicitly specifies the libraries each target will link against, and may also explicitly identify some of the target dependencies. Referring now to
Referring to
In one embodiment, dependency module 106 tracks both explicit and implicit dependencies by maintaining the transitive closure of a directed acyclic graph, as will be understood by those of skill in the art. The graph may be stored in a matrix or other data structure.
Referring now to
If the user then adds the MyFramework.framework source to the workspace, this results in the creation of an implicit dependency. This is illustrated by the example of
As described above, because Foo.project and Bar.project are both in the same workspace 600, dependency module 106 maintains information about the linked libraries and build products of each target in both projects. In the illustrated case, both the MyFooClient and the MyFooServer targets of the Foo.project project require the MyFramekwork.framework framework, though the user has not specified an explicit dependency on the MyFrameworkPrime target that produces that framework. Dependency module 106, however, identifies the product MyFramework.framework of target MyFrameworkPrime as linked against both targets of the Foo.project project and also of the MyBarClient target of the Bar.project project. Dependency module 106 therefore creates an implicit dependency by MyFooClient, MyFooServer and MyBarClient on MyFrameworkPrime. As a result, build engine 102 will ensure that MyFramework.framework is produced prior to the other products, and is then linked against them. This differs from the case illustrated by
In one embodiment, removing a source code folder from the workspace causes dependency manager 306 to remove any implicit dependencies that depend upon the target in the removed folder.
In one embodiment, implicit dependencies are created (and removed) automatically by dependency manager 306 as described above. In an alternative embodiment, IDE system 100 asks the user to confirm or reject the establishment of a dependency, either as the potential implicit dependencies are identified, or alternatively at build time.
The present invention has been described in particular detail with respect to a limited number of embodiments. Those of skill in the art will appreciate that the invention may additionally be practiced in other embodiments.
Within this written description, the particular naming of the components, capitalization of terms, the attributes, data structures, or any other programming or structural aspect is not mandatory or significant, and the mechanisms that implement the invention or its features may have different names, formats, or protocols. Further, the system may be implemented via a combination of hardware and software, as described, or entirely in hardware elements. Also, the particular division of functionality between the various system components described herein is merely exemplary, and not mandatory; functions performed by a single system component may instead be performed by multiple components, and functions performed by multiple components may instead be performed by a single component.
Some portions of the above description present the feature of the present invention in terms of algorithms and symbolic representations of operations on information. These algorithmic descriptions and representations are the means used by those skilled in the art to most effectively convey the substance of their work to others skilled in the art. These operations, while described functionally or logically, are understood to be implemented by computer programs. Furthermore, it has also proven convenient at times, to refer to these arrangements of operations as modules or code devices, without loss of generality.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the present discussion, it is appreciated that throughout the description, discussions utilizing terms such as “selecting” or “computing” or “determining” or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system memories or registers or other such information storage, transmission or display devices.
Certain aspects of the present invention include process steps and instructions described herein in the form of an algorithm. It should be noted that the process steps and instructions of the present invention could be embodied in software, firmware or hardware, and when embodied in software, could be downloaded to reside on and be operated from different platforms used by real time network operating systems.
The present invention also relates to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer readable storage medium, such as, but is not limited to, any type of disk including floppy disks, optical disks, DVDs, CD-ROMs, magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, application specific integrated circuits (ASICs), or any type of media suitable for storing electronic instructions, and each coupled to a computer system bus. Furthermore, the computers referred to in the specification may include a single processor or may be architectures employing multiple processor designs for increased computing capability.
The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. Various general-purpose systems may also be used with programs in accordance with the teachings herein, or it may prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will appear from the description above. In addition, the present invention is not described with reference to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any references to specific languages are provided for disclosure of enablement and best mode of the present invention.
Finally, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, the disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention.
This application claims the benefit of U.S. Provisional Application 61/352,219, filed on Jun. 7, 2010, which is incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
61352219 | Jun 2010 | US |