Commit 2bad0eb9 authored by Sergey Karashevich's avatar Sergey Karashevich
Browse files

[gui-test] make gant build output same to project output

parent cf02611b
Showing with 17 additions and 7 deletions
+17 -7
......@@ -33,7 +33,7 @@ import java.util.function.BiFunction
*/
target("default": "Run tests") {
String home = IdeaProjectLoader.guessHome(this)
String outputDir = "$home/out/tests"
String outputDir = "$home/out"
def compilationOptions = new BuildOptions()
// compilationOptions.useCompiledClassesFromProjectOutput = true
......
......@@ -28,7 +28,16 @@ class BuildOptions {
* invoked on a developer machine). Pass 'true' to this system property to skip compilation step and use compiled classes from the project output instead.
*/
public static final String USE_COMPILED_CLASSES_PROPERTY = "intellij.build.use.compiled.classes"
/**
* Pass 'true' to this system property when building to default project output. This case may be useful when classpath building by JpsModel
* needed to be same on a developer's machine and remote (e.g. on TeamCity)
*/
public static final String BUILD_TO_PROJECT_OUTPUT_DIRECTORY = "intellij.build.use.project.out.dir"
boolean useCompiledClassesFromProjectOutput = SystemProperties.getBooleanProperty(USE_COMPILED_CLASSES_PROPERTY, false)
boolean useProjectOutputDirToBuild = SystemProperties.getBooleanProperty(BUILD_TO_PROJECT_OUTPUT_DIRECTORY, false)
/**
* Specifies for which operating systems distributions should be built.
......
......@@ -140,22 +140,23 @@ class CompilationContextImpl implements CompilationContext {
def classesDirName = "classes"
def classesOutput = "$paths.buildOutputRoot/$classesDirName"
def outputProjectDir = getProjectOutputDirectory()
List<String> outputDirectoriesToKeep = ["log"]
if (options.pathToCompiledClassesArchive != null) {
unpackCompiledClasses(messages, ant, classesOutput, options)
outputDirectoriesToKeep.add(classesDirName)
def unpackOutputDir = (options.useProjectOutputDirToBuild ? outputProjectDir.absolutePath : classesOutput) as String
unpackCompiledClasses(messages, ant, unpackOutputDir, options)
outputDirectoriesToKeep.addAll([classesOutput, outputProjectDir.name])
}
if (options.incrementalCompilation) {
outputDirectoriesToKeep.add(dataDirName)
outputDirectoriesToKeep.add(classesDirName)
}
if (!options.useCompiledClassesFromProjectOutput) {
if (!options.useCompiledClassesFromProjectOutput && !options.useProjectOutputDirToBuild) {
projectBuilder.targetFolder = classesOutput
}
else {
def outputDir = getProjectOutputDirectory()
if (!outputDir.exists()) {
messages.error("$BuildOptions.USE_COMPILED_CLASSES_PROPERTY is enabled, but the project output directory $outputDir.absolutePath doesn't exist")
if (!outputProjectDir.exists()) {
messages.error("$BuildOptions.USE_COMPILED_CLASSES_PROPERTY is enabled, but the project output directory $outputProjectDir.absolutePath doesn't exist")
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment