mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
build scripts: projectOutputDirectory renamed to classesOutputDirectory for clarity
GitOrigin-RevId: b8b64a4d650e623a27e44b1af6403e69830f1fe0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0484ec125c
commit
265bd0dd59
@@ -22,8 +22,8 @@ class IdeaCommunityBuildTest {
|
||||
communityHomePath = communityHomePath,
|
||||
productProperties = IdeaCommunityProperties(communityHomePath.communityRoot),
|
||||
) {
|
||||
it.projectClassesOutputDirectory = System.getProperty(BuildOptions.PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY)
|
||||
?: "$homePath/out/classes"
|
||||
it.classesOutputDirectory = System.getProperty(BuildOptions.PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY)
|
||||
?: "$homePath/out/classes"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class BuildOptions {
|
||||
/**
|
||||
* Use this property to change the project compiled classes output directory.
|
||||
*
|
||||
* @see [org.jetbrains.intellij.build.impl.CompilationContextImpl.projectOutputDirectory]
|
||||
* @see [org.jetbrains.intellij.build.impl.CompilationContextImpl.classesOutputDirectory]
|
||||
*/
|
||||
const val PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY = "intellij.project.classes.output.directory"
|
||||
const val OS_LINUX = "linux"
|
||||
@@ -145,7 +145,7 @@ class BuildOptions {
|
||||
* If `true` compilation step is skipped and compiled classes from the project output are used instead.
|
||||
* True if [BuildOptions.isInDevelopmentMode] is enabled.
|
||||
*
|
||||
* @see [org.jetbrains.intellij.build.impl.CompilationContextImpl.projectOutputDirectory]
|
||||
* @see [org.jetbrains.intellij.build.impl.CompilationContextImpl.classesOutputDirectory]
|
||||
*/
|
||||
const val USE_COMPILED_CLASSES_PROPERTY = "intellij.build.use.compiled.classes"
|
||||
|
||||
@@ -175,7 +175,7 @@ class BuildOptions {
|
||||
const val TARGET_OS_PROPERTY = "intellij.build.target.os"
|
||||
}
|
||||
|
||||
var projectClassesOutputDirectory: String? = System.getProperty(PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY)
|
||||
var classesOutputDirectory: String? = System.getProperty(PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY)
|
||||
|
||||
/**
|
||||
* Specifies for which operating systems distributions should be built.
|
||||
|
||||
@@ -37,7 +37,7 @@ interface CompilationContext {
|
||||
/**
|
||||
* @return directory with compiled project classes, 'url' attribute value of 'output' tag from .idea/misc.xml by default
|
||||
*/
|
||||
val projectOutputDirectory: Path
|
||||
val classesOutputDirectory: Path
|
||||
|
||||
fun findRequiredModule(name: String): JpsModule
|
||||
|
||||
|
||||
@@ -172,8 +172,8 @@ class BuildContextImpl private constructor(
|
||||
get() = compilationContext.stableJavaExecutable
|
||||
override val stableJdkHome: Path
|
||||
get() = compilationContext.stableJdkHome
|
||||
override val projectOutputDirectory: Path
|
||||
get() = compilationContext.projectOutputDirectory
|
||||
override val classesOutputDirectory: Path
|
||||
get() = compilationContext.classesOutputDirectory
|
||||
|
||||
override fun findRequiredModule(name: String): JpsModule {
|
||||
return compilationContext.findRequiredModule(name)
|
||||
|
||||
+10
-11
@@ -27,7 +27,6 @@ import org.jetbrains.intellij.build.impl.logging.BuildMessagesHandler
|
||||
import org.jetbrains.intellij.build.impl.logging.BuildMessagesImpl
|
||||
import org.jetbrains.intellij.build.kotlin.KotlinBinaries
|
||||
import org.jetbrains.jps.model.*
|
||||
import org.jetbrains.jps.model.artifact.JpsArtifact
|
||||
import org.jetbrains.jps.model.artifact.JpsArtifactService
|
||||
import org.jetbrains.jps.model.java.JpsJavaClasspathKind
|
||||
import org.jetbrains.jps.model.java.JpsJavaExtensionService
|
||||
@@ -98,7 +97,7 @@ class CompilationContextImpl private constructor(model: JpsModel,
|
||||
categoriesWithDebugLevelNullable = System.getProperty("intellij.build.debug.logging.categories", "")
|
||||
)
|
||||
}
|
||||
overrideProjectOutputDirectory()
|
||||
overrideClassesOutputDirectory()
|
||||
JpsArtifactService.getInstance().getArtifacts(project).forEach {
|
||||
it.outputPath = "${paths.jpsArtifacts.resolve(PathUtilRt.getFileName(it.outputPath))}"
|
||||
}
|
||||
@@ -108,19 +107,19 @@ class CompilationContextImpl private constructor(model: JpsModel,
|
||||
cleanOutput(keepCompilationState = CompiledClasses.keepCompilationState(options))
|
||||
}
|
||||
|
||||
private fun overrideProjectOutputDirectory() {
|
||||
val override = options.projectClassesOutputDirectory
|
||||
private fun overrideClassesOutputDirectory() {
|
||||
val override = options.classesOutputDirectory
|
||||
when {
|
||||
!override.isNullOrEmpty() -> projectOutputDirectory = Path.of(override)
|
||||
options.useCompiledClassesFromProjectOutput -> require(Files.exists(projectOutputDirectory)) {
|
||||
"${BuildOptions.USE_COMPILED_CLASSES_PROPERTY} is enabled but the project output directory $projectOutputDirectory doesn't exist"
|
||||
!override.isNullOrEmpty() -> classesOutputDirectory = Path.of(override)
|
||||
options.useCompiledClassesFromProjectOutput -> require(Files.exists(classesOutputDirectory)) {
|
||||
"${BuildOptions.USE_COMPILED_CLASSES_PROPERTY} is enabled but the classes output directory $classesOutputDirectory doesn't exist"
|
||||
}
|
||||
else -> projectOutputDirectory = paths.buildOutputDir.resolve("classes")
|
||||
else -> classesOutputDirectory = paths.buildOutputDir.resolve("classes")
|
||||
}
|
||||
Span.current().addEvent("project output directory is $projectOutputDirectory")
|
||||
Span.current().addEvent("classes output directory is $classesOutputDirectory")
|
||||
}
|
||||
|
||||
override var projectOutputDirectory: Path
|
||||
override var classesOutputDirectory: Path
|
||||
get() {
|
||||
val url = JpsJavaExtensionService.getInstance().getOrCreateProjectExtension(project).outputUrl
|
||||
return JpsPathUtil.urlToFile(url).toPath()
|
||||
@@ -384,7 +383,7 @@ private fun CompilationContext.cleanOutput(keepCompilationState: Boolean) {
|
||||
Files.newDirectoryStream(outDir).use { dirStream ->
|
||||
for (file in dirStream) {
|
||||
val attributes = Attributes.of(AttributeKey.stringKey("dir"), outDir.relativize(file).toString())
|
||||
if (outputDirectoriesToKeep.contains(file.fileName.toString())) {
|
||||
if (outputDirectoriesToKeep.contains(file.name)) {
|
||||
span.addEvent("skip cleaning", attributes)
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -418,7 +418,7 @@ internal class TestingTasksImpl(private val context: CompilationContext, private
|
||||
"idea.system.path" to "${tempDir}/system",
|
||||
"intellij.build.compiled.classes.archives.metadata" to System.getProperty("intellij.build.compiled.classes.archives.metadata"),
|
||||
"intellij.build.compiled.classes.archive" to System.getProperty("intellij.build.compiled.classes.archive"),
|
||||
BuildOptions.PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY to "${context.projectOutputDirectory}",
|
||||
BuildOptions.PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY to "${context.classesOutputDirectory}",
|
||||
"idea.coverage.enabled.build" to System.getProperty("idea.coverage.enabled.build"),
|
||||
"teamcity.buildConfName" to System.getProperty("teamcity.buildConfName"),
|
||||
"java.io.tmpdir" to tempDir,
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ fun packCompilationResult(context: CompilationContext, zipDir: Path, addDirEntri
|
||||
val items = ArrayList<PackAndUploadItem>(2048)
|
||||
spanBuilder("compute module list to pack").use { span ->
|
||||
// production, test
|
||||
for (subRoot in Files.newDirectoryStream(context.projectOutputDirectory).use(DirectoryStream<Path>::toList)) {
|
||||
for (subRoot in Files.newDirectoryStream(context.classesOutputDirectory).use(DirectoryStream<Path>::toList)) {
|
||||
if (!Files.isDirectory(subRoot)) {
|
||||
continue
|
||||
}
|
||||
|
||||
+4
-4
@@ -77,9 +77,9 @@ internal object CompiledClasses {
|
||||
val messages = context.messages
|
||||
when {
|
||||
context.options.useCompiledClassesFromProjectOutput -> {
|
||||
messages.info("Compilation skipped, the compiled classes from '${context.projectOutputDirectory}' will be used")
|
||||
messages.info("Compilation skipped, the compiled classes from '${context.classesOutputDirectory}' will be used")
|
||||
Span.current().addEvent("compiled classes reused", Attributes.of(
|
||||
AttributeKey.stringKey("dir"), context.projectOutputDirectory.toString(),
|
||||
AttributeKey.stringKey("dir"), context.classesOutputDirectory.toString(),
|
||||
))
|
||||
}
|
||||
PortableCompilationCache.IS_ENABLED -> {
|
||||
@@ -88,7 +88,7 @@ internal object CompiledClasses {
|
||||
}
|
||||
context.options.pathToCompiledClassesArchive != null -> {
|
||||
messages.info("Compilation skipped, the compiled classes from '${options.pathToCompiledClassesArchive}' will be used")
|
||||
unpackCompiledClasses(context.projectOutputDirectory, context)
|
||||
unpackCompiledClasses(context.classesOutputDirectory, context)
|
||||
}
|
||||
context.options.pathToCompiledClassesArchivesMetadata != null -> {
|
||||
messages.info("Compilation skipped, the compiled classes from '${options.pathToCompiledClassesArchivesMetadata}' will be used")
|
||||
@@ -96,7 +96,7 @@ internal object CompiledClasses {
|
||||
fetchAndUnpackCompiledClasses(
|
||||
reportStatisticValue = context.messages::reportStatisticValue,
|
||||
withScope = { name, operation -> context.messages.block(name, operation) },
|
||||
classOutput = context.projectOutputDirectory,
|
||||
classOutput = context.classesOutputDirectory,
|
||||
metadataFile = Path.of(context.options.pathToCompiledClassesArchivesMetadata!!),
|
||||
saveHash = !forInstallers,
|
||||
)
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ class PortableCompilationCache(private val context: CompilationContext) {
|
||||
}
|
||||
|
||||
private fun clean() {
|
||||
for (it in listOf(jpsCaches.dir, context.projectOutputDirectory)) {
|
||||
for (it in listOf(jpsCaches.dir, context.classesOutputDirectory)) {
|
||||
context.messages.info("Cleaning $it")
|
||||
NioFiles.deleteRecursively(it)
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@ class PyCharmCommunityBuildTest {
|
||||
communityHomePath = communityHomePath,
|
||||
productProperties = PyCharmCommunityProperties(communityHomePath.communityRoot),
|
||||
) {
|
||||
it.projectClassesOutputDirectory = System.getProperty(BuildOptions.PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY)
|
||||
?: "$homePath/out/classes"
|
||||
it.classesOutputDirectory = System.getProperty(BuildOptions.PROJECT_CLASSES_OUTPUT_DIRECTORY_PROPERTY)
|
||||
?: "$homePath/out/classes"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user