Skip to content

Commit

Permalink
Hopefully fixed concurrent compilation issue (#82)
Browse files Browse the repository at this point in the history
* Hopefully fixed concurrent compilation issue

* Removed contracts helper dependency

* Turned runRootMakefileCommand into a function rather than an extension
  • Loading branch information
Filter94 authored Sep 23, 2024
1 parent 31f87f6 commit 0458dcf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 1 addition & 2 deletions coordinator/ethereum/blob-submitter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions coordinator/ethereum/gas-pricing/static-cap/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "net.consensys.zkevm.kotlin-library-conventions"
id 'net.consensys.zkevm.linea-contracts-helper'
}

dependencies {
Expand Down Expand Up @@ -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)
}


Expand Down
3 changes: 1 addition & 2 deletions coordinator/ethereum/message-anchoring/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
id 'net.consensys.zkevm.linea-contracts-helper'
}

dependencies {
Expand Down Expand Up @@ -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)
}
3 changes: 1 addition & 2 deletions coordinator/ethereum/test-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0458dcf

Please sign in to comment.