CGFileMerge - Merge multi file workspace into one cg conform file

I already posted it in the chat, but why not also over it here.
We all know the Problem of all classes in one file and it can be a mess.

Thats why i wrote quite a while ago a tool to merge my local workspace into one cg conform file

This little program has the following features (or should have when the last changes are added):

  • remove all package lines and merge everything in the default package
  • merge imports of all files found identified by the line starting with import and remove those of in-project imports
  • replace all modifiers in front of class, interface, enum and remove it public class -> class
  • writes everything into a output file at the given location
  • watches the given directory for changes and automatically merges them into the output file (this way i can be used with CgSync and CgLocal to directly send the saved changes to the web ide)

Hope you like it and it helps you to handle your code :wink:

Got one report that it does not work on linux. Didn’t try it myself by now on linux.


Thanks for this project !

I successfully ran it with maven on my linux system.


I tried this solution and somehow it’s not working for me :frowning:

I copied specified code to my pom and after packaging mvn, jar file was created in target folder with name of my project name.

What should I do next?
I tried to run this jar directly from Intellij and command line, but error appears “no main manifest attribute…”.
I tried to add something to pom, based on internet advises, but it didn’t help.

Thanks for any advise,

You can either download a build jar from here -> and run it as mentioned in the README with
java -jar CGFileMerge-0.0.1-SNAPSHOT.jar /PATH/TO/PROJECT/ROOT/src/main/java /PATH/TO/PROJECT/ROOT/

or as i usally do it, i add it as dependency to my project and run in the ide a task with as main class and ./src/main/java as parameter

1 Like