Skip to content
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

Auto-generate defines and metas from JSON files #8195

Merged
merged 19 commits into from
May 23, 2019

Conversation

Aurel300
Copy link
Member

@Aurel300 Aurel300 commented Apr 22, 2019

Facilitates easier integration of defines / metadata with the manual, IDE integration, etc. Closes #8035.

  • list of defines/metadata (type strict_defined, type strict_meta) along with their description functions (infos, get_info) moved into JSON files src-json/define.json and src-json/meta.json
  • new prebuild OCaml utility added as a Makefile step, parses JSON + outputs OCaml files
  • Merlin compatibility (should work if we add S _build/src/core/defineList.ml and S _build/src/core/metaList.ml to .merlin) works as-is

@Aurel300 Aurel300 requested a review from Simn April 22, 2019 12:07
@RealyUniqueName
Copy link
Member

Does it play well with merlin?

@Gama11 Gama11 changed the title Auto-generate defines and metas from JSON files Auto-generate defines and metas from JSON files, closes #8035 Apr 22, 2019
@Aurel300 Aurel300 changed the title Auto-generate defines and metas from JSON files, closes #8035 Auto-generate defines and metas from JSON files Apr 22, 2019
@skial skial mentioned this pull request Apr 24, 2019
1 task
@@ -22,6 +22,7 @@ MAKEFILENAME?=Makefile
PLATFORM?=unix

OUTPUT=haxe
PREBUILD_OUTPUT=prebuild
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be added to .gitignore

@Simn
Copy link
Member

Simn commented May 22, 2019

What's the status here?

@Aurel300
Copy link
Member Author

What's the status here?

I was unable to solve the CI build failure. It's probably related to the build order somehow but I cannot reproduce it at all (even works with make -j). Currently focusing on other tasks (libuv in HL), so this is in my backlog.

@Simn
Copy link
Member

Simn commented May 23, 2019

Can you try if it reproduces after a make clean locally?

@kLabz
Copy link
Contributor

kLabz commented May 23, 2019

I tried to reproduce yesterday locally, and couldn't even with make clean

@Simn
Copy link
Member

Simn commented May 23, 2019

On what OS?

@kLabz
Copy link
Contributor

kLabz commented May 23, 2019

Linux (arch linux)

@Simn
Copy link
Member

Simn commented May 23, 2019

Did you try with a fresh checkout or git clean -dfx?

@Simn Simn merged commit 7f095f0 into HaxeFoundation:development May 23, 2019
@Aurel300 Aurel300 deleted the feature/autogen-define-meta branch May 23, 2019 12:06
@@ -122,20 +122,29 @@
"doc": "Erase generic classes on C#",
"platforms": ["cs"]
},
{
"name": "EvalCallStackDepth",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I've wondered, isn't having both name and define a bit redundant (i.e. couldn't one be derived from the other, or are there exceptions)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally you could probably derive the defines from the OCaml name (except the unfortunate case of HxcppSmartStings, which somehow went by unnoticed). Since dot notation was introduced into metadata, the mapping may be less obvious – there are still many fields which use the un-dotted identifier. For defines this might be easier?

But to be honest I did not thoroughly think about unifying name and define (or metadata). I also think it's fine if it is done as part of another PR at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract infos from from define.ml and meta.ml into JSON files
5 participants