-
Notifications
You must be signed in to change notification settings - Fork 93
Set up basic FIR infrastructure #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| interface NonAnnotationSchema | ||
|
|
||
| @Test fun nonAnnotatedSchemaThrows() { | ||
| assertFailsWith<IllegalArgumentException> { | ||
| parseProtocolSchemaSet(NonAnnotationSchema::class) | ||
| parser.parse(NonAnnotationSchema::class) | ||
| }.hasMessage( | ||
| "Schema app.cash.redwood.tooling.schema.SchemaParserTest.NonAnnotationSchema missing @Schema annotation", | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only test that's working in FIR (in this PR). It means we can successfully look up the schema type and can notice that it's missing annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
d4f3eb9 to
c9f1935
Compare
|
Well well well. This is interesting. So our CLI depends on the schema parser which gained an embeddable compiler dependency but also depends on AGP lint which has its own embeddable compiler dependency (but an older one). And due to the general instability of the compiler's API, any version deviation breaks the other. I think for now I'll just match lint's embeddable compiler version. Long term we probably want to eliminate the centralized CLI and instead have each tooling module provide its own CLI. This would have the parser exposing a JSON-producing command. The lint tooling would expose the lint command and the API merge command. And the code generator exposing the generate command. This is ideal because the Gradle plugin loads these in individual classpaths and forks a JVM to execute each tool. Thus, they would not longer interfere with each other. I'll do that next since it's pretty easy. |
|
Nope. Won't work. Versions are too far apart. Doing the other thing first. |
And prevent it from failing tests with an assumption.
c9f1935 to
a0c96a8
Compare
|
Might need to change the Lint worker isolation to prevent the dependency clash. We'll see. |
|
|
||
| // In order to simplify writing test schemas, inject the test sources and | ||
| // test classpath as properties into the test runtime. This allows testing | ||
| // the FIR-based parser on sources written inside the test case. Cool! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COOL!
Trying to pull out self-contained bits of this to start landing. Otherwise the final PR would be like 10,000 changed lines.
Refs #19