crusade-tracker/system/caches/pluginsDslCache/doc/jetbrains.build-server.configs.kotlin.v2017_2/-project/-init-.html

106 lines
5.3 KiB
HTML
Raw Normal View History

2021-01-18 20:27:50 +00:00
<HTML>
<HEAD>
<meta charset="UTF-8">
<title>Project.<init> - </title>
<link rel="stylesheet" href="../../style.css">
</HEAD>
<BODY>
<a href="../index.html">jetbrains.buildServer.configs.kotlin.v2017_2</a>&nbsp;/&nbsp;<a href="index.html">Project</a>&nbsp;/&nbsp;<a href="./-init-.html">&lt;init&gt;</a><br/>
<br/>
<h1>&lt;init&gt;</h1>
<a name="jetbrains.buildServer.configs.kotlin.v2017_2.Project$&lt;init&gt;(kotlin.Function1((jetbrains.buildServer.configs.kotlin.v2017_2.Project, kotlin.Unit)))"></a>
<code><span class="identifier">Project</span><span class="symbol">(</span><span class="identifier" id="jetbrains.buildServer.configs.kotlin.v2017_2.Project$<init>(kotlin.Function1((jetbrains.buildServer.configs.kotlin.v2017_2.Project, kotlin.Unit)))/init">init</span><span class="symbol">:</span>&nbsp;<a href="index.html"><span class="identifier">Project</span></a><span class="symbol">.</span><span class="symbol">(</span><span class="symbol">)</span>&nbsp;<span class="symbol">-&gt;</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a><span class="symbol">)</span></code>
<p>Creates a project and initializes it with the specified init block</p>
<h3>Parameters</h3>
<p><a name="init"></a>
<code>init</code> - initialization block</p>
<p><strong>See Also</strong><br/>
<p><a href="index.html">Project</a></p>
</p>
<a name="jetbrains.buildServer.configs.kotlin.v2017_2.Project$&lt;init&gt;()"></a>
<code><span class="identifier">Project</span><span class="symbol">(</span><span class="symbol">)</span></code>
<p>Represents TeamCity <a href="https://www.jetbrains.com/help/teamcity/?Project">project</a>.</p>
<p>The <a href="uuid.html">uuid</a>, <a href="id.html">id</a>, and <a href="name.html">name</a> are mandatory properties for a valid project.</p>
<p>The <a href="parent-id.html">parentId</a> property defines a place for this project in a <a href="https://www.jetbrains.com/help/teamcity/?Project#Project-ProjectHierarchy">project hierarchy</a>,
it should be empty for the <a href="https://www.jetbrains.com/help/teamcity/?Project#Project-RootProject">Root project</a> on the server, and non-empty for other projects.</p>
<p>To appear in UI project should be either registered via the <a href="../project.html">project</a> call in the .teamcity/{Project id}/settings.kts
or added as a subproject to a registered project via the <a href="sub-project.html">subProject()</a> method.</p>
<p>BuildTypes, templates, and vcsRoots can be registered in the project using the
<a href="build-type.html">buildType</a>, <a href="template.html">template</a>, and <a href="vcs-root.html">vcsRoot</a> methods accordingly. BuildTypes and subprojects
order can be specified via the <a href="build-types-order.html">buildTypesOrder</a> and <a href="sub-projects-order.html">subProjectsOrder</a> methods.</p>
<p>Project parameters are defined inside the <a href="params.html">params</a> block.</p>
<p>The <a href="https://www.jetbrains.com/help/teamcity/?Clean-Up#Clean-Up-ProjectClean-upRules">cleanup tab</a>
in the project admin UI contains clean-up rules for the project itself, its subprojects, and build
configurations. In DSL the <a href="cleanup.html">cleanup</a> block in the project defines the clean-up rules for the project itself,
subprojects and buildTypes can define their own clean-up rules or inherit them from the parent project(default).</p>
<p>Other tabs in the project admin UI are either not stored in VCS (e.g. SSH keys), or are defined as
project features in the <a href="features.html">features</a> block.</p>
<pre><code class="lang-kotlin">//A minimal valid project:
val parentProjectId = "ParentProjectId"
Project({
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99a"
parentId = parentProjectId
id = "Integration Tests".toId(parentProjectId)
name = "Integration Tests"
})</code></pre><pre><code class="lang-kotlin">//A project with build configurations:
val parentProjectId = "ParentProjectId"
val projectId = "Integration Tests".toId(parentProjectId)
val linux = BuildType().apply {
uuid = "fe255589-595a-4c2d-8c3f-6aa616441f9c"
id = "Linux".toId(projectId)
name = "Linux"
}
val windows = BuildType().apply {
uuid = "a8678e4d-5621-4ea5-8a3a-c9c46704e990"
id = "Windows".toId(projectId)
name = "Windows"
}
Project({
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99a"
parentId = parentProjectId
id = projectId
name = "Tests"
buildType(linux)
buildType(windows)
})</code></pre><pre><code class="lang-kotlin">//A project with subprojects:
val parentProjectId = "ParentProjectId"
val projectId = "Tests".toId(parentProjectId)
val subProject = Project({
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99b"
parentId = projectId
id = "Slow Tests".toId(projectId)
name = "Slow Tests"
})
Project({
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99a"
parentId = parentProjectId
id = projectId
name = "Tests"
subProject(subProject)
//add a subproject without defining it as a variable
subProject {
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99c"
parentId = projectId
id = "Fast Tests".toId(projectId)
name = "Fast Tests"
}
})</code></pre>
<p><strong>See Also</strong><br/>
<p><a href="../-build-type/index.html">BuildType</a></p>
<p><a href="../-template/index.html">Template</a></p>
<p><a href="../-vcs-root/index.html">VcsRoot</a></p>
</p>
</BODY>
</HTML>