forked from JetBrains/intellij-community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpenSourceCommunityInstallersBuildTarget.kt
32 lines (30 loc) · 1.47 KB
/
OpenSourceCommunityInstallersBuildTarget.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
import com.intellij.platform.diagnostic.telemetry.helpers.useWithScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import org.jetbrains.intellij.build.BuildOptions
import org.jetbrains.intellij.build.CompilationTasks
import org.jetbrains.intellij.build.TraceManager.spanBuilder
import org.jetbrains.intellij.build.buildCommunityStandaloneJpsBuilder
import org.jetbrains.intellij.build.createCommunityBuildContext
import org.jetbrains.intellij.build.impl.buildDistributions
internal object OpenSourceCommunityInstallersBuildTarget {
@JvmStatic
fun main(args: Array<String>) {
val options = BuildOptions().apply {
// do not bother external users about clean/incremental
// just remove out/ directory for clean build
incrementalCompilation = true
useCompiledClassesFromProjectOutput = false
buildStepsToSkip += BuildOptions.MAC_SIGN_STEP
}
runBlocking(Dispatchers.Default) {
val context = createCommunityBuildContext(options)
CompilationTasks.create(context).compileModules(moduleNames = null, includingTestsInModules = listOf("intellij.platform.jps.build.tests"))
buildDistributions(context)
spanBuilder("build standalone JPS").useWithScope {
buildCommunityStandaloneJpsBuilder(targetDir = context.paths.artifactDir.resolve("jps"), context = context)
}
}
}
}