-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define a common build process for all projects which includes a set of standard phases that can be used for extensibility. The idea is that components and project types will have a solid foundation for build extensions instead of ad-hoc set of tasks for each project. The `build` task now spawns a set of standard build phase tasks: - `default` (synthesize project - executes your projenrc). - `pre-compile` - `compile` - `post-compile` - `test` - `package` The `Project` base class now has a set of properties that can be used to access these tasks. For example, `project.postcompileTask` will return the `Task` that’s executed after compilation. The method `task.lock()` can now be used to lock a task for mutations. The `build` task is now locked, which means that any modifications to it will throw an exception. This change also includes some logging improvements and cleanups. This is an attempt to create generic build model for all project types. We shall see if this holds water. BREAKING CHANGE: It is now impossible to modify the `build` task. Instead, extend one of the specific build phases (`precompile`, `compile`, `post compile`, `test` and `package`). To access these tasks use `project.xxxTask`. * The `compileBeforeTest` option in `TypeScriptProject` is not supported any more. Tests are always executed _after_ compilation. * `projenDuringBuild` is no longer supported. Let us know if you have a use case for it that we are not aware of. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information
Elad Ben-Israel
committed
Nov 7, 2021
1 parent
1378684
commit 2b38918
Showing
66 changed files
with
2,117 additions
and
935 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Projects | ||
|
||
This section describes common behaviors for all projen projects. It is | ||
implemented as part of the `Project` base type, from which all projen projects | ||
are derived. | ||
|
||
## Build Tasks | ||
|
||
Projen defines a standard way for building software through a fixed set of | ||
*build phases*. This is implemented via a set of [tasks](./tasks.md) defined in | ||
the `Project` base class. | ||
|
||
The `build` task spawns a set of sub-tasks which represent the various build phases: | ||
|
||
* `default` - this task is responsible to execute your projenrc and synthesize all project files. | ||
* `pre-compile` - runs before compilation (eg. bundle assets) | ||
* `compile` - compile your code (if needed) | ||
* `post-compile` - runs immediately after a successful compilation | ||
* `test` - runs tests | ||
* `package` - creates a distribution package | ||
|
||
To extend the build process, components and projects can use | ||
`project.projectBuild.xxxTask` and interact with the `Task` object (i.e. | ||
`project.projectBuild.postCompileTask.exec("echo hi")` will execute `echo hi` after | ||
compilation). | ||
|
||
> NOTE: the `build` task is locked. This means that any attempt to extend it | ||
> (i.e. call `spawn`, `exec`, `reset`, etc) will throw an exception. Instead of | ||
> extending `build`, just extend one of the phases. This ensures that phases are | ||
> always executed in the right order. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.