manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.43k stars 125 forks source link

Cannot get it working - error: cannot find symbol #356

Closed mklueh closed 2 years ago

mklueh commented 2 years ago

Hello,

I'm really glad I've discovered this amazing project, but I'm running into a weird error with manifold and I cannot get it working at all. The project is a multi-module Gradle setup and I'm using manifold version 2022.1.9

TestCsv.csv

a  ,b  ,c
bla,bli,blub
    @Test
    void calculate() {
        TestCsv test = TestCsv.fromSource();

        for (TestCsv.TestCsvItem testCsvItem : test) {
            System.out.println(testCsvItem.getA__());
        }
    }

root build.gradke

buildscript {
    repositories {
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
    }
}

plugins {
    id 'io.spring.dependency-management' version "${springDependencyManagementVersion}"
    id 'systems.manifold.manifold-gradle-plugin' version '0.0.2-alpha'
    id 'org.springframework.boot' version "${springVersion}"
}

subprojects {

    apply plugin: 'java'
    apply plugin: 'idea'
    apply plugin: 'com.adarshr.test-logger'
    apply plugin: 'io.spring.dependency-management'

    sourceCompatibility = '11'
    targetCompatibility = '11'

    compileJava.options.encoding = 'UTF-8'
    compileTestJava.options.encoding = 'UTF-8'

    test {
        useJUnitPlatform()
    }

    tasks.withType(JavaCompile) {
        options.compilerArgs += ['-Xplugin:Manifold']
    }

    dependencies {

        implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        implementation "systems.manifold:manifold-ext:${manifoldVersion}"
        implementation "systems.manifold:manifold-science:${manifoldVersion}"

        testImplementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        testImplementation "systems.manifold:manifold-ext:${manifoldVersion}"
        testImplementation "systems.manifold:manifold-science:${manifoldVersion}"

        annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
        testAnnotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
    }

    configurations {
        all {
            //noinspection GroovyAssignabilityCheck
            exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
        }

        // give tests access to annotationProcessor dependencies
        testImplementation.extendsFrom annotationProcessor
    }

}

Leads to this error

Error compiling Java class: test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv

/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:3: error: test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv is not abstract and does not override abstract method remove(int) in java.util.List
public class java_util_ArrayList_structuralproxy_test_carbon_TestCsv implements test.carbon.TestCsv {
       ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:16: error: remove(int) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv cannot implement remove(int) in manifold.ext.rt.api.IListBacked
  public java.lang.Object remove( int p0 ) {
                          ^
  return type java.lang.Object is not compatible with test.carbon.TestCsv.TestCsvItem
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:22: error: get(int) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv cannot implement get(int) in manifold.ext.rt.api.IListBacked
  public java.lang.Object get( int p0 ) {
                          ^
  return type java.lang.Object is not compatible with test.carbon.TestCsv.TestCsvItem
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:10: error: name clash: add(java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and add(test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public boolean add( java.lang.Object p0 ) {
                 ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:13: error: name clash: add(int,java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and add(int,test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public void add( int p0, java.lang.Object p1 ) {
              ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:70: error: name clash: set(int,java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and set(int,test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public java.lang.Object set( int p0, java.lang.Object p1 ) {
                          ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:101: error: cannot find symbol
    return (java.util.List)manifold.ext.rt.RuntimeMethods.coerce(_root.getList(), java.util.List.class);
                                                                      ^
  symbol:   method getList()
  location: variable _root of type java.util.ArrayList
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

manifold.internal.javac.JavaCompileIssuesException: Error compiling Java class: test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv

/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:3: error: test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv is not abstract and does not override abstract method remove(int) in java.util.List
public class java_util_ArrayList_structuralproxy_test_carbon_TestCsv implements test.carbon.TestCsv {
       ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:16: error: remove(int) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv cannot implement remove(int) in manifold.ext.rt.api.IListBacked
  public java.lang.Object remove( int p0 ) {
                          ^
  return type java.lang.Object is not compatible with test.carbon.TestCsv.TestCsvItem
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:22: error: get(int) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv cannot implement get(int) in manifold.ext.rt.api.IListBacked
  public java.lang.Object get( int p0 ) {
                          ^
  return type java.lang.Object is not compatible with test.carbon.TestCsv.TestCsvItem
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:10: error: name clash: add(java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and add(test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public boolean add( java.lang.Object p0 ) {
                 ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:13: error: name clash: add(int,java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and add(int,test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public void add( int p0, java.lang.Object p1 ) {
              ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:70: error: name clash: set(int,java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and set(int,test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public java.lang.Object set( int p0, java.lang.Object p1 ) {
                          ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:101: error: cannot find symbol
    return (java.util.List)manifold.ext.rt.RuntimeMethods.coerce(_root.getList(), java.util.List.class);
                                                                      ^
  symbol:   method getList()
  location: variable _root of type java.util.ArrayList
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

    at manifold.internal.runtime.protocols.ManClassesUrlConnection$LazyByteArrayInputStream.compileProxyClass(ManClassesUrlConnection.java:344)
    at manifold.internal.runtime.protocols.ManClassesUrlConnection$LazyByteArrayInputStream.init(ManClassesUrlConnection.java:247)
    at manifold.internal.runtime.protocols.ManClassesUrlConnection$LazyByteArrayInputStream.read(ManClassesUrlConnection.java:367)
    at java.base/jdk.internal.loader.Resource.getBytes(Resource.java:124)
    at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:797)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:398)
    at manifold.ext.StructuralTypeProxyGenerator.makeProxy(StructuralTypeProxyGenerator.java:65)
    at manifold.ext.DynamicProxyFactory.makeProxyFactory(DynamicProxyFactory.java:58)
    at manifold.ext.rt.RuntimeMethods.createProxy(RuntimeMethods.java:419)
    at manifold.ext.rt.RuntimeMethods.createNewProxy(RuntimeMethods.java:391)
    at manifold.ext.rt.RuntimeMethods.constructProxy(RuntimeMethods.java:67)
    at com.myapplication.test.MyTest.calculate(MyTest.java:19)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
    at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:212)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:208)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:137)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:71)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248)
    at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211)
    at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    at com.sun.proxy.$Proxy2.stop(Unknown Source)
    at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
    at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.base/java.lang.Thread.run(Thread.java:834)

Would appreciate any help.

rsmckinney commented 2 years ago

Hi @mklueh.

Remove the manifold-ext in your implementatoin dependencies. In your case, manifold-ext is implicitly used through manifold-csv as an annotationProcessor path. It should not be used as an implementation dep. Also, since you are using testImplementation.extendsFrom annotationProcessor, you can eliminate all the test related dependencies too.

    dependencies {
        implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        implementation "systems.manifold:manifold-science:${manifoldVersion}"

        annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
    }
mklueh commented 2 years ago

@rsmckinney thanks.

First of all, I always have another problem that the class seems to be not generated and I have to rename the csv file to trigger the annotation processor again in order to make the IDE recognize the file.

As for the actual problem, I tried it the other way around first by removing testImplementation.extendsFrom annotationProcessor and just having these in place:

        implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        testImplementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
        testAnnotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"

It leads to package com.mypackage.MyCsvClass does not exist when running the test. The IDE however does not complain and finds the package.

When I have the other solution in place

        implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        //testImplementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
        //testAnnotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"

together with

configurations {
    // give tests access to annotationProcessor dependencies
    testImplementation.extendsFrom annotationProcessor
}

I get

error: plug-in not found: Manifold
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':my-application-core:compileTestJava'.
> Compilation failed; see the compiler error output for details.
* Try:

Currently, I'm using Gradle 6.9.2

rsmckinney commented 2 years ago

I've configured a similar project locally and it works okay here. Any chance your project is available on github or similar so I can help configure it?

mklueh commented 2 years ago

@rsmckinney also a multi-module project with Gradle?

I try to create a reproducer

mklueh commented 2 years ago

@rsmckinney I've created one, with just one module but still having the same problem

https://github.com/mklueh/spring-gradle-multi-module-manifold-reproducer

There are three screenshots of things that happen one after another. When 3. happens, I need to rename the csv file or delete and recreate it

rsmckinney commented 2 years ago

@mklueh Looks like the problem is simply that TestData.csv is in resources/com.example/. Should be in resources/com/example/TestData.csv. I feel like IntelliJ should warn about creating a resource directory with a dot in it. Anyhow, should be a simple fix on your end.

mklueh commented 2 years ago

@rsmckinney you are right with that, however the problem still exists. Have you managed to get it working with my reproducer?

rsmckinney commented 2 years ago

@mklueh Yes, that is the only change that was necessary. Works fine for me.

rsmckinney commented 2 years ago

@mklueh Ok, I do have an issue after I built on the command line. Looking at this now.

rsmckinney commented 2 years ago

Looks like an issue with the testImplementation.extendsFrom annotationProcessor trick. I don't think that works quite the way it's intended. If I remove that and add the testAnnotationPrcoessor for csv, it works fine. However, I had to muck with the spring boot stuff; it didn't work as it was setup. Here are the significant changes:

    dependencies {
        implementation "org.springframework.boot:spring-boot-starter"

        compileOnly 'org.projectlombok:lombok'
        annotationProcessor 'org.projectlombok:lombok'
        testImplementation 'org.springframework.boot:spring-boot-starter-test'

        implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
//## UNNECESSARY, tests inherit implementation dependencies
//        testImplementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
//## ADDED
        testAnnotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"

        testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
        testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
        testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
    }

    tasks.withType(JavaCompile) {
        options.compilerArgs += ['-Xplugin:Manifold']
    }

    configurations {
        all {
            //noinspection GroovyAssignabilityCheck
            exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
        }

//## REMOVE  
//        // give tests access to annotationProcessor dependencies
//        testImplementation.extendsFrom annotationProcessor
    }
rsmckinney commented 2 years ago

changes work locally, please reopen if your issue persists, thanks