mirror of
https://github.com/apple/pkl.git
synced 2026-06-10 15:52:50 +02:00
Enable Gradle configuration cache (#1646)
Enable the configuration cache feature in Gradle, and adjust various pieces of build logic that aren't configuration cache compatible.
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.OutputStream
|
||||
import org.gradle.kotlin.dsl.support.serviceOf
|
||||
|
||||
@@ -118,9 +117,15 @@ private fun setupJavaExecutableRun(
|
||||
null -> "java"
|
||||
else -> launcher.get().executablePath.asFile.absolutePath
|
||||
}
|
||||
standardOutput = OutputStream.nullOutputStream()
|
||||
|
||||
args("-jar", tasks.javaExecutable.get().outputs.files.singleFile.toString(), *args)
|
||||
doFirst { standardOutput = OutputStream.nullOutputStream() }
|
||||
|
||||
val javaExecutableFile = tasks.javaExecutable.map { it.outputs.files.singleFile }
|
||||
argumentProviders.add(
|
||||
CommandLineArgumentProvider {
|
||||
listOf("-jar", javaExecutableFile.get().absolutePath) + args.toList()
|
||||
}
|
||||
)
|
||||
|
||||
doFirst { outputFile.get().asFile.delete() }
|
||||
|
||||
@@ -133,7 +138,10 @@ val evalTestFlags = arrayOf("eval", "-x", "1 + 1", "pkl:base")
|
||||
|
||||
fun Exec.useRootDirAndSuppressOutput() {
|
||||
workingDir = rootProject.layout.projectDirectory.asFile
|
||||
standardOutput = ByteArrayOutputStream() // we only care that this exec doesn't fail
|
||||
doFirst {
|
||||
// we only care that this exec doesn't fail
|
||||
standardOutput = OutputStream.nullOutputStream()
|
||||
}
|
||||
}
|
||||
|
||||
// 0.28 Preparing for JDK21 toolchains revealed that `testStartJavaExecutable` may pass, even though
|
||||
|
||||
Reference in New Issue
Block a user