RM2PT Tutorial

RM2PT Generator Project

Create CodeGenerator Project in RM2PT

In RM2PT, File -> New Project

image-20210119173318294

Type project name e.g., SpringBoot

image-20210119173318294

Click “Next >”

image-20210119173429279

Click “Finish “

All the startup projects will be generated in project explorer as follows:

image-20210119173819063

The main generator template is located in src-> package (ArtifactID) -> CodeGenerator.xtend

Note that code template is coded by Xtend language.

image-20210119174244834

Test your generator project

image-20210119174458881

Double Click Eclipse Application

image-20210119174536376

Click Run to open a new Eclipse IDE and then import the requirements model, and right click .remodel and choose RM2PT-Dev / Generate XX Code

image-20210119182222816

The generated code are shown as follows:

image-20210119182339221

Package Code Generator Project through Maven

image-20210119182537487

The Console will show the result as follows:

image-20210119183048412

The finally code generator p2 updatesite is located in xxx.updatesite/target

you can distribute .zip to others to install your code generator

Upload your source code to github with CI/CD support

Create a project on Github

image-20210119172748935

The default code generator project includes CI/CD script under .github/workflow/CICD.yml, you should add your PUSH_Token to secerts to make CI/CD work.

To your github ‘setting / Developer settings / Personal access tokens’, click generate new token. Note that you should select scope of repo and workflow

image-20210119185556506

Then go back to your project, click settings / Secrets, and then paste the tokens with name PUSH_TOKEN

image-20210119185735329

Push your source code to Github Repo

image-20210119185832926image-20210119185859499

Click Create Repository

image-20210119185933235

image-20210119190043832

Click Commit and Push

Note that you should configure your ssh key propertly if your use ssh way.

image-20210119190201887

image-20210119190220132

Check CI/CD result

image-20210119191246374

image-20210119191304081

Push to RM2PT Plugins Repo

send your application email to yilongyang@buaa.edu.cn, then RM2PT will create a repo for your, then you can push your source code to RM2PT repo.