| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE |
| * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file |
| * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the |
| * License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
| * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations under the License. |
| */ |
| plugins { id 'com.bmuschko.docker-remote-api' version '3.2.3' } |
| |
| description = 'Tuweni distribution.' |
| |
| apply plugin: 'distribution' |
| |
| jar { enabled = false } |
| |
| static def mandatoryFiles(CopySpec spec) { |
| spec.into('') { |
| from ".." |
| include 'DISCLAIMER' |
| include 'LICENSE' |
| include 'NOTICE' |
| } |
| spec.into('licenses') { from '../build/reports/license' } |
| } |
| |
| distributions { |
| main { |
| baseName = 'tuweni-bin' |
| contents { |
| mandatoryFiles(it) |
| into('') { |
| from ".." |
| include 'README.md' |
| } |
| def docs = [] |
| def libs = [] |
| def sources = [] |
| rootProject.subprojects.each { s -> |
| if (s.name != 'eth-reference-tests' && s.name != 'dist') { |
| libs << s.signArchives.signatureFiles[0] |
| sources << s.signArchives.signatureFiles[1] |
| docs << s.signArchives.signatureFiles[2] |
| libs << s.jar.outputs |
| sources << s.sourcesJar.outputs |
| docs << s.dokkaJar.outputs |
| } |
| } |
| into('lib') { |
| from rootProject.jar |
| from rootProject.signArchives.signatureFiles[0] |
| from libs |
| } |
| into('docs') { |
| from rootProject.dokkaJar |
| from rootProject.signArchives.signatureFiles[2] |
| from docs |
| } |
| into('site') { |
| from rootProject.dokka.outputDirectory |
| from rootProject.javadoc.outputDirectory |
| } |
| } |
| } |
| sources { |
| baseName = 'tuweni-src' |
| contents { |
| mandatoryFiles(it) |
| into('') { |
| from ".." |
| include 'README.md' |
| include '*.md' |
| include '*.gradle' |
| include 'dependency-versions.gradle' |
| include 'gradle/resources/*' |
| include 'gradle/*' |
| include 'gradle.properties' |
| } |
| rootProject.subprojects.each { |
| include it.projectDir.name + '/src/**' |
| include it.projectDir.name + '/build.gradle' |
| } |
| } |
| } |
| gossip { |
| baseName = 'tuweni-gossip' |
| contents { |
| mandatoryFiles(it) |
| into('') { |
| from ".." |
| include 'gossip/README.md' |
| } |
| into('bin') { |
| from { project(':gossip').startScripts.outputs.files } |
| fileMode = 0755 |
| } |
| into('lib') { |
| def libs = [] |
| libs << project(':gossip').configurations.runtime |
| from libs |
| from project(':gossip').jar |
| } |
| } |
| } |
| relayer { |
| baseName = 'tuweni-relayer' |
| contents { |
| mandatoryFiles(it) |
| into('') { |
| from ".." |
| include 'hobbits-relayer/README.md' |
| } |
| into('bin') { |
| from { project(':hobbits-relayer').startScripts.outputs.files } |
| fileMode = 0755 |
| } |
| into('lib') { |
| def libs = [] |
| libs << project(':hobbits-relayer').configurations.runtime |
| from libs |
| from project(':hobbits-relayer').jar |
| } |
| } |
| } |
| } |
| |
| import org.gradle.crypto.checksum.Checksum |
| |
| distTar{ compression = Compression.GZIP } |
| |
| sourcesDistTar{ compression = Compression.GZIP } |
| |
| gossipDistTar{ compression = Compression.GZIP } |
| |
| relayerDistTar{ compression = Compression.GZIP } |
| |
| if (System.getenv('ENABLE_SIGNING') == 'true') { |
| signing { |
| useGpgCmd() |
| sign distZip |
| sign distTar |
| sign sourcesDistZip |
| sign sourcesDistTar |
| sign gossipDistZip |
| sign gossipDistTar |
| sign relayerDistZip |
| sign relayerDistTar |
| } |
| } |
| |
| task createChecksums(type: Checksum, dependsOn: [ |
| 'distZip', |
| 'distTar', |
| 'sourcesDistZip', |
| 'sourcesDistTar', |
| 'gossipDistZip', |
| 'gossipDistTar', |
| 'relayerDistZip', |
| 'relayerDistTar' |
| ]) { |
| files = distZip.outputs.files + distTar.outputs.files + sourcesDistZip.outputs.files + sourcesDistTar.outputs.files \ |
| + gossipDistZip.outputs.files + gossipDistTar.outputs.files + relayerDistZip.outputs.files + relayerDistTar.outputs.files |
| outputDir = new File(project.buildDir, "distributions") |
| algorithm = Checksum.Algorithm.SHA512 |
| } |
| |
| build.dependsOn('createChecksums') |
| |
| import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage |
| |
| task buildGossipImage(type: DockerBuildImage) { |
| dependsOn gossipDistTar |
| inputDir = projectDir |
| dockerFile = file("docker/gossip.Dockerfile") |
| tag = "apache-tuweni/gossip:$project.version" |
| } |
| |
| task buildRelayerImage(type: DockerBuildImage) { |
| dependsOn relayerDistTar |
| inputDir = projectDir |
| dockerFile = file("docker/relayer.Dockerfile") |
| tag = "apache-tuweni/relayer:$project.version" |
| } |