Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

API requirements should be generated #53

Closed
sebinside opened this issue Jun 17, 2019 · 7 comments
Closed

API requirements should be generated #53

sebinside opened this issue Jun 17, 2019 · 7 comments
Assignees
Labels
api Requires api changes enhancement New feature or request major Needs a major platform / framework / build environment rework
Milestone

Comments

@sebinside
Copy link
Member

Besides writing an Input or Output inside the API project for a new platform source, these in/outputs have also to be registered inside the API. There should be a solution, generating this files, since their content holds no new information.

Another idea would be overloading methods.

See, e.g.: https://github.com/codeoverflow-org/chatoverflow-api/blob/master/src/main/java/org/codeoverflow/chatoverflow/api/plugin/configuration/Input.java

@sebinside sebinside added enhancement New feature or request major Needs a major platform / framework / build environment rework labels Jun 17, 2019
@sebinside sebinside added this to the pre-alpha 3 milestone Jun 17, 2019
@sebinside sebinside self-assigned this Jun 17, 2019
@J0B10 J0B10 added the api Requires api changes label Jun 18, 2019
@sebinside
Copy link
Member Author

sebinside commented Jul 1, 2019

Current plan: Adding a new annotation to annotate input/output/parameter interfaces in the API. Then, after building the API, a custom sbt task with own class loader loads the API.jar, scanns for annotated interfaces and freshly generates the Input/Output/Parameter Requirement classes, e.g. https://github.com/codeoverflow-org/chatoverflow-api/blob/master/src/main/java/org/codeoverflow/chatoverflow/api/plugin/configuration/Input.java

Then, the API is built again with the new files (which are also commited, still beeing artefacts).

Comments? @joblo2213 @daniel0611

@hlxid
Copy link
Member

hlxid commented Jul 2, 2019

I think it's fine, no objections.

@J0B10
Copy link
Member

J0B10 commented Jul 3, 2019

👍

@sebinside
Copy link
Member Author

Okay, I need help here: Everything is annotated and I integrated a annotation inspection in the compile process. The idea is to read the generated files, get all annotated interfaces through reflection, generated the files and build again. But I'm not able to import the dependencies correctly. Solutions? @daniel0611

https://github.com/codeoverflow-org/chatoverflow/blob/feature/53-requirements-generator/project/APIUtility.scala#L17

@sebinside sebinside added the help wanted Extra attention is needed label Jul 11, 2019
@hlxid
Copy link
Member

hlxid commented Jul 11, 2019

Sure, I'll look into it tomorrow.

@hlxid
Copy link
Member

hlxid commented Jul 12, 2019

Apparently /project is a full sbt sub-project, meaning you can just create a file at /project/build.sbt containing the following:

libraryDependencies += "org.reflections" % "reflections" % "0.9.11"

And after a reload in IntelliJ you can import the added dependency successfully.

@sebinside sebinside removed the help wanted Extra attention is needed label Jul 13, 2019
@sebinside
Copy link
Member Author

Done! This was a great one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api Requires api changes enhancement New feature or request major Needs a major platform / framework / build environment rework
Projects
None yet
Development

No branches or pull requests

3 participants