Hopefully fixed concurrent compilation issue (#82)

* Hopefully fixed concurrent compilation issue

* Removed contracts helper dependency

* Turned runRootMakefileCommand into a function rather than an extension
This commit is contained in:
Roman Vaseev
2024-09-23 16:07:47 +02:00
committed by GitHub
parent 31f87f6f5b
commit 0458dcfc89
6 changed files with 14 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ import java.time.Duration
import java.time.Instant
plugins {
id 'net.consensys.zkevm.linea-contracts-helper'
alias(libs.plugins.spotless)
alias(libs.plugins.docker)
}

View File

@@ -1,16 +1,18 @@
import java.util.concurrent.TimeUnit
if (!rootProject.tasks.getNames().contains("compileContracts")) {
rootProject.tasks.register("compileContracts") {
description = "Compiles contracts."
inputs.dir("$rootDir/contracts/contracts")
outputs.cacheIf { true }
tasks.register('compileContracts') {
description = "Compiles contracts."
inputs.dir("$rootDir/contracts")
outputs.cacheIf { true }
doLast {
runRootMakefileCommand("compile-contracts", Map.of())
doLast {
runRootMakefileCommand("compile-contracts", Map.of())
}
}
}
ext.runRootMakefileCommand = { String command, Map<String, String> env ->
def runRootMakefileCommand(String command, Map<String, String> env) {
def randomSuffix = UUID.randomUUID().toString()
File outputFile = file("${command.replace(" ", "-")}-run-output-${randomSuffix}.txt")
def deploymentProcessBuilder = new ProcessBuilder("make", "-C", project.rootDir.path, command)

View File

@@ -3,7 +3,6 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
id 'net.consensys.zkevm.linea-contracts-helper'
}
dependencies {
@@ -62,7 +61,7 @@ task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
dependsOn(":localStackComposeUp")
dependsOn(compileContracts)
dependsOn(rootProject.tasks.compileContracts)
testLogging {
events TestLogEvent.FAILED,

View File

@@ -1,6 +1,5 @@
plugins {
id "net.consensys.zkevm.kotlin-library-conventions"
id 'net.consensys.zkevm.linea-contracts-helper'
}
dependencies {
@@ -42,7 +41,7 @@ task integrationTest(type: Test) {
classpath = sourceSets.integrationTest.runtimeClasspath
testClassesDirs = sourceSets.integrationTest.output.classesDirs
dependsOn(":localStackComposeUp")
dependsOn(compileContracts)
dependsOn(rootProject.tasks.compileContracts)
}

View File

@@ -1,6 +1,5 @@
plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
id 'net.consensys.zkevm.linea-contracts-helper'
}
dependencies {
@@ -44,5 +43,5 @@ task integrationTest(type: Test) {
classpath = sourceSets.integrationTest.runtimeClasspath
testClassesDirs = sourceSets.integrationTest.output.classesDirs
dependsOn(":localStackComposeUp")
dependsOn(compileContracts)
dependsOn(rootProject.tasks.compileContracts)
}

View File

@@ -3,7 +3,6 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
id 'net.consensys.zkevm.linea-contracts-helper'
}
dependencies {
@@ -42,7 +41,7 @@ task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
dependsOn(":localStackComposeUp")
dependsOn(compileContracts)
dependsOn(rootProject.tasks.compileContracts)
testLogging {
events TestLogEvent.FAILED,
TestLogEvent.SKIPPED,