tests: Allow setting konan.jvmArgs in gradle plugin tests
This commit is contained in:
@@ -79,6 +79,9 @@ test {
|
|||||||
dependsOn ':dist'
|
dependsOn ':dist'
|
||||||
systemProperty("konan.home", distDir.absolutePath)
|
systemProperty("konan.home", distDir.absolutePath)
|
||||||
}
|
}
|
||||||
|
if (project.hasProperty("konan.jvmArgs")) {
|
||||||
|
systemProperty("konan.jvmArgs", project.property("konan.jvmArgs"))
|
||||||
|
}
|
||||||
// Uncomment for debugging.
|
// Uncomment for debugging.
|
||||||
//testLogging.showStandardStreams = true
|
//testLogging.showStandardStreams = true
|
||||||
if (project.hasProperty("maxParallelForks")) {
|
if (project.hasProperty("maxParallelForks")) {
|
||||||
|
|||||||
+9
-5
@@ -39,8 +39,8 @@ class KonanProject {
|
|||||||
Set<File> srcFiles = []
|
Set<File> srcFiles = []
|
||||||
Set<File> defFiles = []
|
Set<File> defFiles = []
|
||||||
|
|
||||||
List<String> interopTasks = []
|
List<String> interopTasks = []
|
||||||
List<String> compilationTasks = []
|
List<String> compilationTasks = []
|
||||||
String downloadTask = ":checkKonanCompiler"
|
String downloadTask = ":checkKonanCompiler"
|
||||||
|
|
||||||
List<String> targets
|
List<String> targets
|
||||||
@@ -193,9 +193,13 @@ class KonanProject {
|
|||||||
return generateDefFile(fileName, DEFAULT_DEF_CONTENT)
|
return generateDefFile(fileName, DEFAULT_DEF_CONTENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generates gradle.properties file with the konan.home property set. */
|
/** Generates gradle.properties file with the konan.home and konan.jvmArgs properties set. */
|
||||||
File generatePropertiesFile(String konanHome) {
|
File generatePropertiesFile(String konanHome, String konanJvmArgs = System.getProperty("konan.jvmArgs") ?: "") {
|
||||||
propertiesFile = createFile(projectPath, "gradle.properties", "konan.home=$konanHome\n")
|
propertiesFile = createFile(projectPath, "gradle.properties", """\
|
||||||
|
konan.home=$konanHome
|
||||||
|
${!konanJvmArgs.isEmpty() ? "konan.jvmArgs=$konanJvmArgs\n" : ""}
|
||||||
|
""".stripIndent())
|
||||||
|
println(propertiesFile.text)
|
||||||
return propertiesFile
|
return propertiesFile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user