crusade-tracker/system/caches/pluginsDslCache/doc/jetbrains.build-server.configs.kotlin.v10/-project/-init-.html
2021-01-18 15:27:50 -05:00

110 lines
6.1 KiB
HTML

<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.v10</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.v10.Project$&lt;init&gt;(kotlin.Function1((jetbrains.buildServer.configs.kotlin.v10.Project, kotlin.Unit)), jetbrains.buildServer.configs.kotlin.v10.Project)"></a>
<code><span class="identifier">Project</span><span class="symbol">(</span><span class="identifier" id="jetbrains.buildServer.configs.kotlin.v10.Project$<init>(kotlin.Function1((jetbrains.buildServer.configs.kotlin.v10.Project, kotlin.Unit)), jetbrains.buildServer.configs.kotlin.v10.Project)/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>&nbsp;<span class="symbol">=</span>&nbsp;{}<span class="symbol">, </span><span class="identifier" id="jetbrains.buildServer.configs.kotlin.v10.Project$<init>(kotlin.Function1((jetbrains.buildServer.configs.kotlin.v10.Project, kotlin.Unit)), jetbrains.buildServer.configs.kotlin.v10.Project)/base">base</span><span class="symbol">:</span>&nbsp;<a href="index.html"><span class="identifier">Project</span></a><span class="symbol">?</span>&nbsp;<span class="symbol">=</span>&nbsp;null<span class="symbol">)</span></code>
<p>Creates a new project. Copies all settings from the specified
base (if it is not null) and runs the init function on the created
instance.</p>
<h3>Parameters</h3>
<p><a name="init"></a>
<code>init</code> - function to initialize the created project</p>
<p><a name="base"></a>
<code>base</code> - base object to copy settings from</p>
<p><strong>See Also</strong><br/>
<p><a href="index.html">Project</a></p>
</p>
<a name="jetbrains.buildServer.configs.kotlin.v10.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="ext-id.html">extId</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/{ProjectExtId}/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>, <a href="build-types-order-ext-ids.html">buildTypesOrderExtIds</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 project itself,
subprojects and buildTypes define their clean-up rules.</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 parentExtId = "ParentProjectExtId"
Project({
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99a"
parentId = parentExtId
extId = "Integration Tests".toExtId(parentExtId)
name = "Integration Tests"
})</code></pre><pre><code class="lang-kotlin">//A project with build configurations:
val parentProjectExtId = "ParentProjectExtId"
val projectExtId = "Integration Tests".toExtId(parentProjectExtId)
val linux = BuildType({
uuid = "fe255589-595a-4c2d-8c3f-6aa616441f9c"
extId = "Linux".toExtId(projectExtId)
name = "Linux"
})
val windows = BuildType({
uuid = "a8678e4d-5621-4ea5-8a3a-c9c46704e990"
extId = "Windows".toExtId(projectExtId)
name = "Windows"
})
Project({
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99a"
parentId = parentProjectExtId
extId = projectExtId
name = "Tests"
buildType(linux)
buildType(windows)
})</code></pre><pre><code class="lang-kotlin">//A project with subprojects:
val parentExtId = "ParentProjectExtId"
val projectExtId = "Tests".toExtId(parentExtId)
val subProject = Project({
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99b"
parentId = projectExtId
extId = "Slow Tests".toExtId(projectExtId)
name = "Slow Tests"
})
Project({
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99a"
parentId = parentExtId
extId = projectExtId
name = "Tests"
subProject(subProject)
//add a subproject without defining it as a variable
subProject {
uuid = "3dd8b78d-e71c-4065-8ce7-09d6d154c99c"
parentId = projectExtId
extId = "Fast Tests".toExtId(projectExtId)
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>