Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove toolkit_go dir #170

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions core/go/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ task copyContracts(dependsOn:[

task protoc(type: ProtoCompile, dependsOn: [
":toolkit:go:protoc",
tasks.installTools,
tasks.copyTestContracts,
installTools,
copyTestContracts,
]) {
protocPath "bin"
protoPath projectDir
Expand All @@ -149,7 +149,7 @@ task protoc(type: ProtoCompile, dependsOn: [
}
}

task goGet(type:Exec, dependsOn:[tasks.protoc,tasks.copyContracts,":toolkit:go:goGet"]) {
task goGet(type:Exec, dependsOn:[protoc,copyContracts,":toolkit:go:goGet"]) {
workingDir '.'

inputs.files('go.mod')
Expand All @@ -160,7 +160,7 @@ task goGet(type:Exec, dependsOn:[tasks.protoc,tasks.copyContracts,":toolkit:go:g
args 'get'
}

task makeMocks(type: Mockery, dependsOn: [tasks.installTools, tasks.protoc, tasks.goGet]) {
task makeMocks(type: Mockery, dependsOn: [installTools, protoc, goGet]) {
mockery 'bin/mockery'
args '--case', 'underscore'
mock {
Expand Down Expand Up @@ -239,7 +239,7 @@ task clean(type: Delete, dependsOn: ':testinfra:stopTestInfra') {
delete 'componenttest/abis'
}

task lint(type: Exec, dependsOn:[tasks.protoc,tasks.makeMocks,tasks.copyContracts]) {
task lint(type: Exec, dependsOn:[protoc,makeMocks,copyContracts]) {
workingDir '.'

helpers.lockResource(it, "lint.lock")
Expand All @@ -253,7 +253,7 @@ task lint(type: Exec, dependsOn:[tasks.protoc,tasks.makeMocks,tasks.copyContract
args '--timeout', '5m'
}

task buildSharedLibrary(type:Exec, dependsOn:[tasks.goGet, tasks.makeMocks]) {
task buildSharedLibrary(type:Exec, dependsOn:[goGet, makeMocks]) {
workingDir '.'

def libName
Expand All @@ -277,7 +277,7 @@ task buildSharedLibrary(type:Exec, dependsOn:[tasks.goGet, tasks.makeMocks]) {
args 'core.go'
}

task buildTestbed(type:Exec, dependsOn: [tasks.goGet, tasks.makeMocks, tasks.copyContracts]) {
task buildTestbed(type:Exec, dependsOn: [goGet, makeMocks, copyContracts]) {
workingDir '.'

inputs.files(goFiles)
Expand Down Expand Up @@ -320,7 +320,7 @@ task buildTestPluginsSharedLibraryGRPCTransport(type:Exec) {
}

task buildTestPluginsSharedLibraries {
dependsOn tasks.buildTestPluginsSharedLibraryGRPCTransport
dependsOn buildTestPluginsSharedLibraryGRPCTransport
}

abstract class UnitTests extends Exec {
Expand Down Expand Up @@ -361,7 +361,7 @@ abstract class ComponentTest extends Exec {
}
}

task setupCoverage(dependsOn: [tasks.protoc, tasks.copyContracts, tasks.makeMocks]) {
task setupCoverage(dependsOn: [protoc, copyContracts, makeMocks]) {
inputs.files(goFiles)
outputs.dir('coverage')
doLast {
Expand Down Expand Up @@ -391,19 +391,19 @@ task unitTestPostgres(type: UnitTests, dependsOn: [

task componentTestSQLite(type: ComponentTest, dependsOn: [
':testinfra:startTestInfra',
tasks.setupCoverage,
tasks.goGet,
tasks.copyContracts,
setupCoverage,
goGet,
copyContracts,
]) {
mustRunAfter 'unitTestPostgres' // these tests cannot run concurrently
}

task buildCoverageTxt(type: Exec, dependsOn: [
tasks.protoc,
tasks.unitTestSQLite,
tasks.unitTestPostgres,
tasks.componentTestSQLite,
// tasks.componentTestPostgres
protoc,
unitTestSQLite,
unitTestPostgres,
componentTestSQLite,
// componentTestPostgres
]) {
inputs.files(fileTree(project.mkdir('coverage')) {
include "covcounters.*"
Expand Down Expand Up @@ -446,10 +446,8 @@ task testcov(type: Exec, dependsOn: [test, aggregateCoverage]) {
}

task build {
dependsOn tasks.lint
dependsOn tasks.test
dependsOn tasks.aggregateCoverage
dependsOn tasks.checkCoverage
dependsOn lint
dependsOn test
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions testinfra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ task besuBootstrapTool(type: Exec) {
args "."
}

task startTestInfra(type: DockerCompose, dependsOn: tasks.besuBootstrapTool) {
task startTestInfra(type: DockerCompose, dependsOn: besuBootstrapTool) {
composeFile 'docker-compose-test.yml'
projectName 'paladin-testinfra'
args 'up', '-d', '--wait', '--wait-timeout', 60
Expand All @@ -41,7 +41,7 @@ task removeBesuBootstrapTool(type: Exec, dependsOn: stopTestInfra) {
ignoreExitValue true
}

task clean(type: Delete, dependsOn: [tasks.removeBesuBootstrapTool, tasks.stopTestInfra]) {
task clean(type: Delete, dependsOn: [removeBesuBootstrapTool, stopTestInfra]) {

}

27 changes: 14 additions & 13 deletions toolkit/go/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ task clean(type: Delete, dependsOn: ':testinfra:stopTestInfra') {
delete 'componenttest/abis'
}

task goGet(type:Exec, dependsOn:tasks.protoc) {
task goGet(type:Exec, dependsOn:protoc) {
workingDir '.'

inputs.files('go.mod')
Expand All @@ -122,7 +122,7 @@ task goGet(type:Exec, dependsOn:tasks.protoc) {
args './pkg/...'
}

task lint(type: Exec, dependsOn:tasks.protoc) {
task lint(type: Exec, dependsOn:protoc) {
workingDir '.'

helpers.lockResource(it, "lint.lock")
Expand All @@ -136,7 +136,7 @@ task lint(type: Exec, dependsOn:tasks.protoc) {
args '--timeout', '5m'
}

task test(type: Exec, dependsOn: [tasks.goGet]) {
task test(type: Exec, dependsOn: [goGet]) {
inputs.files(getProject().goFiles)
outputs.dir('coverage')

Expand All @@ -148,12 +148,13 @@ task test(type: Exec, dependsOn: [tasks.goGet]) {
args '-covermode=atomic'
args '-timeout=30s'
args "-test.gocoverdir=${getProject().projectDir}/coverage"

}

task buildCoverageTxt(type: Exec, dependsOn: [
tasks.protoc,
tasks.lint,
tasks.test,
protoc,
lint,
test,
]) {
inputs.files(fileTree(project.mkdir('coverage')) {
include "covcounters.*"
Expand All @@ -167,7 +168,7 @@ task buildCoverageTxt(type: Exec, dependsOn: [

}

task aggregateCoverage(type: Copy, dependsOn: tasks.buildCoverageTxt) {
task aggregateCoverage(type: Copy, dependsOn: buildCoverageTxt) {
from 'coverage/coverage_unfiltered.txt'
into 'coverage'
outputs.files('coverage/coverage.txt')
Expand All @@ -177,13 +178,13 @@ task aggregateCoverage(type: Copy, dependsOn: tasks.buildCoverageTxt) {
filter(LineContains, negate: true, contains: getProject().ext.coverageExcludedPackages, matchAny: true)
}

task checkCoverage(type: GoCheckCoverage, dependsOn: [tasks.aggregateCoverage]) {
task checkCoverage(type: GoCheckCoverage, dependsOn: [aggregateCoverage]) {
coverageFile('coverage/coverage.txt')
target = targetCoverage
maxGap = maxCoverageBarGap
}

task buildStarterLibrary(type:Exec, dependsOn:[tasks.goGet]) {
task buildStarterLibrary(type:Exec, dependsOn:[goGet]) {
workingDir '.'

def libName;
Expand All @@ -208,10 +209,10 @@ task buildStarterLibrary(type:Exec, dependsOn:[tasks.goGet]) {
}

task build {
dependsOn tasks.lint
dependsOn tasks.test
dependsOn tasks.checkCoverage
dependsOn tasks.buildStarterLibrary
dependsOn lint
dependsOn test
dependsOn checkCoverage
dependsOn buildStarterLibrary
}

dependencies {
Expand Down
Loading
Loading