vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

AutoValue_BigQueryResult cannot be resolved to a type

Open siddjain opened this issue 3 years ago • 3 comments

[provide a description of the issue]

Environment
  • Operating System: Darwin x64 20.6.0
  • JDK version: java.version=17.0.3
  • Visual Studio Code version: 1.68.1 (Universal)
  • Java extension version:what is this?
  • Java Debugger extension version:v0.41.0
Steps To Reproduce
  1. try compiling https://github.com/GoogleCloudPlatform/pontem/tree/dev/BigQueryWorkloadTester

I have verified the code compiles on the command line using gradle 7.4

[attach a sample project reproducing the error] attach logs https://gist.githubusercontent.com/siddjain/128aac8c8347d8a6f1b9b29fcb6b2760/raw/24995bcb9ba270f12d205f0669e637be9d623883/gistfile1.txt

Current Result
image
Expected Result

no error

Additional Informations

siddjain avatar Jun 25 '22 01:06 siddjain

I think this issue belongs in this project: https://github.com/redhat-developer/vscode-java

siddjain avatar Jun 25 '22 03:06 siddjain

@siddjain you can try the following:

git clone [email protected]:GoogleCloudPlatform/pontem.git
cd pontemp
git apply <patch>
cd BigQueryWorkloadTester
gradle clean :BigQueryWorkloadTester:build
code .

The patch:

diff --git a/BigQueryWorkloadTester/build.gradle b/BigQueryWorkloadTester/build.gradle
index 0315271..16c6401 100644
--- a/BigQueryWorkloadTester/build.gradle
+++ b/BigQueryWorkloadTester/build.gradle
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 apply plugin: "application"
+apply plugin: "eclipse"
 
 group = 'com.google.cloud'
 version = '0.1'
@@ -26,20 +27,32 @@ targetCompatibility = 1.8
 
 repositories {
      maven { url "https://repository.apache.org/content/repositories/snapshots/" }
-     maven { url "http://repo.maven.apache.org/maven2" }
+     maven { url "https://repo.maven.apache.org/maven2" }
 }
 
 dependencies {
-  compile group: 'com.google.api', name: 'gax-grpc', version: '1.37.0'
-  compile group: 'com.google.auto.value', name: 'auto-value', version: '1.6.3'
-  compile group: 'com.google.auto.value', name: 'auto-value-annotations', version: '1.6.3'
-  compile group: 'com.google.cloud', name: 'google-cloud-bigquery', version:'1.56.0'
-  compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
-  compile group: 'com.google.guava', name: 'guava', version:'20.0'
-  compile group: 'org.yaml', name: 'snakeyaml', version: '1.23'
-
-  testCompile group: 'com.google.guava', name: 'guava-testlib', version: '27.0.1-jre'
-  testCompile group: 'org.mockito', name: 'mockito-core', version:'2.23.4'
-  testCompile group: 'junit', name: 'junit', version:'4.12'
+  implementation group: 'com.google.api', name: 'gax-grpc', version: '1.37.0'
+  implementation group: 'com.google.auto.value', name: 'auto-value', version: '1.6.3'
+  implementation group: 'com.google.auto.value', name: 'auto-value-annotations', version: '1.6.3'
+  annotationProcessor "com.google.auto.value:auto-value:1.6.3"
+  implementation group: 'com.google.cloud', name: 'google-cloud-bigquery', version:'1.56.0'
+  implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
+  implementation group: 'com.google.guava', name: 'guava', version:'20.0'
+  implementation group: 'org.yaml', name: 'snakeyaml', version: '1.23'
+
+  testImplementation group: 'com.google.guava', name: 'guava-testlib', version: '27.0.1-jre'
+  testImplementation group: 'org.mockito', name: 'mockito-core', version:'2.23.4'
+  testImplementation group: 'junit', name: 'junit', version:'4.12'
+}
+
+eclipse {
+    classpath {
+        containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
+        file.whenMerged { cp ->
+            def entries = cp.entries;
+            def src = new org.gradle.plugins.ide.eclipse.model.SourceFolder('build/generated/sources/annotationProcessor/java/main/', null)
+            entries.add(src)
+        } 
+    }
 }
 
diff --git a/build.gradle b/build.gradle
index 715082f..49d437e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -23,14 +23,14 @@ ext.java = false
 // note that this is an inversion of Gradle's classic execution and could 
 // have side effects. We don't expect this to happen if we keep our subproject
 // structure simple.
-evaluationDependsOnChildren()
+//evaluationDependsOnChildren()
 
 subprojects { subproject ->
     if (subproject.java) { 
         apply plugin: "checkstyle"
         apply plugin: "jacoco"
         apply plugin: "java"
-        apply plugin: "maven"
+        apply plugin: "maven-publish"
 
         checkstyle {
             configFile file("${rootDir}/config/checkstyle/checkstyle.xml")

snjeza avatar Jun 25 '22 17:06 snjeza

Thanks. I found something weird. Even though I get compile errors with my code (which does not include the patch), VS Code gives me an option to Proceed (when I try to run the code using F5). If I click on it, the code runs. So not applying the patch for now.

siddjain avatar Jun 26 '22 04:06 siddjain