Skip to content

Commit

Permalink
Merge pull request #242 from ysb33r/schalk/fix-all-telemetry
Browse files Browse the repository at this point in the history
Fix telemetry-all and clean up build for consistency
  • Loading branch information
breedx-nr authored Oct 6, 2020
2 parents c6a466b + 2c9de45 commit 52ee0e9
Show file tree
Hide file tree
Showing 99 changed files with 98 additions and 95 deletions.
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ plugins {
id("maven-publish")
id("signing")
id("com.github.sherter.google-java-format") version "0.8"
id("org.ysb33r.java.modulehelper") version("0.9.0") apply false
id("com.github.johnrengelman.shadow") version ("5.2.0") apply false
}

allprojects {
group = "com.newrelic.telemetry"
val release: String? by project
version = if ("true" == release) version else "${version}-SNAPSHOT"
repositories {
Expand All @@ -25,7 +26,7 @@ allprojects {
}
}

listOf(":telemetry", ":telemetry-http-okhttp", ":telemetry-http-java11", ":telemetry-all").forEach {
listOf(":telemetry", ":telemetry-http-okhttp", ":telemetry-http-java11" , ":telemetry-all").forEach {
project(it) {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
Expand Down
14 changes: 13 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#

# Here is where we manage the version
version=0.8.1
group=com.newrelic.telemetry
version=0.8.2-SNAPSHOT

# Set this to true to enable using a local sonatype (for debugging publishing issues)
# Start a local sonatype in docker with this command:
Expand All @@ -18,3 +19,14 @@ useLocalSonatype=false
# or set SONATYPE_USERNAME and SONATYPE_PASSWORD env vars
#sonatypeUsername=admin
#sonatypePassword=admin123

# Dependency versions
slf4jVersion=1.7.30
gsonVersion=2.8.6
guavaVersion=27.1-jre
junitVersion=5.3.1
jsonassertVersion=1.5.0
mockitoVersion=2.23.0
mockserverVersion=5.5.1
okhttpVersion=4.8.0
testContainerVersion=1.11.3
38 changes: 19 additions & 19 deletions integration_test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat

private object Versions {
const val junit = "5.3.1"
const val mockito = "2.23.0"
const val mockserver = "5.5.1"
const val slf4j = "1.7.26"
const val okhttp = "3.14.1"
const val guava = "27.1-jre"
const val testContainer = "1.11.3"
}
val guavaVersion: String by project
val junitVersion: String by project
val mockitoVersion: String by project
val mockserverVersion: String by project
val okhttpVersion: String by project
val slf4jVersion: String by project
val gsonVersion: String by project
val testContainerVersion: String by project

repositories {
mavenCentral()
jcenter()
Expand All @@ -19,19 +19,19 @@ plugins {
}

dependencies {
implementation("org.mock-server:mockserver-client-java:${Versions.mockserver}")
implementation("org.mock-server:mockserver-client-java:${mockserverVersion}")
implementation(project(":telemetry-core"))
implementation(project(":telemetry-http-okhttp"))

testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${Versions.junit}")
testImplementation("com.squareup.okhttp3:okhttp:${Versions.okhttp}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.junit}")
testImplementation("org.mockito:mockito-core:${Versions.mockito}")
testImplementation("org.slf4j:slf4j-simple:${Versions.slf4j}")
testImplementation("com.google.guava:guava:${Versions.guava}")
testImplementation("org.testcontainers:testcontainers:${Versions.testContainer}")
testImplementation("org.testcontainers:junit-jupiter:${Versions.testContainer}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${junitVersion}")
testImplementation("com.squareup.okhttp3:okhttp:${okhttpVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testImplementation("org.mockito:mockito-core:${mockitoVersion}")
testImplementation("org.slf4j:slf4j-simple:${slf4jVersion}")
testImplementation("com.google.guava:guava:${guavaVersion}")
testImplementation("org.testcontainers:testcontainers:${testContainerVersion}")
testImplementation("org.testcontainers:junit-jupiter:${testContainerVersion}")
}

tasks {
Expand Down
10 changes: 0 additions & 10 deletions settings.gradle

This file was deleted.

10 changes: 10 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rootProject.name = "newrelic-telemetry-sdk-java"

include (":telemetry")
include (":telemetry-all")
include (":telemetry_examples")
include (":telemetry-core")
include (":integration_test")
include ("telemetry-http-okhttp")
include ("telemetry-http-java11")

35 changes: 17 additions & 18 deletions telemetry-all/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
private object Versions {
const val slf4j = "1.7.30"
const val gson = "2.8.6"
}

plugins {
java
id("java-library")
id( "org.ysb33r.java.modulehelper")
}

configure<JavaPluginConvention> {
val slf4jVersion: String by project
val gsonVersion: String by project

configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
Expand All @@ -17,28 +16,28 @@ sourceSets {
main {
java.setSrcDirs(listOf(
"src/main/java",
"../telemetry_core/src/main/java",
"../telemetry-core/src/main/java",
"../telemetry/src/main/java",
"../telemetry-http-java11/src/main/java"
))
resources.setSrcDirs(listOf(
"../telemetry_core/src/main/resources",
"../telemetry-core/src/main/resources",
"../telemetry/src/main/resources",
"../telemetry-http-java11/src/main/resources"
))
}
}

dependencies {
api("org.slf4j:slf4j-api:${Versions.slf4j}")
implementation("com.google.code.gson:gson:${Versions.gson}")
api("org.slf4j:slf4j-api:${slf4jVersion}")
implementation("com.google.code.gson:gson:${gsonVersion}")
}

tasks.register<Jar>("jarAll") {
dependsOn(configurations.runtimeClasspath)
from(sourceSets["main"].output)
configurations.runtimeClasspath.get().allDependencies.findAll(closureOf<Any>{
val proj = this as ProjectDependency
from(proj.dependencyProject.sourceSets["main"].output)
})
manifest.attributes["Automatic-Module-Name"] = "com.newrelic.telemetry"
extraJavaModules {
module("slf4j-api-${slf4jVersion}.jar", "org.slf4j", slf4jVersion) {
exports("org.slf4j")
}
module("gson-${gsonVersion}.jar", "com.google.code.gson", gsonVersion) {
exports("com.google.gson")
}
}
File renamed without changes.
36 changes: 17 additions & 19 deletions telemetry_core/build.gradle.kts → telemetry-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ import com.newrelic.telemetry.gradle.configuredPom
plugins {
java
id("java-library")
id("com.github.johnrengelman.shadow") version "5.2.0"
id("com.github.johnrengelman.shadow")
}

val junitVersion: String by project
val jsonassertVersion: String by project
val mockitoVersion: String by project
val guavaVersion: String by project
val slf4jVersion: String by project
val gsonVersion: String by project

apply(plugin = "maven-publish")
apply(plugin = "signing")

private object Versions {
const val junit = "5.3.1"
const val guava = "27.1-jre"
const val mockito = "2.23.0"
const val slf4j = "1.7.30"
const val jsonassert = "1.5.0"
const val gson = "2.8.6"
}

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -28,15 +26,15 @@ configure<JavaPluginConvention> {
configurations["shadow"].extendsFrom(configurations["api"])

dependencies {
api("org.slf4j:slf4j-api:${Versions.slf4j}")
implementation("com.google.code.gson:gson:${Versions.gson}")
api("org.slf4j:slf4j-api:${slf4jVersion}")
implementation("com.google.code.gson:gson:${gsonVersion}")

testImplementation("org.slf4j:slf4j-simple:${Versions.slf4j}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}")
testImplementation("org.mockito:mockito-core:${Versions.mockito}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.junit}")
testImplementation("com.google.guava:guava:${Versions.guava}")
testImplementation("org.skyscreamer:jsonassert:${Versions.jsonassert}")
testImplementation("org.slf4j:slf4j-simple:${slf4jVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
testImplementation("org.mockito:mockito-core:${mockitoVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testImplementation("com.google.guava:guava:${guavaVersion}")
testImplementation("org.skyscreamer:jsonassert:${jsonassertVersion}")
}

val javadocJar by tasks.creating(Jar::class) {
Expand All @@ -55,7 +53,7 @@ tasks {
"shadowJar"(ShadowJar::class) {
archiveClassifier.set("")
dependencies {
exclude(dependency("org.slf4j:slf4j-api:${Versions.slf4j}"))
exclude(dependency("org.slf4j:slf4j-api:${slf4jVersion}"))
}
manifest {
attributes(mapOf("Implementation-Version" to project.version, "Implementation-Vendor" to "New Relic, Inc."))
Expand Down
12 changes: 5 additions & 7 deletions telemetry-http-java11/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
private object Versions {
const val junit = "5.3.1"
const val jsonassert = "1.5.0"
}
val junitVersion: String by project
val jsonassertVersion: String by project

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_11
Expand All @@ -12,7 +10,7 @@ dependencies {
implementation(project(":telemetry"))
api(project(":telemetry-core"))

testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.junit}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}")
testImplementation("org.skyscreamer:jsonassert:${Versions.jsonassert}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
testImplementation("org.skyscreamer:jsonassert:${jsonassertVersion}")
}
16 changes: 7 additions & 9 deletions telemetry-http-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
private object Versions {
const val okhttp = "4.8.0"
const val junit = "5.3.1"
const val jsonassert = "1.5.0"
}
val junitVersion: String by project
val jsonassertVersion: String by project
val okhttpVersion: String by project

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -12,9 +10,9 @@ configure<JavaPluginConvention> {
dependencies {
implementation(project(":telemetry"))
api(project(":telemetry-core"))
api("com.squareup.okhttp3:okhttp:${Versions.okhttp}")
api("com.squareup.okhttp3:okhttp:${okhttpVersion}")

testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.junit}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}")
testImplementation("org.skyscreamer:jsonassert:${Versions.jsonassert}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
testImplementation("org.skyscreamer:jsonassert:${jsonassertVersion}")
}
17 changes: 7 additions & 10 deletions telemetry/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

private object Versions {
const val junit = "5.3.1"
const val mockito = "2.23.0"
const val slf4j = "1.7.30"
}
val junitVersion: String by project
val mockitoVersion: String by project
val slf4jVersion: String by project

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -13,8 +10,8 @@ configure<JavaPluginConvention> {
dependencies {
"api"(project(":telemetry-core"))

testImplementation("org.slf4j:slf4j-simple:${Versions.slf4j}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}")
testImplementation("org.mockito:mockito-core:${Versions.mockito}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.junit}")
testImplementation("org.slf4j:slf4j-simple:${slf4jVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
testImplementation("org.mockito:mockito-core:${mockitoVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
}

0 comments on commit 52ee0e9

Please sign in to comment.