Skip to content

New user documentation#154

Draft
glelouet wants to merge 8 commits into
phax:masterfrom
glelouet:modif_readme_tests
Draft

New user documentation#154
glelouet wants to merge 8 commits into
phax:masterfrom
glelouet:modif_readme_tests

Conversation

@glelouet
Copy link
Copy Markdown
Contributor

@glelouet glelouet commented May 29, 2026

  • README.md
  • docs/contributing.md
  • docs/extending.md
  • docs/overview.md
  • docs/starting.md

initial :

@phax please make a pass to check if that is clear. The goal is to help other people, not make them more confused :D

@phax
Copy link
Copy Markdown
Owner

phax commented May 29, 2026

Looks fine to me. Do you want to add something on top of it?
Shall we add a statement on different Java versions, to use Maven profiles (I know I need to check the switch expression pr...)

@phax phax self-assigned this May 29, 2026
@glelouet glelouet marked this pull request as draft May 29, 2026 19:36
@glelouet
Copy link
Copy Markdown
Contributor Author

glelouet commented May 29, 2026

I think you're right, each feature should be documented. That would go in a dedicated doc/ folder though. Or docs / ? Or keep them at root / with .md to know they are doc ? I rather have them in dedicated folder, even though it makes links more awkard (starting with ../ )
Anyhow I rather have the root README.md cleaner with only simplest, most important things, but I agree that a nice doc goes a long way in helping people use a library more useful.

Now I don't think we should doc each feature about code, as those are better kept up-to-date with tests.
However I think a few features could be made tests for in the new jcodemodel-tests module since that contains both the generating code, and the generated resulting classes.

I made it a draft and will think about it once you give your opinion about the location, and the creation of additional test/example classes. Should I make an issue ? This way we can list what we want.

@glelouet glelouet force-pushed the modif_readme_tests branch from e2baebc to 8b13b8c Compare May 31, 2026 14:17
@glelouet
Copy link
Copy Markdown
Contributor Author

No answer, I put the doc in /documentation/ dir, with one contribution.md

@phax
Copy link
Copy Markdown
Owner

phax commented May 31, 2026

Super - sounds good :-) Thanks for your efforts

@phax
Copy link
Copy Markdown
Owner

phax commented May 31, 2026

Usually, I call the order docs but that really doesn't matter. So fine for me

@glelouet
Copy link
Copy Markdown
Contributor Author

glelouet commented May 31, 2026

No, we use docs. No point in being confused, I personally don't care. And I also usually go with docs/ .

@glelouet
Copy link
Copy Markdown
Contributor Author

glelouet commented May 31, 2026

@phax can you check the two md files ? starting is for people willing to use jcm, contributing is for people willing to help .

Note that I also changed the root readme.

@phax
Copy link
Copy Markdown
Owner

phax commented May 31, 2026

Sounds all fine for me - ready to merge?

@glelouet
Copy link
Copy Markdown
Contributor Author

glelouet commented May 31, 2026

I need to add part on using the plugins (in using.md) .

edit : plus a part on the general architecture (overview.md) alongside the scripts present, and a part on how to produce new generators (extending.md).

@glelouet glelouet changed the title Readme : adding testing explanations New user documentation May 31, 2026
@glelouet
Copy link
Copy Markdown
Contributor Author

@phax I added tasks at the top. Can you check that you can tick the README ; then check if README changes are correct, untick it if not ?

I made a second pass on starting. If you think it's good, tick it please.

@glelouet
Copy link
Copy Markdown
Contributor Author

glelouet commented Jun 4, 2026

Should be good, waiting for a review then I'll do another one too.

Comment thread docs/overview.md Outdated

- The [root pom project](../pom.xml)
- The [core project](../jcodemodel/pom.xml) lib to generate classes and resources programmatically.
- The [test project](../jccodemodeltests/pom.xml) validates the *generated* classes behavior.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Extra "c" in path

Comment thread docs/overview.md Outdated
- The [root pom project](../pom.xml)
- The [core project](../jcodemodel/pom.xml) lib to generate classes and resources programmatically.
- The [test project](../jccodemodeltests/pom.xml) validates the *generated* classes behavior.
- The [plugin](../plugin//plugin/pom.xml) to generate java classes in maven
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Single slash is sufficient :)

Comment thread docs/overview.md Outdated
- The [plugin](../plugin//plugin/pom.xml) to generate java classes in maven
- The various [plugin generators](../plugin/generators/pom.xml) to load a JCodeModel in the plugin
- The [examples](../examples/pom.xml) that showcase how to use JCodeModel, the plugin, the generators.
- The [beta](../beta/pom.xml) contains projects that may be merged into the core, or other modules, but could also be discarded entirely.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Well, we have no beta yet - is that another plan of yours?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nope, I put that quick. In the "maven hierarchy" discussion I was talking about /externals and /extensions .
Let's remove that for now.

Comment thread docs/contributing.md Outdated

#### Tabs vs spaces

This project uses double-space for indentation. If you want to use tabs, you can ask git to modify the files when commiting them and when pulling them. A [specific script](../sh/tabspaces) makes that change, run it from the root project.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

the link misses a cfg/

Comment thread docs/contributing.md Outdated

A generator generates a JCM that the plugin will export when requested.

- The generator module should be in the [../plugin/generators] submodule, with a module name starting with `GEN ` (in its pom) ;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Link is missing text

Comment thread docs/starting.md Outdated

### First program

Let's first make a simple program that generates a new, empty class. With [java 25](https://openjdk.org/jeps/445) you can create a file `JCMFirstProgram.java` containing only
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

445 => JEP 512 (final version)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

trust you, no check

Comment thread docs/starting.md Outdated
}
```

Then ask your IDE resolve the names for you. This should add imports at the top of the file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

...IDE to resolve...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But I only have one !
(JK)

Comment thread docs/starting.md Outdated

It's actually possible to have maven do two passes of compiling but this is a bad habit as it blurs the visibility of what is generated, embedded, and can lead to issues with non-deterministic approaches. See [stackoverflow](https://stackoverflow.com/questions/21342342/run-maven-compilation-twice)

#### Regorganising the maven project
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reorganising

Comment thread docs/starting.md Outdated

```xml
<project>
<dependencie>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

No description provided.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

+s

Comment thread README.md Outdated
<!-- ph-badge-end -->

A fork of the com.sun.codemodel 2.7-SNAPSHOT.
This project provides modeling and exporting java source code at java runtime, either in a pre-processing phase or to acces them using a dynamic Classloader.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

acces => access

@phax
Copy link
Copy Markdown
Owner

phax commented Jun 6, 2026

Just small bullshit - the rest is super :-D

@glelouet
Copy link
Copy Markdown
Contributor Author

glelouet commented Jun 6, 2026

Just small bullshit - the rest is super :-D

Nope, your points are very important. Any small issue can make it difficult to use.

@glelouet glelouet requested a review from phax June 6, 2026 21:20
@glelouet
Copy link
Copy Markdown
Contributor Author

glelouet commented Jun 6, 2026

No missing important information ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants