Skip to content

Commit

Permalink
Refactor naming used for jars and publishing (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
rain-on authored Mar 17, 2020
1 parent 0377ab6 commit 7c3dd72
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ subprojects {
publishing {
publications {
mavenJava(MavenPublication) {
artifactId calculateJarName(project)
groupId "tech.pegasys.signers.internal"
version "${project.version}"
from components.java
Expand Down Expand Up @@ -459,6 +460,19 @@ def calculateVersion() {
return version
}

def calculateJarName(Project project) {
def jarName = project.name
def parent = project.parent

while (parent != null) {
if (parent != rootProject) {
jarName = parent.name + '-' + jarName
}
parent = parent.parent
}
return jarName
}

def getCheckedOutGitCommitHash() {
def gitFolder = "$projectDir/.git/"
if (!file(gitFolder).isDirectory()) {
Expand Down
14 changes: 7 additions & 7 deletions keystorage/hashicorp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ apply plugin: 'java-library'
apply plugin: 'java-test-fixtures'

jar {
archiveBaseName = "keystore-hashicorp"
archiveBaseName = calculateJarName(project)
manifest {
attributes(
'Specification-Title': archiveBaseName.get(),
Expand All @@ -21,13 +21,16 @@ jar {
}
}

testFixturesJar {
archiveBaseName = calculateJarName(project)
}

dependencies {
implementation 'io.vertx:vertx-core'
implementation 'org.apache.logging.log4j:log4j-api'

implementation 'org.apache.tuweni:tuweni-toml'
implementation 'org.apache.tuweni:tuweni-net'
implementation 'org.bouncycastle:bcpkix-jdk15on'

runtimeOnly 'org.apache.logging.log4j:log4j-core'
runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
Expand All @@ -37,18 +40,15 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.mockito:mockito-junit-jupiter'

integrationTestImplementation 'org.assertj:assertj-core'
integrationTestImplementation 'org.awaitility:awaitility'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-api'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-engine'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-params'
integrationTestImplementation 'org.mockito:mockito-core'
integrationTestImplementation 'org.mockito:mockito-junit-jupiter'
integrationTestImplementation 'org.mock-server:mockserver-netty'
integrationTestImplementation sourceSets.testFixtures.output

errorprone("com.google.errorprone:error_prone_core")

testFixturesImplementation 'com.github.docker-java:docker-java'
testFixturesImplementation 'org.apache.logging.log4j:log4j-api'
testFixturesImplementation 'org.assertj:assertj-core'
Expand Down

0 comments on commit 7c3dd72

Please sign in to comment.