From 10607b504c999992b3acda0428849787e45fc25d Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Fri, 10 May 2019 14:47:37 -0700 Subject: [PATCH 1/5] added logs when tools dirs are custom --- core/native.gradle | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/native.gradle b/core/native.gradle index ff593bc0bea..8b9b00f341f 100644 --- a/core/native.gradle +++ b/core/native.gradle @@ -36,8 +36,16 @@ def javaIncludeDir = new File(System.env.'JAVA_HOME', "include") def programFilesX86 = System.env.'ProgramFiles(x86)' def referenceAssembliesDir = new File("$programFilesX86\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5") -def winSdkDir = System.env.APPINSIGHTS_WIN_SDK_PATH ?: "C:\\Program Files (x86)\\Windows Kits\\8.1" -def vsToolsDir = System.env.APPINSIGHTS_VS_PATH ?: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0" +def winSdkDir = "C:\\Program Files (x86)\\Windows Kits\\8.1" +if (System.env.APPINSIGHTS_WIN_SDK_PATH) { + winSdkDir = System.env.APPINSIGHTS_WIN_SDK_PATH + println "Using custom Windows SDK path: $winSdkDir" +} +def vsToolsDir = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0" +if (System.env.APPINSIGHTS_VS_PATH) { + vsToolsDir = System.env.APPINSIGHTS_VS_PATH + println "Using customer Visual Studio Tools path: $vsToolsDir" +} // region Native binary definition and configuration model { From 9e18e4dd878436ef0ef171142dada73ca16b92cb Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Fri, 10 May 2019 14:51:36 -0700 Subject: [PATCH 2/5] fix typo --- core/native.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/native.gradle b/core/native.gradle index 8b9b00f341f..fda5a622685 100644 --- a/core/native.gradle +++ b/core/native.gradle @@ -44,7 +44,7 @@ if (System.env.APPINSIGHTS_WIN_SDK_PATH) { def vsToolsDir = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0" if (System.env.APPINSIGHTS_VS_PATH) { vsToolsDir = System.env.APPINSIGHTS_VS_PATH - println "Using customer Visual Studio Tools path: $vsToolsDir" + println "Using custom Visual Studio Tools path: $vsToolsDir" } // region Native binary definition and configuration From 7297227109ddac2a5d0d57640cb6853adf3c844e Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Mon, 13 May 2019 13:42:08 -0700 Subject: [PATCH 3/5] using #using instead of /FU removing now unused reference assemblies path --- core/native.gradle | 13 +++---------- core/src/windows/cpp/CppPerfCounters.cpp | 5 +++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/native.gradle b/core/native.gradle index fda5a622685..b829153abce 100644 --- a/core/native.gradle +++ b/core/native.gradle @@ -33,15 +33,14 @@ buildscript { import org.apache.commons.io.FilenameUtils def javaIncludeDir = new File(System.env.'JAVA_HOME', "include") -def programFilesX86 = System.env.'ProgramFiles(x86)' -def referenceAssembliesDir = new File("$programFilesX86\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5") +def programFilesX86 = System.env.'ProgramFiles(x86)' ?: 'C:\\Program Files (x86)' -def winSdkDir = "C:\\Program Files (x86)\\Windows Kits\\8.1" +def winSdkDir = "$programFilesX86\\Windows Kits\\8.1" if (System.env.APPINSIGHTS_WIN_SDK_PATH) { winSdkDir = System.env.APPINSIGHTS_WIN_SDK_PATH println "Using custom Windows SDK path: $winSdkDir" } -def vsToolsDir = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0" +def vsToolsDir = "$programFilesX86\\Microsoft Visual Studio 14.0" if (System.env.APPINSIGHTS_VS_PATH) { vsToolsDir = System.env.APPINSIGHTS_VS_PATH println "Using custom Visual Studio Tools path: $vsToolsDir" @@ -106,12 +105,6 @@ model { // Produces an output file to run on the common language runtime. cppCompiler.args "/clr" - // Forces the use of a file name as if it had been passed to the #using directive. - cppCompiler.args "/FU$referenceAssembliesDir\\mscorlib.dll" - cppCompiler.args "/FU$referenceAssembliesDir\\System.Data.dll" - cppCompiler.args "/FU$referenceAssembliesDir\\System.dll" - cppCompiler.args "/FU$referenceAssembliesDir\\System.Xml.dll" - // Sets warning level. cppCompiler.args "/W3" diff --git a/core/src/windows/cpp/CppPerfCounters.cpp b/core/src/windows/cpp/CppPerfCounters.cpp index 46536bbf10f..c6bfc483476 100644 --- a/core/src/windows/cpp/CppPerfCounters.cpp +++ b/core/src/windows/cpp/CppPerfCounters.cpp @@ -25,6 +25,11 @@ #include +#using as_friend +#using as_friend +#using as_friend +#using as_friend + using System::Text::Encoding; using namespace System::Reflection; using namespace System; From 28b87292d66a5a1e0b9144bb667ec1368d0dfeff Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Mon, 13 May 2019 10:34:15 -0700 Subject: [PATCH 4/5] fix hamcrest dependency declarations --- ApplicationInsightsInternalLogger/build.gradle | 4 ++-- core/build.gradle | 2 +- test/smoke/testApps/build.gradle | 2 +- web/build.gradle | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ApplicationInsightsInternalLogger/build.gradle b/ApplicationInsightsInternalLogger/build.gradle index 1c894422ca5..bef70674d6a 100644 --- a/ApplicationInsightsInternalLogger/build.gradle +++ b/ApplicationInsightsInternalLogger/build.gradle @@ -3,9 +3,9 @@ apply from: "$buildScriptsDir/common-java.gradle" archivesBaseName = 'ApplicationInsightsInternalLogger' dependencies { - testCompile('junit:junit:4.12') + testCompile group: 'org.hamcrest', name:'hamcrest-library', version:'1.3' testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' - testCompile group:'org.hamcrest', name:'hamcrest-library', version:'1.3' + testCompile 'junit:junit:4.12' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7' compile group: 'commons-io', name: 'commons-io', version: '2.6' } diff --git a/core/build.gradle b/core/build.gradle index 628436f6117..cd4cf6c99d4 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -118,7 +118,7 @@ dependencies { compile ([group: 'io.grpc', name: 'grpc-stub', version: '1.16.1']) compile ([group: 'io.grpc', name: 'grpc-protobuf', version: '1.16.1']) runtime ([group: 'io.grpc', name: 'grpc-netty-shaded', version: '1.16.1']) - testCompile group:'org.hamcrest', name:'hamcrest-library', version:'1.3' + testCompile group: 'org.hamcrest', name:'hamcrest-library', version:'1.3' testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' testCompile group: 'com.google.code.gson', name: 'gson', version: '2.8.2' diff --git a/test/smoke/testApps/build.gradle b/test/smoke/testApps/build.gradle index 0f57584d938..91f7b400a76 100644 --- a/test/smoke/testApps/build.gradle +++ b/test/smoke/testApps/build.gradle @@ -27,8 +27,8 @@ subprojects { dependencies { smokeTestCompile project(':test:smoke:framework:testCore') smokeTestCompile project(':test:smoke:framework:utils') - smokeTestCompile 'junit:junit:4.12' smokeTestCompile 'org.hamcrest:hamcrest-library:1.3' + smokeTestCompile 'junit:junit:4.12' testCompile project(':test:smoke:framework:testCore') // not necessary; vs code bug workaround testCompile project(':test:smoke:framework:utils') diff --git a/web/build.gradle b/web/build.gradle index ceb31ce8606..5f9fddcfc27 100644 --- a/web/build.gradle +++ b/web/build.gradle @@ -39,6 +39,7 @@ dependencies { provided 'org.springframework:spring-webmvc:3.1.0.RELEASE' provided group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1' provided group: 'javax.enterprise', name: 'cdi-api', version: '1.1' // Java EE + testCompile group: 'org.hamcrest', name:'hamcrest-library', version:'1.3' testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.14.v20181114' @@ -48,7 +49,6 @@ dependencies { testCompile group: 'org.json', name:'json', version:'20090211' testCompile group: 'com.microsoft.azure', name: 'azure-storage', version: '2.1.0' testCompile group: 'com.google.guava', name: 'guava', version: '20.0' - testCompile group:'org.hamcrest', name:'hamcrest-library', version:'1.3' } shadowJar { From f9e61550cd2a0b703eaa330026a214d045cc495c Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Mon, 13 May 2019 11:03:09 -0700 Subject: [PATCH 5/5] fix test dependencies --- ApplicationInsightsInternalLogger/build.gradle | 1 + agent/build.gradle | 2 +- collectd/build.gradle | 2 +- core/build.gradle | 3 ++- logging/logging.gradle | 4 ++-- test/smoke/testApps/build.gradle | 3 ++- web/build.gradle | 3 ++- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ApplicationInsightsInternalLogger/build.gradle b/ApplicationInsightsInternalLogger/build.gradle index bef70674d6a..c9e86a136cf 100644 --- a/ApplicationInsightsInternalLogger/build.gradle +++ b/ApplicationInsightsInternalLogger/build.gradle @@ -3,6 +3,7 @@ apply from: "$buildScriptsDir/common-java.gradle" archivesBaseName = 'ApplicationInsightsInternalLogger' dependencies { + testCompile group: 'org.hamcrest', name:'hamcrest-core', version:'1.3' testCompile group: 'org.hamcrest', name:'hamcrest-library', version:'1.3' testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' testCompile 'junit:junit:4.12' diff --git a/agent/build.gradle b/agent/build.gradle index 1a28eeb8cc7..6e0902ae7a2 100644 --- a/agent/build.gradle +++ b/agent/build.gradle @@ -53,7 +53,7 @@ dependencies { compile group: 'org.ow2.asm', name: 'asm-all', version: '5.2' compile group: 'org.apache.commons', name:'commons-lang3', version:'3.7' testCompile group: 'commons-io', name: 'commons-io', version: '2.6' + testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' } diff --git a/collectd/build.gradle b/collectd/build.gradle index b802b6eae3d..ef1a34ca835 100644 --- a/collectd/build.gradle +++ b/collectd/build.gradle @@ -61,7 +61,7 @@ sourceSets { dependencies { compile project(':core') provided files(collectDLibPath) - testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' + testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' testCompile group: 'junit', name: 'junit', version: '4.12' } diff --git a/core/build.gradle b/core/build.gradle index cd4cf6c99d4..325ef486760 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -118,9 +118,10 @@ dependencies { compile ([group: 'io.grpc', name: 'grpc-stub', version: '1.16.1']) compile ([group: 'io.grpc', name: 'grpc-protobuf', version: '1.16.1']) runtime ([group: 'io.grpc', name: 'grpc-netty-shaded', version: '1.16.1']) + testCompile group: 'org.hamcrest', name:'hamcrest-core', version:'1.3' testCompile group: 'org.hamcrest', name:'hamcrest-library', version:'1.3' - testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' + testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'com.google.code.gson', name: 'gson', version: '2.8.2' testCompile group: 'io.grpc', name:'grpc-testing', version:'1.16.1' } diff --git a/logging/logging.gradle b/logging/logging.gradle index d514c1aebd9..e33ec5138e2 100644 --- a/logging/logging.gradle +++ b/logging/logging.gradle @@ -61,14 +61,14 @@ findbugs.sourceSets = [sourceSets.main] // region Publishing properties whenPomConfigured = { p -> - p.dependencies = p.dependencies.findAll { dep -> dep.scope == "test" || dep.artifactId != "junit" && dep.artifactId != "mockito-all" } + p.dependencies = p.dependencies.findAll { dep -> dep.scope == "test" || dep.artifactId != "junit" && dep.artifactId != "mockito-core" } } // endregion Publishing properties dependencies { compile project(':core') + testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' } diff --git a/test/smoke/testApps/build.gradle b/test/smoke/testApps/build.gradle index 91f7b400a76..2c661c171d3 100644 --- a/test/smoke/testApps/build.gradle +++ b/test/smoke/testApps/build.gradle @@ -27,9 +27,10 @@ subprojects { dependencies { smokeTestCompile project(':test:smoke:framework:testCore') smokeTestCompile project(':test:smoke:framework:utils') + smokeTestCompile 'org.hamcrest:hamcrest-core:1.3' smokeTestCompile 'org.hamcrest:hamcrest-library:1.3' smokeTestCompile 'junit:junit:4.12' - + testCompile project(':test:smoke:framework:testCore') // not necessary; vs code bug workaround testCompile project(':test:smoke:framework:utils') testCompile 'junit:junit:4.12' diff --git a/web/build.gradle b/web/build.gradle index 5f9fddcfc27..0a5ccce656c 100644 --- a/web/build.gradle +++ b/web/build.gradle @@ -39,9 +39,10 @@ dependencies { provided 'org.springframework:spring-webmvc:3.1.0.RELEASE' provided group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1' provided group: 'javax.enterprise', name: 'cdi-api', version: '1.1' // Java EE + testCompile group: 'org.hamcrest', name:'hamcrest-core', version:'1.3' testCompile group: 'org.hamcrest', name:'hamcrest-library', version:'1.3' + testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19' testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.14.v20181114' testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.15.v20190215' testCompile group: 'org.eclipse.jetty', name: 'jetty-servlets', version: '9.4.15.v20190215'