From b94d4ab024138fc4edff0fdff46f00c32ad71c5b Mon Sep 17 00:00:00 2001 From: Doug Hilpipre Date: Fri, 24 Apr 2026 14:13:20 -0500 Subject: [PATCH 1/3] changed agent version and changed it so it is easier to change the version --- .gitignore | 1 + .idea/.gitignore | 10 ++ .idea/.name | 1 + .idea/codeStyles/Project.xml | 7 + .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/compiler.xml | 6 + .idea/gradle.xml | 24 +++ .idea/misc.xml | 5 + .idea/vcs.xml | 6 + build.gradle | 252 ++++++++++++--------------- gradle.properties | 1 + rxjava1-1.1/build.gradle | 34 ++-- rxjava1-1.2/build.gradle | 31 ++-- rxjava1-finder/build.gradle | 32 ++-- rxjava2-2.0.7/build.gradle | 34 ++-- rxjava2-2.0/build.gradle | 47 +++-- rxjava2-finder/build.gradle | 29 ++- rxjava3-3.0/build.gradle | 25 ++- rxjava3-finder/build.gradle | 32 ++-- settings.gradle | 2 +- 20 files changed, 302 insertions(+), 282 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/.name create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 gradle.properties diff --git a/.gitignore b/.gitignore index 58c5902..58ea51b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build bin .DS_Store +.idea diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..7bc07ec --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Environment-dependent path to Maven home directory +/mavenHomeManager.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..e57db74 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +java-instrumentation-template \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..919ce1f --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..dd513bd --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..707e4b0 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..aecc280 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index c559432..893ce5a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,113 +3,85 @@ // Global defaults - override here or in individual modules as needed. buildscript { - repositories { - flatDir dirs: 'template-lib' - mavenLocal() - mavenCentral() - gradlePluginPortal() - } - - dependencies { - classpath 'gradle-templates:gradle-templates:1.5' - classpath 'com.newrelic.agent.java:gradle-verify-instrumentation-plugin:3.2' - } -} + repositories { + flatDir dirs: 'template-lib' + mavenLocal() + mavenCentral() + gradlePluginPortal() + } -plugins { - id "de.undercouch.download" version "5.0.0" + dependencies { + classpath 'gradle-templates:gradle-templates:1.5' + classpath 'com.newrelic.agent.java:gradle-verify-instrumentation-plugin:3.2' + } } project.ext { - group = 'com.newrelic.instrumentation.labs' - javaAgentVersion = '6.4.0' + group = 'com.newrelic.instrumentation.labs' + javaAgentVersion = project.findProperty('java.agent.version') - // Aligned with minimum Java major version supported by latest Java Agent - javaVersion = JavaVersion.VERSION_1_8 + // Aligned with minimum Java major version supported by latest Java Agent + javaVersion = JavaVersion.VERSION_1_8 } apply plugin: 'java' -apply plugin: 'de.undercouch.download' - -import templates.* -import de.undercouch.gradle.tasks.download.Download - -task getAgent(type: Download) { - def rootProject = projectDir.path - src 'https://repo1.maven.org/maven2/com/newrelic/agent/java/newrelic-agent/'+project.javaAgentVersion+'/newrelic-agent-'+project.javaAgentVersion+'.jar' - dest projectDir.path+"/libs/newrelic-agent-"+project.javaAgentVersion+".jar" -} -task extractJars(type: Copy) { - from zipTree(projectDir.path+"/libs/newrelic-agent-"+project.javaAgentVersion+".jar") - into projectDir.path+"/libs" -} +import templates.ProjectTemplate +import templates.TemplatesPlugin -task cleanUp(type: Delete) { - delete projectDir.path+'/libs/META-INF', projectDir.path+'/libs/com', projectDir.path+'/libs/mozilla' - delete projectDir.path+'/libs/LICENSE', projectDir.path+'/libs/Log4j-events.dtd', projectDir.path+'/libs/THIRD_PARTY_NOTICES.md' - delete fileTree(projectDir.path+'/libs') { - include '**/*.xsd' - include '**/*.xml' - include '**/*.yml' - include '**/*.properties' - } -} +tasks.register('UpdateAgentVersion') { + def matchingFiles = fileTree(dir: ".", include: "**/build.gradle") + def rootPath = rootDir.absolutePath + def rootBuildPath = "${rootPath}/build.gradle" + def agentVersionString = "com.newrelic.agent.java:newrelic-agent:" + javaAgentVersion -task checkForDependencies(type: Exec) { - environment "JAVAAGENTVERSION", javaAgentVersion - def rootProject = projectDir.path - def cmdLine = rootProject+'/newrelic-dependencies.sh' - workingDir rootProject - commandLine cmdLine - -} + matchingFiles.each { matchingFile -> + if (matchingFile.absolutePath != rootBuildPath) { + if(!matchingFile.text.contains(agentVersionString)) { -task buildIfNeeded { - dependsOn checkForDependencies - dependsOn jar - tasks.findByName('jar').mustRunAfter 'checkForDependencies' + } + } + } } -task createModule { - dependsOn checkForDependencies - description = 'Generate project files for a new instrumentation module' - group = 'New Relic Labs' - doLast { +tasks.register('createModule') { + description = 'Generate project files for a new instrumentation module' + group = 'New Relic Labs' + doLast { - def rootProject = projectDir.path + def rootProject = projectDir.path - String projectGroup = TemplatesPlugin.prompt('Instrumentation Module Group (default: ' + project.ext.group + ') (Hit return to use default):\n') - String projectName = TemplatesPlugin.prompt('Instrumentation Module Name:\n') + String projectGroup = TemplatesPlugin.prompt('Instrumentation Module Group (default: ' + project.ext.group + ') (Hit return to use default):\n') + String projectName = TemplatesPlugin.prompt('Instrumentation Module Name:\n') - if (projectName == null) { - throw new Exception("Please specify a valid module name.") - } else { - projectName = projectName.trim() - } + if (projectName == null) { + throw new Exception("Please specify a valid module name.") + } else { + projectName = projectName.trim() + } - if (projectGroup == null || projectGroup.trim() == '') { - projectGroup = project.ext.group - } else { - projectGroup = projectGroup.trim() - } + if (projectGroup == null || projectGroup.trim() == '') { + projectGroup = project.ext.group + } else { + projectGroup = projectGroup.trim() + } - def projectLibDir = new File(rootProject+'/lib') + def projectLibDir = new File(rootProject + '/lib') - def projectPath = new File(projectName) - if (projectPath.exists()) { - throw new Exception(projectPath.path + ' already exists.') - } + def projectPath = new File(projectName) + if (projectPath.exists()) { + throw new Exception(projectPath.path + ' already exists.') + } - def projectJava = new File(projectPath, 'src/main/java') - def projectTest = new File(projectPath, 'src/test/java') - mkdir projectJava - mkdir projectTest + def projectJava = new File(projectPath, 'src/main/java') + def projectTest = new File(projectPath, 'src/test/java') + mkdir projectJava + mkdir projectTest - ProjectTemplate.fromRoot(projectPath) { - 'build.gradle' ''' + ProjectTemplate.fromRoot(projectPath) { + 'build.gradle' ''' // Build.gradle generated for instrumentation module PROJECT_NAME apply plugin: 'java' @@ -120,9 +92,9 @@ task createModule { // implementation 'javax.servlet:servlet-api:2.5' // New Relic Labs Java Agent dependencies - implementation 'com.newrelic.agent.java:newrelic-agent:JAVA_AGENT_VERSION' - implementation 'com.newrelic.agent.java:newrelic-api:JAVA_AGENT_VERSION' - implementation fileTree(include: ['*.jar'], dir: '../libs') + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') implementation fileTree(include: ['*.jar'], dir: '../test-lib') } @@ -142,63 +114,59 @@ task createModule { // passes 'javax.servlet:servlet-api:[2.2,2.5]' // exclude 'javax.servlet:servlet-api:2.4.public_draft' }'''.replace('PROJECT_GROUP', projectGroup) - .replace('PROJECT_NAME', projectName) - .replace('PROJECT_PATH', projectPath.path) - .replace('JAVA_AGENT_VERSION', project.ext.javaAgentVersion) - } - - File settings = new File('settings.gradle') - settings.append("include '$projectName'\n") - println "Created module in $projectPath.path." - } + .replace('PROJECT_NAME', projectName) + .replace('PROJECT_PATH', projectPath.path) + .replace('JAVA_AGENT_VERSION', project.ext.javaAgentVersion) + } + + File settings = new File('settings.gradle') + settings.append("include '$projectName'\n") + println "Created module in $projectPath.path." + } } subprojects { - repositories { - mavenLocal() - mavenCentral() - } - - apply plugin: 'java' - apply plugin: 'eclipse' - apply plugin: 'idea' - apply plugin: 'com.newrelic.gradle-verify-instrumentation-plugin' - - sourceCompatibility = project.javaVersion - targetCompatibility = project.javaVersion - - dependencies { - testImplementation fileTree(dir: '../lib', include: "*.jar") // + project.javaAgentVersion - testImplementation 'org.nanohttpd:nanohttpd:2.3.1' - testImplementation 'com.newrelic.agent.java:newrelic-agent:' + project.javaAgentVersion - } - - task install(dependsOn: buildIfNeeded, type: Copy) { - description = 'Copies compiled jar to the NEW_RELIC_EXTENSIONS_DIR.' - group = 'New Relic Labs' - - def extDir = System.getenv("NEW_RELIC_EXTENSIONS_DIR") ?: " " - - from jar - into extDir - } - - compileJava.doFirst { - tasks.findByName('checkForDependencies') - } - - install.doFirst { - def extDir = System.getenv("NEW_RELIC_EXTENSIONS_DIR") - if (extDir == null) { - throw new Exception("Must set NEW_RELIC_EXTENSIONS_DIR.") - } - - if (extDir.startsWith("~" + File.separator)) { - extDir = System.getProperty("user.home") + extDir.substring(1); - } - - if (!file(extDir).directory) { - throw new Exception(extDir + "NEW_RELIC_EXTENSIONS_DIR, set as '" + extDir + "'is not a valid directory.") - } - } + repositories { + mavenLocal() + mavenCentral() + } + + apply plugin: 'java' + apply plugin: 'eclipse' + apply plugin: 'idea' + apply plugin: 'com.newrelic.gradle-verify-instrumentation-plugin' + + sourceCompatibility = project.javaVersion + targetCompatibility = project.javaVersion + + dependencies { + testImplementation fileTree(dir: '../lib', include: "*.jar") // + project.javaAgentVersion + testImplementation 'org.nanohttpd:nanohttpd:2.3.1' + testImplementation 'com.newrelic.agent.java:newrelic-agent:' + project.javaAgentVersion + } + + tasks.register('install', Copy) { + description = 'Copies compiled jar to the NEW_RELIC_EXTENSIONS_DIR.' + group = 'New Relic Labs' + + def extDir = System.getenv("NEW_RELIC_EXTENSIONS_DIR") ?: " " + + from jar + into extDir + } + + install.doFirst { + def extDir = System.getenv("NEW_RELIC_EXTENSIONS_DIR") + if (extDir == null) { + throw new Exception("Must set NEW_RELIC_EXTENSIONS_DIR.") + } + + if (extDir.startsWith("~" + File.separator)) { + extDir = System.getProperty("user.home") + extDir.substring(1); + } + + if (!file(extDir).directory) { + throw new Exception(extDir + "NEW_RELIC_EXTENSIONS_DIR, set as '" + extDir + "'is not a valid directory.") + } + } } diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..9eeb288 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +java.agent.version=8.4.0 \ No newline at end of file diff --git a/rxjava1-1.1/build.gradle b/rxjava1-1.1/build.gradle index 0ea83f6..7baead7 100644 --- a/rxjava1-1.1/build.gradle +++ b/rxjava1-1.1/build.gradle @@ -1,32 +1,30 @@ - // Build.gradle generated for instrumentation module rxjava1-1.1 apply plugin: 'java' dependencies { - implementation 'io.reactivex:rxjava:1.1.0' + implementation 'io.reactivex:rxjava:1.1.0' - // New Relic Labs Java Agent dependencies - implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - implementation fileTree(include: ['*.jar'], dir: '../libs') + // New Relic Labs Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') - testImplementation 'junit:junit:4.12' - testImplementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - testImplementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - testImplementation fileTree(include: ['*.jar'], dir: '../libs') + testImplementation 'junit:junit:4.12' + testImplementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + testImplementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') } jar { - manifest { - attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava1-1.1' - attributes 'Implementation-Vendor': 'New Relic Labs' - attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' - attributes 'Implementation-Version': 1.1 - } + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava1-1.1' + attributes 'Implementation-Vendor': 'New Relic Labs' + attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' + attributes 'Implementation-Version': 1.1 + } } verifyInstrumentation { - passes 'io.reactivex:rxjava:[1.1.0,)' - excludeRegex '.*RC[0-9]' + passes 'io.reactivex:rxjava:[1.1.0,)' + excludeRegex '.*RC[0-9]' } \ No newline at end of file diff --git a/rxjava1-1.2/build.gradle b/rxjava1-1.2/build.gradle index 94f54a3..46b832c 100644 --- a/rxjava1-1.2/build.gradle +++ b/rxjava1-1.2/build.gradle @@ -1,29 +1,28 @@ - // Build.gradle generated for instrumentation module rxjava1-1.2 apply plugin: 'java' dependencies { - implementation 'io.reactivex:rxjava:1.2.0' + implementation 'io.reactivex:rxjava:1.2.0' + + // New Relic Labs Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') - // New Relic Labs Java Agent dependencies - implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - implementation fileTree(include: ['*.jar'], dir: '../libs') - - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.12' } jar { - manifest { - attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava1-1.2' - attributes 'Implementation-Vendor': 'New Relic Labs' - attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' - attributes 'Implementation-Version': 1.1 - } + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava1-1.2' + attributes 'Implementation-Vendor': 'New Relic Labs' + attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' + attributes 'Implementation-Version': 1.1 + } } verifyInstrumentation { - passes 'io.reactivex:rxjava:[1.2.0,)' - excludeRegex '.*RC[0-9]' + passes 'io.reactivex:rxjava:[1.2.0,)' + excludeRegex '.*RC[0-9]' } \ No newline at end of file diff --git a/rxjava1-finder/build.gradle b/rxjava1-finder/build.gradle index 1686e82..843a861 100644 --- a/rxjava1-finder/build.gradle +++ b/rxjava1-finder/build.gradle @@ -1,31 +1,27 @@ - // Build.gradle generated for instrumentation module rxjava1-finder apply plugin: 'java' dependencies { - implementation 'io.reactivex:rxjava:1.1.0' + implementation 'io.reactivex:rxjava:1.1.0' - // New Relic Labs Java Agent dependencies - implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - implementation fileTree(include: ['*.jar'], dir: '../libs') + // New Relic Labs Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') } jar { - manifest { - attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava1-finder' - attributes 'Implementation-Vendor': 'New Relic Labs' - attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' - attributes 'Implementation-Version': 1.1 - attributes 'Agent-Class': 'com.newrelic.agent.instrumentation.labs.rxjava1.RxJava1PreMain' - } + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava1-finder' + attributes 'Implementation-Vendor': 'New Relic Labs' + attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' + attributes 'Implementation-Version': 1.1 + attributes 'Agent-Class': 'com.newrelic.agent.instrumentation.labs.rxjava1.RxJava1PreMain' + } } verifyInstrumentation { - // Verifier plugin documentation: - // https://github.com/newrelic/newrelic-gradle-verify-instrumentation - // Example: - // passes 'javax.servlet:servlet-api:[2.2,2.5]' - // exclude 'javax.servlet:servlet-api:2.4.public_draft' + File outputFile = file("build/verifier/passes.txt") + outputFile << "No verify is needed" } \ No newline at end of file diff --git a/rxjava2-2.0.7/build.gradle b/rxjava2-2.0.7/build.gradle index 1d43abb..6e0b412 100644 --- a/rxjava2-2.0.7/build.gradle +++ b/rxjava2-2.0.7/build.gradle @@ -1,30 +1,30 @@ - // Build.gradle generated for instrumentation module rxjava2-2.0 apply plugin: 'java' dependencies { - implementation 'io.reactivex.rxjava2:rxjava:2.0.7' - implementation 'org.reactivestreams:reactive-streams:1.0.3' - + implementation 'io.reactivex.rxjava2:rxjava:2.0.7' + implementation 'org.reactivestreams:reactive-streams:1.0.3' + + // New Relic Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') + + testImplementation 'junit:junit:4.12' - // New Relic Java Agent dependencies - implementation fileTree(include: ['*.jar'], dir: '../libs') - - testImplementation 'junit:junit:4.12' - } jar { - manifest { - attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava2-2.0.7' - attributes 'Implementation-Vendor': 'New Relic Labs' - attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' - attributes 'Implementation-Version': 1.0 - } + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava2-2.0.7' + attributes 'Implementation-Vendor': 'New Relic Labs' + attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' + attributes 'Implementation-Version': 1.0 + } } verifyInstrumentation { - passes 'io.reactivex.rxjava2:rxjava:[2.0.7,)' - excludeRegex '.*RC[0-9]' + passes 'io.reactivex.rxjava2:rxjava:[2.0.7,)' + excludeRegex '.*RC[0-9]' } \ No newline at end of file diff --git a/rxjava2-2.0/build.gradle b/rxjava2-2.0/build.gradle index 0c5b101..e1187d4 100644 --- a/rxjava2-2.0/build.gradle +++ b/rxjava2-2.0/build.gradle @@ -1,36 +1,35 @@ - // Build.gradle generated for instrumentation module rxjava2-2.0 apply plugin: 'java' dependencies { - implementation 'io.reactivex.rxjava2:rxjava:2.0.0' - implementation 'org.reactivestreams:reactive-streams:1.0.3' - - - // New Relic Labs Java Agent dependencies - implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - implementation fileTree(include: ['*.jar'], dir: '../libs') - - testImplementation 'junit:junit:4.12' - testImplementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - testImplementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - testImplementation fileTree(include: ['*.jar'], dir: '../libs') - testImplementation fileTree(include: ['*.jar'], dir: '../test-lib') - + implementation 'io.reactivex.rxjava2:rxjava:2.0.0' + implementation 'org.reactivestreams:reactive-streams:1.0.3' + + + // New Relic Labs Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') + + testImplementation 'junit:junit:4.12' + testImplementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + testImplementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') + testImplementation fileTree(include: ['*.jar'], dir: '../test-lib') + } jar { - manifest { - attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava2-2.0' - attributes 'Implementation-Vendor': 'New Relic Labs' - attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' - attributes 'Implementation-Version': 2.0 - } + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava2-2.0' + attributes 'Implementation-Vendor': 'New Relic Labs' + attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' + attributes 'Implementation-Version': 2.0 + } } verifyInstrumentation { - passes 'io.reactivex.rxjava2:rxjava:[2.0.0,2.0.7)' - excludeRegex '.*RC[0-9]' + passes 'io.reactivex.rxjava2:rxjava:[2.0.0,2.0.7)' + excludeRegex '.*RC[0-9]' } \ No newline at end of file diff --git a/rxjava2-finder/build.gradle b/rxjava2-finder/build.gradle index 73997ee..6c6acd9 100644 --- a/rxjava2-finder/build.gradle +++ b/rxjava2-finder/build.gradle @@ -1,28 +1,27 @@ - // Build.gradle generated for instrumentation module rxjava2-finder apply plugin: 'java' dependencies { - implementation 'io.reactivex.rxjava2:rxjava:2.0.0' + implementation 'io.reactivex.rxjava2:rxjava:2.0.0' - // New Relic Labs Java Agent dependencies - implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - implementation fileTree(include: ['*.jar'], dir: '../libs') + // New Relic Labs Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') } jar { - manifest { - attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava2-finder' - attributes 'Implementation-Vendor': 'New Relic Labs' - attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' - attributes 'Implementation-Version': 1.1 - attributes 'Agent-Class': 'com.newrelic.agent.instrumentation.labs.rxjava2.RxJava2PreMain' - } + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava2-finder' + attributes 'Implementation-Vendor': 'New Relic Labs' + attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' + attributes 'Implementation-Version': 1.1 + attributes 'Agent-Class': 'com.newrelic.agent.instrumentation.labs.rxjava2.RxJava2PreMain' + } } verifyInstrumentation { - passes 'io.reactivex.rxjava2:rxjava:[2.0.0,)' - excludeRegex '.*RC[0-9]' + File outputFile = file("build/verifier/passes.txt") + outputFile << "No verify is needed" } \ No newline at end of file diff --git a/rxjava3-3.0/build.gradle b/rxjava3-3.0/build.gradle index 3834374..fd55258 100644 --- a/rxjava3-3.0/build.gradle +++ b/rxjava3-3.0/build.gradle @@ -1,26 +1,25 @@ - // Build.gradle generated for instrumentation module rxjava3-3.0 apply plugin: 'java' dependencies { - implementation 'io.reactivex.rxjava3:rxjava:3.0.0' + implementation 'io.reactivex.rxjava3:rxjava:3.0.0' - // New Relic Labs Java Agent dependencies - implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - implementation fileTree(include: ['*.jar'], dir: '../libs') + // New Relic Labs Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') } jar { - manifest { - attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava3-3.0' - attributes 'Implementation-Vendor': 'New Relic Labs' - attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' - attributes 'Implementation-Version': 1.0 - } + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava3-3.0' + attributes 'Implementation-Vendor': 'New Relic Labs' + attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' + attributes 'Implementation-Version': 1.0 + } } verifyInstrumentation { - passes 'io.reactivex.rxjava3:rxjava:[3.0.0,)' + passes 'io.reactivex.rxjava3:rxjava:[3.0.0,)' } \ No newline at end of file diff --git a/rxjava3-finder/build.gradle b/rxjava3-finder/build.gradle index 5b0fbfa..f801cb0 100644 --- a/rxjava3-finder/build.gradle +++ b/rxjava3-finder/build.gradle @@ -1,31 +1,27 @@ - // Build.gradle generated for instrumentation module rxjava3-finder apply plugin: 'java' dependencies { - implementation 'io.reactivex.rxjava3:rxjava:3.0.0' + implementation 'io.reactivex.rxjava3:rxjava:3.0.0' - // New Relic Labs Java Agent dependencies - implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' - implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' - implementation fileTree(include: ['*.jar'], dir: '../libs') + // New Relic Labs Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:newrelic-api:' + project.findProperty('java.agent.version') + implementation 'com.newrelic.agent.java:agent-bridge:' + project.findProperty('java.agent.version') } jar { - manifest { - attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava3-finder' - attributes 'Implementation-Vendor': 'New Relic Labs' - attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' - attributes 'Implementation-Version': 1.1 - attributes 'Agent-Class': 'com.newrelic.agent.instrumentation.labs.rxjava3.finder.RxJava3PreMain' - } + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.labs.rxjava3-finder' + attributes 'Implementation-Vendor': 'New Relic Labs' + attributes 'Implementation-Vendor-Id': 'com.newrelic.labs' + attributes 'Implementation-Version': 1.1 + attributes 'Agent-Class': 'com.newrelic.agent.instrumentation.labs.rxjava3.finder.RxJava3PreMain' + } } verifyInstrumentation { - // Verifier plugin documentation: - // https://github.com/newrelic/newrelic-gradle-verify-instrumentation - // Example: - // passes 'javax.servlet:servlet-api:[2.2,2.5]' - // exclude 'javax.servlet:servlet-api:2.4.public_draft' + File outputFile = file("build/verifier/passes.txt") + outputFile << "No verify is needed" } \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e8ca636..579eb65 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = 'java-instrumentation-template' +rootProject.name = 'rxjava-instrumentation' include 'rxjava1-1.1' include 'rxjava1-1.2' include 'rxjava2-2.0' From 418fc07d717483baa4b05149abfa12a06bf6b3d6 Mon Sep 17 00:00:00 2001 From: Doug Hilpipre Date: Fri, 24 Apr 2026 14:15:37 -0500 Subject: [PATCH 2/3] changed agent version and changed it so it is easier to change the version --- .idea/.gitignore | 10 ---------- .idea/.name | 1 - .idea/codeStyles/Project.xml | 7 ------- .idea/codeStyles/codeStyleConfig.xml | 5 ----- .idea/compiler.xml | 6 ------ .idea/gradle.xml | 24 ------------------------ .idea/misc.xml | 5 ----- .idea/vcs.xml | 6 ------ 8 files changed, 64 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/.name delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 7bc07ec..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Environment-dependent path to Maven home directory -/mavenHomeManager.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index e57db74..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -java-instrumentation-template \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 919ce1f..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index dd513bd..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 61a9130..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 707e4b0..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index aecc280..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 9da6faa52f0ae42bcb1566c0217b844e0d1bf604 Mon Sep 17 00:00:00 2001 From: Doug Hilpipre Date: Fri, 24 Apr 2026 14:22:44 -0500 Subject: [PATCH 3/3] Update release.yml --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7da90bb..c038ba5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,6 @@ jobs: - name: Build with Gradle and verifyInstrumentation run: | - . ./newrelic-dependencies.sh ./gradlew clean build install verifyInstrumentation - name: Identify Release Type